Home

Awesome

Medical 2D Image Segmentation Benchmarks

ushape

For easy evaluation and fair comparison on 2D medical image segmentation method, we aim to collect and build a medical image segmentation U-shape architecture benchmark to implement the medical 2d image segmentation tasks.

News 🥰

This repositories has collected and re-implemented medical image segmentation networks based on U-shape architecture are followed:

NetworkOriginal codeReference
U-NetCaffeMICCAI'15
Attention U-NetPytorchArxiv'18
U-Net++PytorchMICCAI'18
U-Net 3+PytorchICASSP'20
TransUnetPytorchArxiv'21
MedTPytorchMICCAI'21
UNeXtPytorchMICCAI'22
SwinUnetPytorchECCV'22
CMU-NetPytorchISBI'23
CMUNeXtPytorchISBI'24

Datasets

Please put the BUSI dataset or your own dataset as the following architecture.

├── Medical-Image-Segmentation-Benchmarks
    ├── data
        ├── busi
            ├── images
            |   ├── benign (10).png
            │   ├── malignant (17).png
            │   ├── ...
            |
            └── masks
                ├── 0
                |   ├── benign (10).png
                |   ├── malignant (17).png
                |   ├── ...
        ├── your 2D dataset
            ├── images
            |   ├── 0a7e06.png
            │   ├── 0aab0a.png
            │   ├── 0b1761.png
            │   ├── ...
            |
            └── masks
                ├── 0
                |   ├── 0a7e06.png
                |   ├── 0aab0a.png
                |   ├── 0b1761.png
                |   ├── ...
    ├── src
    ├── main.py
    ├── split.py

Environments

Training

You can first split your dataset:

python split.py --dataset_root ./data --dataset_name busi

Then, training and validating your dataset:

python main.py --model [CMUNeXt/CMUNet/TransUnet/...] --base_dir ./data/busi --train_file_dir busi_train.txt --val_file_dir busi_val.txt --base_lr 0.01 --epoch 300 --batch_size 8

Inference

python infer.py --model [CMUNeXt/CMUNet/TransUnet/...] --model_path [.pth] --base_dir ./data/busi --val_file_dir busi_val.txt --img_size 256 --num_classes 1

Results on BUSI

We train the U-shape based networks with BUSI dataset. The BUSI collected 780 breast ultrasound images, including normal, benign and malignant cases of breast cancer with their corresponding segmentation results. We only used benign and malignant images (647 images). And we randomly split thrice in /data, 70% for training and 30% for validation. In addition, we resize all the images 256×256 and perform random rotation and flip for data augmentation.

MethodParams (M)FPSGFLOPsIoUF1-value
U-Net34.52139.3265.5268.61±2.8676.97±3.10
Attention U-Net34.87129.9266.6368.55±3.2276.88±3.50
U-Net++26.90125.5037.6269.49±2.9478.06±3.25
U-Net3+26.9750.60199.7468.38±3.3576.88±3.68
TransUnet105.32112.9538.5271.39±2.3779.85±2.59
MedT<u>1.37</u>22.972.4063.36±1.5673.37±1.63
SwinUnet27.14392.215.9154.11±2.2965.46±1.91
UNeXt1.47<u>650.48</u><u>0.58</u>65.04±2.7174.16±2.84
CMU-Net49.9393.1991.2571.42±2.6579.49±2.92
CMUNeXt3.14471.437.41<u>71.56±2.43</u><u>79.86±2.58</u>

Acknowledgements:

This code-base uses helper functions from CMU-Net and Image_Segmentation.

Other QS:

If you have any questions or suggestions about this project, please contact me through email: 543759045@qq.com