OpenGVLab/SAM-Med2D

Bad case

Cjl-MedSeg opened this issue · 8 comments

This Issue is used to collect some bad cases, which will help us iterate the model.

When i tried to crop out implants from XRay images , SAM Med2D fails miserably. SAM gives better results. ( SAM also having issues with many images. but it is far better ).

I am using bounding box and do segmentation.

SAM Output
test_cropped_Legacy_Lateral_46_0

SAM MED 2D prediction
test_cropped_Legacy_Lateral_46_0

This is one of the SAM ouput. I suppose this is the problem you tries to solve. I am much curious about MED2D in this context. but the output of SAM-MED2D is not convincing.

test_cropped_Isola_Lateral_1_0

SAM MED2D prediction
test_cropped_Isola_Lateral_1_0

Thank you for sharing the bad case. You can try predicting the results without using the adapter layer, which may slightly improve the performance. If the dataset is open source, would it be possible for you to provide us with information about the dataset? We would like to optimize our model for such data in the future.

Figure_box_1
The segmentations are generated with the bounding boxes provided by the authors and checkpoint "medsam_vit_b.pth", showing accurate results and implying that our local implementation is correct.
Figure_box_2
The segmentations are generated with the bounding boxes customized by the users and checkpoint "medsam_vit_b.pth", showing degraded results.

Those observations might demonstrate the unstable performance of the pre-trained model.

2 pts test
SAM-Med2D 1 pts
image-20230918155106990
SAM-Med2D 2 pts
image-20230918155150228
SAM web demo 2pts
image-20230918155044870
in this case SAM's 2pts is better than SAM-Med2D

5 pts test
there are the five points
image-20230918153652045
SAM-Med2D web demo output
image-20230918153705379
SAM-B in SAM-Med2D's web demo
image-20230918153724824
SAM web demo
image-20230918153516632
the SAM web demo doesn't seem so bad

5 pts test there are the five points image-20230918153652045 SAM-Med2D web demo output image-20230918153705379 SAM-B in SAM-Med2D's web demo image-20230918153724824 SAM web demo image-20230918153516632 the SAM web demo doesn't seem so bad

An interesting comparison between SAM and its fine-tuned medical variant.

image image It seems that the pretrained model sam-med2d_b.pth works bad on Spine X-ray to segment vertebral body.