Pytorch Code for MSMAE Segmentation
- mmcv-full==1.2.7
- opencv-python==4.5.1.48
If you would like to reproduce the results of our paper, please download our randomly split dataset below.
- BUSI for Segmentation - Link
If you want to train yourself, please split the dataset according to the settings in our appendix to reproduce our experimental results. Make sure to put the files as the following structure (e.g. the number of classes is 2):
inputs
└── <dataset name>
├── images
| ├── 001.png
│ ├── 002.png
│ ├── 003.png
│ ├── ...
|
└── masks
├── 0
| ├── 001.png
| ├── 002.png
| ├── 003.png
| ├── ...
|
For binary segmentation problems, just use folder 0.
Trained Model:
| Dataset | Backbone | Method | F1-Score | IoU | Checkpoint |
|---|---|---|---|---|---|
| BUSI | SETR | MSMAE | 60.66 | 45.53 | Baidu Net (SMAE) |
- Train the model.
python train.py \
--name setr \
--batch_size 8 \
--epochs 200 \
--arch setr \
--input_w 224 \
--input_h 224 \
--dataset busi \
--img_ext .png \
--mask_ext .png \
--root ${Dataset_DIR} \
--checkpoint ${Pretrained Model Path}
- Resume from checkpoint.
python train.py \
--name setr \
--batch_size 8 \
--epochs 200 \
--arch setr \
--input_w 224 \
--input_h 224 \
--dataset busi \
--img_ext .png \
--mask_ext .png \
--root ${Dataset_DIR} \
--resume ${Previous Checkpoint Path}
- Evaluate.
python train.py \
--name setr \
--batch_size 8 \
--arch setr \
--input_w 224 \
--input_h 224 \
--dataset busi \
--img_ext .png \
--mask_ext .png \
--root ${Dataset_DIR} \
--evaluate ${Trained Checkpoint Path}