Implementation for paper MCPA: Multi-scale Cross Perceptron Attention Network for 2D Medical Image Segmentation
- argparse>=1.4.0
- numpy>=1.19.2
- tqdm>=4.62.1
- h5py>=3.2.1
- imgaug>=0.4.0
- scipy>=1.9.3
- timm>=0.4.12
- einops>=0.4.1
- opencv-python>=4.6.0.66
- torchvision>=0.7.0
- simpleitk>=2.0.2
- medpy>=0.4.0
- yaml>=0.2.5
- pyyaml>=5.4.1
- yacs>=0.1.8
- tensorboardx>=2.2
Get pre-trained model in this link: Put pretrained SSA-samll into folder "MCPA_Synapse/pretrained/" and "MCPA_ACDC/pretrained/"
- For the Synapse datasets we used are provided by TransUnet's authors.Get processed data in this link. Please go to "MCPA_Synapse/datasets/README.md" for details, or please send an Email to jienengchen01 AT gmail.com to request the preprocessed data. If you would like to use the preprocessed data, please use it for research purposes and do not redistribute it (following the TransUnet's License). Please prepare data in the data directory:
├── MCPA_Synapse
├──Synapse
│ ├── test_vol_h5
│ │ ├── case0001.npy.h5
│ │ └── *.npy.h5
│ └── train_npz
│ ├── case0005_slice000.npz
│ └── *.npz
└──lists
├── all.lst
├── test_vol.txt
└── train.txt
- For the ACDC datasets, please sign up in the official ACDC website and download the dataset. Or Get processed data in this link to use the preprocessed data for we proposed. Please prepare data in the data directory:
├── MCPA_ACDC
├──ACDC
│ ├── test_vol_h5
│ │ ├── patient002.npy.h5
│ │ └── *.npy.h5
│ └── train_npz
│ ├── patient001_slice000.npz
│ └── *.npz
└──lists
├── test_vol.txt
└── train.txt
- For the datasets of vessel segmentation, please sign up in the official DRIVE website and download the dataset, official CHASE_DB1 website and download the dataset, official HRF website and download the dataset, and [official ROSE website and download the dataset](https://www5.cs.fau.de/research/data/fundus-images/. Please prepare data in the data directory:
├── MCPA_vessel
├── Dataset
│ ├── DRIVE
│ │ ├── training
│ │ │ ├── images
│ │ │ │ └── 21_training.tif
│ │ │ └──1st_manual
│ │ │ └── 21_manual1.gif
│ │ └── test
│ │ ├── images
│ │ │ └── 01_test.tif
│ │ └── 1st_manual
│ │ └── 01_manual1.gif
│ ├── CHASEDB1
│ │ ├── training
│ │ │ ├── images
│ │ │ │ └── Image_01L.jpg
│ │ │ └── 1st_manual
│ │ │ └── Image_01L_1stHO.png
│ │ └── test
│ │ ├── images
│ │ │ └── Image_11L.jpg
│ │ └── 1st_manual
│ │ └── Image_11L_1stHO.png
│ └── HRF
│ └── all
│ ├── images
│ │ └── 01_test.tif
│ └── 1st_manual
│ └── 01_manual1.gif
└── prepare_dataset
└── data_path_list
├── DRIVE
│ ├── train.txt
│ └── test.txt
├── CHASEDB1
│ ├── train.txt
│ └── test.txt
├── HRF
│ ├── train.txt
│ └── test.txt
└── ROSE
├── train.txt
└── test.txt
python MCPA_Synapse/train.py --cfg ./configs/Synapse.yaml --root_path ./Synapse/
python MCPA_ACDC/train.py --cfg ./config/ACDC.yaml --root_path ./ACDC/
python MCPA_vessel/config.py --dataset DRIVE --train_data_path_list ./prepare_dataset/data_path_list/DRIVE/train.txt --test_data_path_list ./prepare_dataset/data_path_list/DRIVE/test.txt
python MCPA_vessel/train.py
python MCPA_vessel/config.py --dataset CHASEDB1 --train_data_path_list ./prepare_dataset/data_path_list/CHASEDB1/train.txt --test_data_path_list ./prepare_dataset/data_path_list/CHASEDB1/test.txt
python MCPA_vessel/train.py
python MCPA_vessel/config.py --dataset HRF --train_data_path_list ./prepare_dataset/data_path_list/HRF/train.txt --test_data_path_list ./prepare_dataset/data_path_list/HRF/test.txt
python MCPA_vessel/train.py
python MCPA_Synapse/test.py --model_path .../epoch_399.pth
python MCPA_ACDC/test.py --model_path .../epoch_399.pth
python MCPA_vessel/config.py --dataset DRIVE --train_data_path_list ./prepare_dataset/data_path_list/DRIVE/train.txt --test_data_path_list ./prepare_dataset/data_path_list/DRIVE/test.txt --model_path ./best_model.pth
python MCPA_vessel/test.py
python MCPA_vessel/config.py --dataset CHASEDB1 --train_data_path_list ./prepare_dataset/data_path_list/CHASEDB1/train.txt --test_data_path_list ./prepare_dataset/data_path_list/CHASEDB1/test.txt --model_path ./best_model.pth
python MCPA_vessel/test.py
python MCPA_vessel/config.py --dataset HRF --train_data_path_list ./prepare_dataset/data_path_list/HRF/train.txt --test_data_path_list ./prepare_dataset/data_path_list/HRF/test.txt --model_path ./best_model.pth
python MCPA_vessel/test.py