SAM-Med2D: Bridging the Gap between Natural Image Segmentation and Medical Image Segmentation
Jupyter Notebook
75
10 commits
updated Nov 19, 2023
SAM-Med2D is trained and tested on a dataset that includes 4.6M images and 19.7M masks. This dataset covers 10 medical data modalities, 4 anatomical structures + lesions, and 31 major human organs. To our knowledge, this is currently the largest and most diverse medical image segmentation dataset in terms of quantity and coverage of categories.

The pipeline of SAM-Med2D. We freeze the image encoder and incorporate learnable adapter layers in each Transformer block to acquire domain-specific knowledge in the medical field. We fine-tune the prompt encoder using point, Bbox, and mask information, while updating the parameters of the mask decoder through interactive training.

| Model | Resolution | Bbox (%) | 1 pt (%) | 3 pts (%) | 5 pts (%) | FPS | Checkpoint |
|---|---|---|---|---|---|---|---|
| SAM | $256\times256$ | 61.63 | 18.94 | 28.28 | 37.47 | 51 | Offical |
| SAM | $1024\times1024$ | 74.49 | 36.88 | 42.00 | 47.57 | 8 | Offical |
| FT-SAM | $256\times256$ | 73.56 | 60.11 | 70.95 | 75.51 | 51 | FT-SAM |
| SAM-Med2D | $256\times256$ | 79.30 | 70.01 | 76.35 | 78.68 | 35 | SAM-Med2D |
| Datasets | Bbox prompt (%) | 1 point prompt (%) | ||||
|---|---|---|---|---|---|---|
| SAM | SAM-Med2D | SAM-Med2D* | SAM | SAM-Med2D | SAM-Med2D* | |
| CrossMoDA23 | 78.98 | 70.51 | 84.62 | 18.49 | 46.08 | 73.98 |
| KiTS23 | 84.80 | 76.32 | 87.93 | 38.93 | 48.81 | 79.87 |
| FLARE23 | 86.11 | 83.51 | 90.95 | 51.05 | 62.86 | 85.10 |
| ATLAS2023 | 82.98 | 73.70 | 86.56 | 46.89 | 34.72 | 70.42 |
| SEG2023 | 75.98 | 68.02 | 84.31 | 11.75 | 48.05 | 69.85 |
| LNQ2023 | 72.31 | 63.84 | 81.33 | 3.81 | 44.81 | 59.84 |
| CAS2023 | 52.34 | 46.11 | 60.38 | 0.45 | 28.79 | 15.19 |
| TDSC-ABUS2023 | 71.66 | 64.65 | 76.65 | 12.11 | 35.99 | 61.84 |
| ToothFairy2023 | 65.86 | 57.45 | 75.29 | 1.01 | 32.12 | 47.32 |
| Weighted sum | 85.35 | 81.93 | 90.12 | 48.08 | 60.31 | 83.41 |

Prepare your own dataset and refer to the samples in SAM-Med2D/data_demo to replace them according to your specific scenario. You need to generate the "label2image_test.json" file before running "test.py"
cd ./SAM-Med2d
python test.py
This project is released under the Apache 2.0 license.
If you have any questions about SAM-Med2D, please add this WeChat ID to the WeChat group discussion:

@misc{cheng2023sammed2d,
title={SAM-Med2D},
author={Junlong Cheng and Jin Ye and Zhongying Deng and Jianpin Chen and Tianbin Li and Haoyu Wang and Yanzhou Su and
Ziyan Huang and Jilong Chen and Lei Jiangand Hui Sun and Junjun He and Shaoting Zhang and Min Zhu and Yu Qiao},
year={2023},
eprint={2308.16184},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
10 commits
Jupyter Notebook
89.3%
Python
10.7%
SAM-Med2D: Bridging the Gap between Natural Image Segmentation and Medical Image Segmentation
Jupyter Notebook
75
10 commits
updated Nov 19, 2023
SAM-Med2D is trained and tested on a dataset that includes 4.6M images and 19.7M masks. This dataset covers 10 medical data modalities, 4 anatomical structures + lesions, and 31 major human organs. To our knowledge, this is currently the largest and most diverse medical image segmentation dataset in terms of quantity and coverage of categories.

The pipeline of SAM-Med2D. We freeze the image encoder and incorporate learnable adapter layers in each Transformer block to acquire domain-specific knowledge in the medical field. We fine-tune the prompt encoder using point, Bbox, and mask information, while updating the parameters of the mask decoder through interactive training.

| Model | Resolution | Bbox (%) | 1 pt (%) | 3 pts (%) | 5 pts (%) | FPS | Checkpoint |
|---|---|---|---|---|---|---|---|
| SAM | $256\times256$ | 61.63 | 18.94 | 28.28 | 37.47 | 51 | Offical |
| SAM | $1024\times1024$ | 74.49 | 36.88 | 42.00 | 47.57 | 8 | Offical |
| FT-SAM | $256\times256$ | 73.56 | 60.11 | 70.95 | 75.51 | 51 | FT-SAM |
| SAM-Med2D | $256\times256$ | 79.30 | 70.01 | 76.35 | 78.68 | 35 | SAM-Med2D |
| Datasets | Bbox prompt (%) | 1 point prompt (%) | ||||
|---|---|---|---|---|---|---|
| SAM | SAM-Med2D | SAM-Med2D* | SAM | SAM-Med2D | SAM-Med2D* | |
| CrossMoDA23 | 78.98 | 70.51 | 84.62 | 18.49 | 46.08 | 73.98 |
| KiTS23 | 84.80 | 76.32 | 87.93 | 38.93 | 48.81 | 79.87 |
| FLARE23 | 86.11 | 83.51 | 90.95 | 51.05 | 62.86 | 85.10 |
| ATLAS2023 | 82.98 | 73.70 | 86.56 | 46.89 | 34.72 | 70.42 |
| SEG2023 | 75.98 | 68.02 | 84.31 | 11.75 | 48.05 | 69.85 |
| LNQ2023 | 72.31 | 63.84 | 81.33 | 3.81 | 44.81 | 59.84 |
| CAS2023 | 52.34 | 46.11 | 60.38 | 0.45 | 28.79 | 15.19 |
| TDSC-ABUS2023 | 71.66 | 64.65 | 76.65 | 12.11 | 35.99 | 61.84 |
| ToothFairy2023 | 65.86 | 57.45 | 75.29 | 1.01 | 32.12 | 47.32 |
| Weighted sum | 85.35 | 81.93 | 90.12 | 48.08 | 60.31 | 83.41 |

Prepare your own dataset and refer to the samples in SAM-Med2D/data_demo to replace them according to your specific scenario. You need to generate the "label2image_test.json" file before running "test.py"
cd ./SAM-Med2d
python test.py
This project is released under the Apache 2.0 license.
If you have any questions about SAM-Med2D, please add this WeChat ID to the WeChat group discussion:

@misc{cheng2023sammed2d,
title={SAM-Med2D},
author={Junlong Cheng and Jin Ye and Zhongying Deng and Jianpin Chen and Tianbin Li and Haoyu Wang and Yanzhou Su and
Ziyan Huang and Jilong Chen and Lei Jiangand Hui Sun and Junjun He and Shaoting Zhang and Min Zhu and Yu Qiao},
year={2023},
eprint={2308.16184},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
10 commits
Jupyter Notebook
89.3%
Python
10.7%