Improving Medical Image Segmentation Using Test-Time Augmentation with MedSAM - Wasfieh Nazzal; Karl Thurnhofer-Hemsi; Ezequiel López-Rubio (Mathematics)
Medical image segmentation is crucial for diagnostics and treatment planning, yet traditional methods often struggle with the variability of real-world clinical data. Deep learning models, like the Segment Anything Model (SAM), have been proposed as a powerful tool that helps to delimit regions using a prompt. This work proposes a methodology to improve the quality of the segmentation by integrating test-time augmentation (TTA) with the SAM for medical applications (MedSAM) by using random circular shifts, addressing challenges such as misalignments and imaging variability. The method generates several input variations during inference that are combined after, improving robustness and segmentation accuracy without requiring retraining. Evaluated across diverse computed tomography (CT) datasets, including Medical Segmentation Decathlon (MSD), KiTS, and COVID-19-20, the proposed method demonstrated consistent improvements in Dice Similarity Coefficient (DSC) and Normalized Surface Dice (NSD) metrics. The highest performances were 93.6% DSC and 97% NSD. Notably, it achieved superior boundary precision and surface alignment in complex regions like the pancreas and colon, outperforming baseline models, including MedSAM and DeepLabv3+. The approach is computationally feasible, leveraging a balance of augmentation intensity and segmentation accuracy.