Giter VIP home page Giter VIP logo

mmformer's Introduction

mmFormer: Multimodal Medical Transformer for Incomplete Multimodal Learning of Brain Tumor Segmentation

This is the implementation for the paper:

mmFormer: Multimodal Medical Transformer for Incomplete Multimodal Learning of Brain Tumor Segmentation

Accepted to MICCAI 2022 (Student Travel Award)

Abstract

Accurate brain tumor segmentation from Magnetic Resonance Imaging (MRI) is desirable to joint learning of multimodal images. However, in clinical practice, it is not always possible to acquire a complete set of MRIs, and the problem of missing modalities causes severe performance degradation in existing multimodal segmentation methods. In this work, we present the first attempt to exploit the Transformer for multimodal brain tumor segmentation that is robust to any combinatorial subset of available modalities. Concretely, we propose a novel multimodal Medical Transformer (mmFormer) for incomplete multimodal learning with three main components: the hybrid modality-specific encoders that bridge a convolutional encoder and an intra-modal Transformer for both local and global context modeling within each modality; an inter-modal Transformer to build and align the long-range correlations across modalities for modality-invariant features with global semantics corresponding to tumor region; a decoder that performs a progressive up-sampling and fusion with the modality-invariant features to generate robust segmentation. Besides, auxiliary regularizers are introduced in both encoder and decoder to further enhance the model's robustness to incomplete modalities. We conduct extensive experiments on the public BraTS 2018 dataset for brain tumor segmentation. The results demonstrate that the proposed mmFormer outperforms the state-of-the-art methods for incomplete multimodal brain tumor segmentation on almost all subsets of incomplete modalities, especially by an average 19.07% improvement of Dice on tumor segmentation with only one available modality.

image

Usage.

  • Environment Preparation

    • Download the cuda and pytorch from Google Drive.
    • Set the environment path in job.sh.
  • Data Preparation

    • Download the data from MICCAI 2018 BraTS Challenge.
    • Set the data path in preprocess.py and then run python preprocess.py.
    • Set the data path in job.sh.
  • Train

    • Train the model by sh job.sh.
  • Test

    • The trained model should be located in mmFormer/output.
    • Uncomment the evaluation command in job.sh and then inference on the test data by sh job.sh.
    • The pre-trained model and log are available.

Citation

If you find this code and paper useful for your research, please kindly cite our paper.

@inproceedings{zhang2022mmformer,
  title={mmformer: Multimodal medical transformer for incomplete multimodal learning of brain tumor segmentation},
  author={Zhang, Yao and He, Nanjun and Yang, Jiawei and Li, Yuexiang and Wei, Dong and Huang, Yawen and Zhang, Yang and He, Zhiqiang and Zheng, Yefeng},
  booktitle={Medical Image Computing and Computer Assisted Intervention--MICCAI 2022: 25th International Conference, Singapore, September 18--22, 2022, Proceedings, Part V},
  pages={107--117},
  year={2022},
  organization={Springer}
}

Reference

mmformer's People

Contributors

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

mmformer's Issues

训练数据

请问作者,模型训练时候用的好像还是完整模态的数据集?知识在推理阶段对不同模态进行了验证?

how to split dateset

sorry for the bother, i can not see any code for splitting the training dataset.
could you tell me which part of the code is for this function?
thanks.

询问如何恢复裁剪前的数据大小

作者您好,想实现您论文中的代码,发现数据在process.py文件中进行了裁剪处理,并且在网络的输出后,输出大小不一,请问如何恢复到裁剪前240x240x155的数据大小,并保存为nii.gz文件,由于无法统一数据大小,无法对应到原始flair模态上进行可视化处理,并且与ground truth有数据偏移,请问作者如何解决这个问题?

权重文件

作者您好,可以给一下您训练的权重文件吗?

我的这个train训练显示填充函数未实现,是为什么呢?

Traceback (most recent call last):
File "/media/jxust/磁盘2/mmFormer-main/mmformer/train.py", line 248, in
main()
File "/media/jxust/磁盘2/mmFormer-main/mmformer/train.py", line 166, in main
fuse_pred, sep_preds, prm_preds = model(x, mask)
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 159, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/media/jxust/磁盘2/mmFormer-main/mmformer/mmformer.py", line 361, in forward
flair_x1, flair_x2, flair_x3, flair_x4, flair_x5 = self.flair_encoder(x[:, 0:1, :, :, :])
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/media/jxust/磁盘2/mmFormer-main/mmformer/mmformer.py", line 40, in forward
x1 = self.e1_c1(x)
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 569, in forward
return F.conv3d(F.pad(input, self._reversed_padding_repeated_twice, mode=self.padding_mode),
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/functional.py", line 3581, in _pad
raise NotImplementedError
NotImplementedError

pytorch1.7.0,python3.6,can you solve this problem?

Traceback (most recent call last):
File "/media/jxust/磁盘2/mmFormer-main/mmformer/train.py", line 248, in
main()
File "/media/jxust/磁盘2/mmFormer-main/mmformer/train.py", line 166, in main
fuse_pred, sep_preds, prm_preds = model(x, mask)
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 159, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/media/jxust/磁盘2/mmFormer-main/mmformer/mmformer.py", line 361, in forward
flair_x1, flair_x2, flair_x3, flair_x4, flair_x5 = self.flair_encoder(x[:, 0:1, :, :, :])
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/media/jxust/磁盘2/mmFormer-main/mmformer/mmformer.py", line 40, in forward
x1 = self.e1_c1(x)
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 569, in forward
return F.conv3d(F.pad(input, self._reversed_padding_repeated_twice, mode=self.padding_mode),
File "/home/jxust/anaconda3/envs/nnformer/lib/python3.6/site-packages/torch/nn/functional.py", line 3581, in _pad
raise NotImplementedError
NotImplementedError

训练集和测试集划分问题

作者您好,我想复现您的mmformer代码,但是我没有看明白您的代码中 mmformer/data/dataset_nii.py里面是怎么把训练集和测试集划分开来的,可以请您给我简单解释一下吗

数据集问题

作者您好,可以向您咨询一下一些额外的问题吗,不知道您有没有尝试过将验证集的分割结果上传到在线网站,我用您提到的TransBTS中的代码上传19数据集是没问题的,但是上传20数据集出现Origin mismatch > 100100%' in axis '1'.
Images are not aligned, please ensure both images have the same origin, spacing and direction cosines before trying to extract similarity measures (use '-inf' for image information).
Calculating Stats for Subject BraTS20_Validation_001 Failed,实在找不出问题出在哪里,如果您知道的话,非常感谢您可以帮我解答一下。

背景,WT,TC,ET标签错误

作者你好,我用的代码跑BRATS2018数据集,但最后实验结果只有1,2,3标签,为啥没有0标签?哪个标签是背景?按你的代码最后Decoder分成4类,softmax结果应该是0,1,2,3才对,但实验结果没有0

测试指标求助

作者你好,向你请教, 在测试代码中得到的'whole', 'core', 'enhancing', 数值是对应论文中的‘WT’,‘TC ’,‘ET’吗? 那'enhancing_postpro'的含义是什么呢?我并不清楚如何得到论文中的‘WT’,‘TC ’,‘ET’,希望能到您的回复。

标签和预测结果可视化

作者您好,我想请教您论文中的标签和预测结果可视化是怎么做的呢,是用哪些数据和方法进行可视化的呢

训练和分割所用的模态

作者您好,问个有点菜鸟的问题,请问训练时候所用的不完整模态(例如缺少T1模态),在测试机上预测分割的时候还是用相同的不完整模态(缺少T1模态)吗?

关于复现结果

请问您开源的代码能够复现出您提供的pth文件的效果吗,因为我测试发现您提供的log和pth的结果不一致,并且我自己复现的结果也是和log中差不多,达不到pth的结果(主要是enhancing的结果差很多),请问您是在其他地方加了什么trick吗?

train

作者您好,我看您的论文里写的是交叉验证,但是train.py里没有验证,可以给个完整的训练代码吗?

训练log情况

您好,请问训练log什么样才是正常的样子呢?我训练1000轮,loss还是6,7左右,这种是有问题吗?

消融实验问题

作者您好,我想请问下您论文中的消融实验是怎么做的,正确的步骤是什么?

input for missing modality

Congratulations on your great work. However, I have a question why did you choose to apply delta for the missing modality in the middle of the network rather than at the input stage?

Error in preprocess.py

I use the preprocess.py to process the BraTS2018 training dataset as the readme.
But I got this error in the HGG data

image

code

您好,最近看到您的论文,想跑一下实验中的代码,发现代码中有许多注释,由于代码看的不是很懂,不知道您公开的代码中是否对这些注释需要另作处理,期待您的回复,谢谢。
image
image

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.