Giter Club home page Giter Club logo

epl_semidg's Introduction

AAAI 2022: Enhancing Pseudo Label Quality for Semi-Supervised Domain-Generalized Medical Image Segmentation

This is a PyTorch implementation of Enhancing Pseudo Label Quality for Semi-Supervised Domain-Generalized Medical Image Segmentation.

The overall framework

framework

Architecture of the code:

  • config.py(config file)
  • inference_mms.py(inference file for M&Ms dataset)
  • inference_scgm.py(inference file for SCGM dataset)
  • mms_dataloader.py(dataloader for M&Ms dataset)
  • scgm_dataloader.py(dataloader for SCGM dataset)
  • mms_train.py(train file for M&Ms dataset)
  • scgm_train.py(train file for SCGM dataset)
  • network(network folder including deeplabv3p)
  • utils(utils folder including some useful functions)

Preparation

Datasets

Preprocessing

We followed the preprocessing of Semi-supervised Meta-learning with Disentanglement for Domain-generalised Medical Image Segmentation, you can find the preprocessing code here. After that, you should change the data directories in the dataloader(mms_dataloader or scgm_dataloader) file.

Environments

We use wandb to visulize our results. If you want to use this, you may need register an account first.

Use this command to install the environments.

conda env create -f semi_dg.yaml

How to Run

Pretrain backbone

We use the resnet-50 as our backbone and it is pretrained on Imagenet. You can download this here.

Released model weights

You can find the trained model weights here

Training

If you want to train the model on M&Ms dataset, you can use this command. You can find the config information in config.py.

python mms_train.py

Evaluate

If you want to evaluate our models on M&Ms dataset, you can use this command. And you should change the model name(line 320 and 321) and the test_vendor(line 318) to load different models.

python inference_mms.py

Main Results

result

Citation

If this code is useful for your research, please consider citing:

@article{yao2022enhancing,
  title={Enhancing Pseudo Label Quality for Semi-SupervisedDomain-Generalized Medical Image Segmentation},
  author={Yao, Huifeng and Hu, Xiaowei and Li, Xiaomeng},
  journal={arXiv preprint arXiv:2201.08657},
  year={2022}
}

epl_semidg's People

Contributors

nekomiao123 avatar xmengli avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

epl_semidg's Issues

训练权重

您好,我想用您的训练后的权重复现一下您的实验结果,您公布的是百分之2和百分之5训练数据的权重,按道理说应该是M&MS数据集的啊,但为什么最后经过证明我认为是SCGM数据集的权重。SCGM是用的百分之20的数据,所以这个权重到底是哪个数据集的呢?可以解答一下吗?

种子数

您好,我看了您的代码,在训练和测试的代码中您都设置了种子数,但是对于训练代码,用同一个种子数的情况下重复多次实验得到的不同权重进行测试,最终得到的测试结果是不同的,我想问一下,为什么设置了种子数但是多次训练得到的结果不同呢?我猜想是不是这个原因:upsample_bilinear2d_backward_out_cuda does not have a deterministic implementation,另外,您在论文中得到的实验结果是多次实验得到的平均值吗?

dataset

Hello, I would like to ask how the M&M dataset is downloaded? I found the designated website, but I ran into some difficulties. Is there any other way to download?

backbone

Hello, I see that your code comparison articles are all based on unet as the backbone, but your article is based on resnet50 as the backbone. Is it unfair to compare with different backbones?

训练过程的问题

您好,我想问一下我下载完代码后,用SCGM数据集训练时,出现loss都为Nan的情况,是什么原因造成的呢?

Data processing issues

Hello, my current focus is also on semi supervised domain generalization, and I am very interested in your paper. Note that your paper refers to the Meta article when processing data, but in the publicly available code for processing the MMs dataset, the length of labeled data in each training domain is aligned, while in your paper, the length of labeled and unlabeled data is aligned, which increases the amount of data to some extent. Is this comparison fair and reasonable?

save a checkpoint at this epoch

Hello, Dr. Yao. I would like to ask in your EPL_SemiDG code, when saving the best checkpoint, your code is to save it if val_dice > best_dice. I would like to ask why you don't choose if test_dice > best_dice to save it? If you have time can you reply? Thank you so much!

标记数据比例

你好,实验中需要在哪里修改标记数据比例呢?我之前做的半监督医学图像分割,是将batch_size前一半数据从标记数据选取,后一半从无标记数据选取 ,但是半监督域泛化好像并不是这样处理的。

只用有标签数据和有标签数据无标签数据都用的实验效果差别

您好,我想问下,只用有标签数据和有标签数据无标签数据都用这两者在您的实验中效果差别大吗?我跑了您给的代码,设定了种子数,我对上面这两种情况进行了实验,发现在SCGM数据集的D域中两者测试准确率只相差0.04,在A域的实验中有标签数据无标签数据都用比只用有标签数据的效果还差。我想问下这是什么原因呢?

标准偏差

您好,图表中的标准偏差是怎么计算的啊?

Training, Validation, Test Dataset Split

This code is a great implementation of the research article that you published. I read through the code, and it is easy to read/understand, but I have three inquiries.

  1. Are the unique images in the training set the same as in the validation set with no split?
    because I can see "val_dataset." is equal to the "label_dataset" before you duplicate the "label_dataset" multiple times to "new_label_dataset."

  2. if the first question is yes, then are you saving the model every time it surpasses itself on the "val_dataset." which the model already sees during training?

  3. The results published in the article are that after early stopping of the model and blindly evaluating it on the test set directly or is it the best dice score that the model output throughout the training process?

Thank you so much,

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.