Giter Site home page Giter Site logo

odada's Introduction

Rethinking adversarial domain adaptation: Orthogonal decomposition for unsupervised domain adaptation in medical image segmentation

This repository provides the code for "Rethinking adversarial domain adaptation: Orthogonal decomposition for unsupervised domain adaptation in medical image segmentation". Our work is accepted by MedIA mia_link.

ODADA Fig. 1. Structure of ODADA.

Requirementss

Some important required packages include:

  • Pytorch version >=0.4.1.
  • Python == 3.7
  • Some basic python packages such as Numpy.

Follow official guidance to install Pytorch.

Dataset

This Repository contains a toy dataset (HK and BIDMC) for reimplement. You can download a full-version dataset via https://drive.google.com/drive/folders/1KEomtcpTUYCc94nAvEBBsT3vvLnR4rPN?usp=share_link If the data violates privacy, please let us know in time.

Usages

For multi-site prastate segmentation

  1. To train ODADA for multi-site prostate segmentation, run:
python main.py
  1. Our experimental results are shown in the table: refinement

Citation

If you find our work is helpful for your research, please consider to cite:

@article{sun2022rethinking,
  title={Rethinking adversarial domain adaptation: Orthogonal decomposition for unsupervised domain adaptation in medical image segmentation},
  author={Sun, Yongheng and Dai, Duwei and Xu, Songhua},
  journal={Medical Image Analysis},
  pages={102623},
  year={2022},
  publisher={Elsevier}
}

odada's People

Contributors

yonghengsun1997 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

odada's Issues

reproducibility

Hi, I download the full version cross-site prostate dataset (HK and BIDMC) provided in README, then run python main.py, and the testing results are:

Training Done! Start testing
=> Loading checkpoint 'log/1109/prostate_8bc_lr1e-3_UNetODADA_3step121_GC_C/2018/folder3/UNet_DA_loss_MedT/best_score_2018_checkpoint.pth.tar'
=> Loaded saved the best model at (epoch 315)
100%|██████████████████████████████████████████████████████████████████████████████| 22/22 [00:00<00:00, 26.47it/s]
avg_surf_dist_3D: (0.36792447706956555, 0.2899364095854785)
hd_dist_95_3D: 2.0
surface_overlap_3D: (0.9138823276712713, 0.9249319974762614)
surface_dice_3D: 0.919245792444278
volume_dice_3D: 0.889567523506653
The mean asd_2D:  2.6425; The ads_2D std:  1.0628
The  mean dice:  0.9230; The  dice std:  0.0545
The  mean IoU:  0.7537; The  IoU std:  0.1504
The  mean ACC:  0.9913; The  ACC std:  0.0038
The  mean sensitive:  0.9056; The  sensitive std:  0.0592
The  mean specificy:  0.9947; The  specificy std:  0.0043
The  mean precision:  0.8234; The  precision std:  0.1692
The  mean f1_score:  0.8506; The  f1_score std:  0.1080
The  mean Jaccard_M:  0.7542; The  Jaccard_M std:  0.1504
The  mean Jaccard_N:  0.9910; The  Jaccard_N std:  0.0039
The  mean Jaccard:  0.7542; The  Jaccard std:  0.1504
The  mean dc:  0.8506; The  dc std:  0.1080
The inference time:  0.2975
Number of trainable parameters 60568132 in Model UNet_DA
100%|██████████████████████████████████████████████████████████████████████████████| 11/11 [00:00<00:00, 35.44it/s]
avg_surf_dist_3D: (0.8326537194762975, 0.7805250157971086)
hd_dist_95_3D: 3.1622776601683795
surface_overlap_3D: (0.7670339066074607, 0.7540540050210169)
surface_dice_3D: 0.7605979811923145
volume_dice_3D: 0.8009900649730138
The mean asd_2D:  3.8848; The ads_2D std:  1.3398
The  mean dice:  0.8838; The  dice std:  0.0518
The  mean IoU:  0.6407; The  IoU std:  0.1330
The  mean ACC:  0.9895; The  ACC std:  0.0032
The  mean sensitive:  0.8097; The  sensitive std:  0.1096
The  mean specificy:  0.9933; The  specificy std:  0.0029
The  mean precision:  0.7475; The  precision std:  0.1224
The  mean f1_score:  0.7730; The  f1_score std:  0.1025
The  mean Jaccard_M:  0.6411; The  Jaccard_M std:  0.1330
The  mean Jaccard_N:  0.9893; The  Jaccard_N std:  0.0032
The  mean Jaccard:  0.6411; The  Jaccard std:  0.1330
The  mean dc:  0.7730; The  dc std:  0.1025
The inference time:  0.1452
Number of trainable parameters 60568132 in Model UNet_DA
Testing Done!

The upper part is for test dataset a, i.e. BIDMC, while the lower part is test dataset b, i.e. HK. The lower part doesn't fully match the results reported in table 1 in the paper. For example:

  • sensivitity (0.8097 in output v.s. 87.43 in paper table 1)
  • HD (3.1622 v.s. 7.78)

关于最佳模型的保存问题

作者你好,我从代码里看到最佳模型的保存是基于在a域验证集的指标进行保存的,请问你一直是用的a域验证集的指标进行保存的模型吗?没有用b域验证集的指标进行保存的模型是不?万分感谢您能为我解惑

No Models.model_mia1201.UNet_DA

Hello, excuse me, I did not find the Models.model_mia1201.UNet_DA package that includes the model architecture. I would like to take a look at the Orthogonal loss you proposed. I think it is calculated in the model, but I did not find your model architecture code.

关于数据集

作者,您好!我已经在google driver上申请了下载完整的数据集,请问什么时候可以访问?这些数据都是和data/datalist/.txt里面一样处理好的npy文件吗?

Several questions about the network

Several questions about the network and tha data

Hello! I have 3 questions about ODAADA to ask you for help.

First, when I use your UNet_DA code in the repo, I got an error of this:

ValueError: not enough values to unpack (expected 4, got 3)

I think that in the line 317 of Models/model_mia1201.py, prob = self.domain_classifier(f_ds) should be edited to:

prob_di = self.domain_classifier(f_di)
prob_ds = self.domain_classifier(f_ds)

In the line 333 , return final, loss_orthogonal, prob should be edited to:

return final, loss_orthogonal, prob_di, prob_ds

I don't know whether it's right or not. Looking forward to your debug.

Second, your code set the in_channels=3 and out_channels=2 in default when you pre-poccess the data into 1 slice if I didn't make misunderstand. It's contradiction and should all be set to 1.

Finally, I was wondering what hyper-parameters did you use when you were training on the Multi-site Dataset for Prostate MRI Segmentation Dataset because I am reproduce your work. Is Adam optimizer and learning rate of 1e-3 with CosineAnnealingWarmRestarts for 150 epochs as the paper wrote?

In addition, I would appreciate it if you could release the model files you trained on the prostate dataset in your paper Rethinking adversarial domain adaptation: Orthogonal decomposition for unsupervised domain adaptation in medical image segmentation.

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.