This is the implementation of Multi-scale Hierarchical Vision Transformer with Cascaded Attention Decoding for Medical Image Segmentation, MIDL 2023.
Python 3.8
Pytorch 1.11.0
torchvision 0.12.0
Please use pip install -r requirements.txt
to install the dependencies.
-
Synapse Multi-organ dataset: Sign up in the official Synapse website and download the dataset. Then split the 'RawData' folder into 'TrainSet' (18 scans) and 'TestSet' (12 scans) following the TransUNet's lists and put in the './data/synapse/Abdomen/RawData/' folder. Finally, preprocess using
python ./utils/preprocess_synapse_data.py
or download the preprocessed data and save in the './data/synapse/' folder. Note: If you use the preprocessed data from TransUNet, please make necessary changes (i.e., remove the code segment (line# 88-94) to convert groundtruth labels from 14 to 9 classes) in the utils/dataset_synapse.py. -
ACDC dataset: Download the preprocessed ACDC dataset from Google Drive of MT-UNet and move into './data/ACDC/' folder.
You should download the pretrained MaxViT models from Google Drive, and then put it in the './pretrained_pth/maxvit/' folder for initialization.
cd into MERIT
For Synapse Multi-organ training run CUDA_VISIBLE_DEVICES=0 python -W ignore train_synapse.py
For ACDC training run CUDA_VISIBLE_DEVICES=0 python -W ignore train_ACDC.py
cd into MERIT
For Synapse Multi-organ testing run CUDA_VISIBLE_DEVICES=0 python -W ignore test_synapse.py
For ACDC testing run CUDA_VISIBLE_DEVICES=0 python -W ignore test_ACDC.py
We are very grateful for these excellent works timm, CASCADE, PraNet, Polyp-PVT and TransUNet, which have provided the basis for our framework.
@InProceedings{Rahman_2023_MIDL,
author = {Rahman, Md Mostafijur and Marculescu, Radu},
title = {Multi-scale Hierarchical Vision Transformer with Cascaded Attention Decoding for Medical Image Segmentation},
booktitle = {MIDL},
month = {July},
year = {2023},
pages = {}
}