## 4 Results
### SAM vs. SAM 2
#### 4.1.1 Segmentation Performance  
A comparison across the three datasets used in our previous work is shown in Figure 6.  
The results show that SAM 2 outperforms SAM in all cases. The improvement is more significant in the Radiopaedia dataset, where the average Jaccard index increases by 1.76% and the average Dice score by 1.49%. In the Coronacases dataset, the improvement is similar, with the Jaccard index increasing by 1.39% and the Dice score by 1.08%. The Montgomery dataset shows a more modest improvement, at most half a percentage point in both metrics. However, the improvement is most notable in the results' distribution. Figure 6 shows that average values are closer to the median in each case, and the variance is lower, which means that SAM 2 is more consistent in its performance than SAM. Table 2 confirms it, showing that the standard deviation is lower for SAM 2 in all cases. In Table 3, the performance of various state-of-the-art Deep Learning (DL) models in the lung segmentation task is compared with that of SAM 2. The results of SAM are also included for reference. The performance reported by [PERSON] et al. [19] was obtained using the same CT dataset as in this study. Their DMDF-Net achieved a Jaccard index of 97.38% and a Dice score of 98.66%, whereas SAM 2 obtained a Jaccard index of 92.66% and a Dice score of 95.96%. Similarly, [PERSON] et al. [21] used the same X-ray dataset as this work. Their TransAttUnet model achieved a Jaccard index of 97.82% and a Dice score of 98.88%, whereas SAM 2 obtained a Jaccard index of 87.77% and a Dice score of 93.40%. In both cases, the custom models outperformed SAM 2. However, it is important to highlight that, despite not being specifically trained on medical images, SAM 2 produced results that were relatively close to those of domain-specific solutions. Notably, SAM 2 consistently outperformed SAM across all instances. \begin{table}
\begin{tabular}{l|l l|l l|l l} \hline \hline \multicolumn{2}{c|}{**Coronacases**} & \multicolumn{3}{c|}{**Radiopaedia**} & \multicolumn{3}{c}{**Mongomery**} \\ \hline  & **Jaccard Index** & **Dice Score** & **Jaccard Index** & **Dice Score** & **Jaccard Index** & **Dice Score** \\ \hline
**Minimum** & 12.81\% (+3.37) & 22.71\% (+7.15) & 14.32\% (+8.05) & 25.05\% (+13.26) & 65.16\% (+3.57) & 78.91\% (+2.67) \\
**Maximum** & 99.05\% (+0.21) & 99.52\% (+0.10) & 98.52\% (+0.19) & 99.26\% (+0.10) & 94.07\% (\(-1.87\)) & 96.65\% (\(-0.98\)) \\
**Average** & 93.29\% (+1.39) & 96.35\% (+1.08) & 92.04\% (+1.76) & 95.57\% (+1.49) & 87.77\% (+0.32) & 93.40\% (+0.21) \\
**Std Dev** & 7.16\% (\(-4.29\)) & 4.81\% (\(-3.75\)) & 8.82\% (\(-5.27\)) & 6.18\% (\(-4.83\)) & 5.21\% (\(-0.88\)) & 3.13\% (\(-0.47\)) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: SAM 2’s segmentation results (delta from SAM). \begin{table}
\begin{tabular}{l|l l|c|c c c c} \hline \hline \multicolumn{2}{c|}{**Jaccard Index**} & **SAM (Delta)** & **SAM 2 (Delta)** & **Dice Score** & **SAM (Delta)** & **SAM 2 (Delta)** \\ \hline
**[PERSON] et al. [19]** & 97.38\% & 91.09\% (\(-6.29\)) & 92.66\% (\(-4.72\)) & 98.66\% & 94.68\% (\(-3.98\)) & 95.96\% (\(-2.70\)) \\
**[PERSON] et al. [21]** & 97.82\% & 87.45\% (\(-10.37\)) & 87.77\% (\(-10.05\)) & 98.88\% & 93.19\% (\(-5.69\)) & 93.40\% (\(-5.48\)) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Segmentation performance of SAM 2 vs. state-of-the-art medical image segmentation models. Figure 6: Segmentation comparison ([PERSON] et al. [19], [PERSON] et al. [21]). Although the Jaccard index and Dice score are suitable performance measures, comparing the execution time of SAM 2 with state-of-the-art models provides additional insight into its overall efficiency. Table 4 presents a comparison of the execution times of SAM 2 and the model proposed by [PERSON] et al., with SAM included for reference. In the row corresponding to [PERSON] et al., the execution times for SAM 2 and SAM represent the average time required to segment both the Coronacases and Radiopaedia samples. Execution time data for the model by [PERSON] et al.