Exploring the Limits of Foundation Models in Medical Image Segmentation: A Case Study With SAM and Genetic Algorithms

Authors

DOI:

https://doi.org/10.9781/ijimai.2026.2223

Keywords:

Deep Learning, Foundation Models, Genetic Algorithms, Image Segmentation, Medical Imaging, ZeroShot Learning

Abstract

This paper investigates the limits of foundation models in medical image segmentation, mainly focusing on SAM by Meta. While previous research demonstrated SAM’s potential for cost-efficient segmentation, this study explores its performance enhancement through integration with prompt enhancement optimization and genetic algorithms, aiming to minimize user input further. As a proof of concept, we apply this novel approach to lung segmentation tasks using public axial lung CT scans, frontal chest X-ray datasets, and spleen MRIs. Our findings reveal that the genetic algorithm optimization significantly improves SAM’s segmentation accuracy, bringing it closer to the state-of-the-art performance achieved by specifically trained models. In particular, when compared with our previous approach, this technique reaches a 94.85 % Jaccard Index (+3.77 delta) and a 97.17 % Dice Score (+2.50 delta) for lung CT scans, a 93.39 % Jaccard Index (+5.95 delta) and a 96.57 %Dice Score (+3.38 delta) for chest X-rays, and a 91.00 % Jaccard Index (+6.51 delta) and a 95.07 % Dice Score (+4.12 delta) for spleen MRIs. Notably, this improvement is achieved without retraining or modifying SAM’s architecture. However, our analysis also identifies an inherent limitation in this optimization approach, revealing a performance ceiling that cannot be surpassed despite further genetic algorithm iterations. The implications of these findings emphasize the potential of combining foundation models with non-intrusive optimization techniques for cost-effective and accessible medical image segmentation. While dataset-related limitations may affect generalizability, validating the approach across broader clinical scenarios remains essential. Future work should explore applications to additional organs, diverse datasets, and the integration of expert-in-the-loop strategies to enhance clinical utility.

Downloads

Download data is not yet available.

Author Biographies

Juan D. Gutiérrez, Universidade de Santiago de Compostela

Assistant professor at the Universidad de Santiago de Compostela (USC). With more than twenty years of experience in the computer world, his research focuses on the application of AI to various fields of knowledge, with a particular interest in exploring low-cost optimizations for adapting foundation models to specialized tasks. His current work aims to systematize the identification of the operational limits of these models. His training includes programming in different languages, system administration, application design, and databases and the Internet. He has written more than twenty computer science books and translated another ten from English into Spanish. What began as a fun experience in the mid-nineties has ended up being a real passion for him. Juan Diego enjoys computing but, above all, learning new things.

Nuria Lozano-García, Universidad de Extremadura

She received the BSc + MSc degree in Biology from the University of Valencia in 2003, the Technical Engineering of Computer Systems university degree from the National Distance Education University (UNED) in 2012, and the MSc degree in Bioinformatics and Computational Biology from the Complutense University of Madrid in 2012, all of them in Spain. She is currently a member of the Department of Computer and Communications Technologies, and previously of the Department of Computers and Telematics Systems Engineering, University of Extremadura, in a Scientific and Research Staff position as a bioinformatician, and has held similar positions in Universities and Research Centers since 2012. She has co-authored or authored 11 Journal Citation Report (JCR) papers. Her research interests cover a wide range in the field of bioinformatics, as metagenomics, 16S rDNA, bacterial genomes and SNPs detection, Chip-Seq, and more recently evolutionary computation and multiobjective optimization applied to bioinformatics and other real-world problems.

Emilio Delgado, Universidad de Extremadura

Researcher at the Universidad de Extremadura, whose primary focus is Machine Learning, particularly the study of DL. Currently, his research is at the intersection of artificial intelligence and healthcare, where he is applying DL techniques to solve medical problems. His work aims to use these algorithms to process and analyze large amounts of clinical and medical imaging data to improve people’s standard of living. He is constantly looking for ways to improve and optimize DL algorithms for application in medicine, striving to ensure that they are accurate, efficient, and useful for healthcare professionals. He is exploring how machine learning can be used to improve medical diagnoses and treatments and investigating how these systems can be designed and trained to respect patient privacy and data security

Álvaro Rubio-Largo, Universidad de Extremadura

He received his Ph.D. in Computer Engineering from the University of Extremadura, Spain, in 2013. He is currently an Associate Professor in the Department of Computers and Telematics Systems Engineering at the University of Extremadura. With a strong academic and research background, Dr. Rubio-Largo has authored or coauthored over 70 publications, including more than 35 articles in journals indexed in the Journal Citation Reports (JCR). His research interests span big data, machine learning, and evolutionary computation, with a particular focus on multiobjective optimization for real-world applications. Dr. Rubio-Largo is active in the academic community, having co-organized several international workshops and served on the technical program committees of numerous international conferences. Additionally, he has coedited several special issues for JCR-indexed journals and serves as a reviewer for various high-impact international journals.

Roberto Rodriguez-Echeverria, Universidad de Extremadura

Professor of software architecture at the Computer Languages and Systems Department of the Universidad de Extremadura (UEx), Spain. His research interests include software engineering, model-driven engineering, data-driven software development, machine learning, web engineering, and legacy software modernization. He is currently head of the Applied Informatic Technology Institute. Moreover, he truly believes in local socioeconomic value generation through entrepreneurship, so he has recently created a new UEx spin-off company, named MetrikaMedia, which defines itself as a SaaS solution for multimedia content measurement.

References

[1] A. Kirillov, K. He, R. Girshick, C. Rother, P. Dollar, “Panoptic Segmentation,” in 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA, June 2019, pp. 9396–9405, IEEE.

[2] G. Litjens, T. Kooi, B. E. Bejnordi, A. A. A. Setio, F. Ciompi, M. Ghafoorian, J. A. Van Der Laak, B. Van Ginneken, C. I. Sánchez, “A survey on deep learning in medical image analysis,” Medical Image Analysis, vol. 42, pp. 60–88, July 2017, doi: https://doi.org/10.1016/j.media.2017.07.005.

[3] S. Minaee, Y. Boykov, F. Porikli, A. Plaza, N. Kehtarnavaz, D. Terzopoulos, “Image Segmentation Using Deep Learning: A Survey,” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 44, pp. 3523–3542, Feb. 2021, doi: https://doi.org/10.1109/TPAMI.2021.3059968.

[4] A. Kirillov, E. Mintun, N. Ravi, H. Mao, C. Rolland, L. Gustafson, T. Xiao, S. Whitehead, A. C. Berg, W.-Y. Lo, P. Dollár, R. Girshick, “Segment Anything.” Web Page, Apr. 2023. doi: https://doi.org/10.48550/arXiv.2304.02643.

[5] Y. Huang, X. Yang, L. Liu, H. Zhou, A. Chang, X. Zhou, R. Chen, J. Yu, J. Chen, C. Chen, S. Liu, H. Chi, X. Hu, K. Yue, L. Li, V. Grau, D.-P. Fan, F. Dong, D. Ni, “Segment anything model for medical images?,” Medical Image Analysis, vol. 92, p. 103061, Dec. 2023, doi: https://doi.org/10.1016/j. media.2023.103061.

[6] J. D. Gutiérrez, R. Rodriguez-Echeverria, E. Delgado, M. Á. S. Rodrigo, F. Sanchez-Figueroa, “No More Training: SAM’s Zero-Shot Transfer Capabilities for Cost-Efficient Medical Image Segmentation,” IEEE Access, vol. 12, pp. 24205–24216, Jan. 2024, doi: https://doi.org/10.1109/ACCESS.2024.3353142.

[7] S. N. Kumar, A. L. Fred, P. S. Varghese, “An Overview of Segmentation Algorithms for the Analysis of Anomalies on Medical Images,” Journal of Intelligent Systems, vol. 29, pp. 612–625, June 2018, doi: https://doi.org/10.1515/jisys-2017-0629.

[8] J. H. Holland, Adaptation in Natural and Artificial Systems: An Introductory Analysis with Applications to Biology, Control, and Artificial Intelligence. MIT Press, Apr. 1992.

[9] K. K. Verma, B. M. Singh, “Deep Multi-Model Fusion for Human Activity Recognition Using Evolutionary Algorithms,” International Journal of Interactive Multimedia and Artificial Intelligence, vol. 7, p. 44, Dec. 2021, doi: https://doi.org/10.9781/ijimai.2021.08.008.

[10] T. Hui-Ye Chiu, C. Wu, C.-H. Chen, “A Generalized Wine Quality Prediction Framework by Evolutionary Algorithms,” International Journal of Interactive Multimedia and Artificial Intelligence, vol. 6, p. 60, Sept. 2021, doi: https://doi.org/10.9781/ijimai.2021.04.006.

[11] L. Ali, F. Alnajjar, M. Swavaf, O. Elharrouss, A. Abd-alrazaq, R. Damseh, “Evaluating segment anything model (SAM) on MRI scans of brain tumors,” Scientific Reports, vol. 14, p. 21659, Sept. 2024, doi: https://doi.org/10.1038/s41598-024-72342-x.

[12] T. Cai, H. Yan, K. Ding, Y. Zhang, Y. Zhou, “WSPolyp-SAM: Weakly Supervised and Self-Guided Fine-Tuning of SAM for Colonoscopy Polyp Segmentation,” Applied Sciences, vol. 14, p. 5007, June 2024, doi: https://doi.org/10.3390/app14125007.

[13] C. Chen, J. Miao, D. Wu, A. Zhong, Z. Yan, S. Kim, J. Hu, Z. Liu, L. Sun, X. Li, T. Liu, P.- A. Heng, Q. Li, “MA-SAM: Modality-agnostic SAM adaptation for 3D medical image segmentation,” Medical Image Analysis, vol. 98, p. 103310, Aug. 2024, doi: https://doi.org/10.1016/j.media.2024.103310.

[14] G. Dong, Z. Wang, Y. Chen, Y. Sun, H. Song, L. Liu, H. Cui, “An efficient segment anything model for the segmentation of medical images,” Scientific Reports, vol. 14, p. 19425, Aug. 2024, doi: https://doi.org/10.1038/s41598-024-70288-8.

[15] S. Gong, Y. Zhong, W. Ma, J. Li, Z. Wang, J. Zhang, P.-A. Heng, Q. Dou, “3DSAM-adapter: Holistic adaptation of SAM from 2D to 3D for promptable tumor segmentation,” Medical Image Analysis, vol. 98, p. 103324, Aug. 2024, doi: https://doi.org/10.1016/j.media.2024.103324.

[16] Y. Gu, Q. Wu, H. Tang, X. Mai, H. Shu, B. Li, Y. Chen, “LeSAM: Adapt Segment Anything Model for medical lesion segmentation,” IEEE Journal of Biomedical and Health Informatics, pp. 1–11, May 2024, doi: https://doi.org/10.1109/JBHI.2024.3406871.

[17] X. Liu, Y. Zhao, S. Wang, J. Wei, “G-SAM: GMM-based segment anything model for medical image classification and segmentation,” Cluster Computing, July 2024, doi: https://doi.org/10.1007/s10586-024-04679-x.

[18] Z. Ren, Y. Zhang, S. Wang, “Large Foundation Model for Cancer Segmentation,” Technology in Cancer Research & Treatment, vol. 23, p. 15330338241266205, July 2024, doi: https://doi.org/10.1177/15330338241266205.

[19] P. Shi, J. Qiu, S. M. D. Abaxi, H. Wei, F. P.- W. Lo, W. Yuan, “Generalist Vision Foundation Models for Medical Imaging: A Case Study of Segment Anything Model on Zero-Shot Medical Segmentation,” Diagnostics, vol. 13, p. 1947, June 2023, doi: https://doi.org/10.3390/diagnostics13111947.

[20] N. Ndipenoch, A. Miron, Y. Li, “Performance Evaluation of Retinal OCT Fluid Segmentation, Detection, and Generalization Over Variations of Data Sources,” IEEE Access, vol. 12, pp. 31719–31735, Feb. 2024, doi: https://doi.org/10.1109/ACCESS.2024.3369913.

[21] D. He, Z. Ma, C. Li, Y. Li, “Dual-Branch Fully Convolutional Segment Anything Model for Lesion Segmentation in Endoscopic Images,” IEEE Access, vol. 12, pp. 125654–125667, Aug. 2024, doi: https://doi.org/10.1109/ACCESS.2024.3449428.

[22] Z. Morton Colbert, D. Arrington, M. Foote, J. Gårding, D. Fay, M. Huo, M. Pinkham, P. Ramachandran, “Repurposing traditional U-Net predictions for sparse SAM prompting in medical image segmentation,” Biomedical Physics & Engineering Express, vol. 10, p. 025004, Jan. 2024, doi: https:// doi.org/10.1088/2057-1976/ad17a7.

[23] C. Wang, H. Chen, X. Zhou, M. Wang, Q. Zhang, “SAM-IE: SAM-based image enhancement for facilitating medical image diagnosis with segmentation foundation model,” Expert Systems with Applications, vol. 249, p. 123795, Sept. 2024, doi: https://doi.org/10.1016/j.eswa.2024.123795.

[24] M. A. JiMing, D. HongYu, W. YuFan, W. LiNa, “Medical image segmentation based on simulated annealing and opposition-based learning island algorithm,” PLOS ONE, vol. 19, p. e0307278, July 2024, doi: https://doi.org/10.1371/journal.pone.0307278.

[25] K. M. Hosny, A. M. Khalid, H. M. Hamza, Mirjalili, “Multilevel segmentation of 2D and volumetric medical images using hybrid Coronavirus Optimization Algorithm,” Computers in Biology and Medicine, vol. 150, p. 106003, Nov. 2022, doi: https://doi.org/10.1016/j.compbiomed.2022.106003.

[26] D. R. Reis, B. C. Santos, L. Bleicher, L. E. Zárate, C. N. Nobre, “Prediction of enzymatic function with high efficiency and a reduced number of features using genetic algorithm,” Computers in Biology and Medicine, vol. 158, p. 106799, Mar. 2023, doi: https://doi.org/10.1016/j.compbiomed.2023.106799.

[27] M. Chen, Z. Sun, F. Su, Y. Chen, D. Bu, Y. Lyu, “An Auxiliary Diagnostic System for Parkinson’s Disease Based on Wearable Sensors and Genetic Algorithm Optimized Random Forest,” IEEE Transactions on Neural Systems and Rehabilitation Engineering, vol. 30, pp. 2254–2263, Aug. 2022, doi: https://doi.org/10.1109/TNSRE.2022.3197807.

[28] M. Ghosh, S. Adhikary, K. K. Ghosh, A. Sardar, Begum, R. Sarkar, “Genetic algorithm based cancerous gene identification from microarray data using ensemble of filter methods,” Medical & Biological Engineering & Computing, vol. 57, pp. 159–176, Aug. 2019, doi: https://doi.org/10.1007/s11517-018-1874-4.

[29] M. Sale, E. A. Sherer, “A genetic algorithm based global search strategy for population pharmacokinetic/pharmacodynamic model selection,” British Journal of Clinical Pharmacology, vol. 79, pp. 28–39, June 2013, doi: https://doi.org/10.1111/bcp.12179.

[30] M. Jun, G. Cheng, W. Yixin, A. Xingle, G. Jiantao, Y. Ziqi, Z. Minqing, L. Xin, D. Xueyuan, C. Shucheng, W. Hao, M. Sen, Y. Xiaoyu, N. Ziwei, L. Chen, T. Lu, Z. Yuntao, Z. Qiongjie, D. Guoqiang, H. Jian, “COVID-19 CT lung and infection segmentation dataset.” Web Page, Apr. 2020. doi: https://doi.org/10.5281/zenodo.3757476.

[31] M. Owais, N. R. Baek, K. R. Park, “DMDF-Net: Dual multiscale dilated fusion network for accurate segmentation of lesions related to COVID-19 in lung radiographic scans,” Expert Systems with Applications, vol. 202, p. 117360, May 2022, doi: https://doi.org/10.1016/j.eswa.2022.117360.

[32] S. Jaeger, S. Candemir, S. Antani, Y.-X. J. Wáng, P.-X. Lu, G. Thoma, “Two public chest X-ray datasets for computer-aided screening of pulmonary diseases,” Quantitative Imaging in Medicine and Surgery, vol. 4, p. 475, Dec. 2014, doi: https://doi.org/10.3978/j.issn.2223-4292.2014.11.20.

[33] B. Chen, Y. Liu, Z. Zhang, G. Lu, A. W. K. Kong, “TransAttUnet: MultiLevel Attention-Guided U-Net With Transformer for Medical Image Segmentation,” IEEE Transactions on Emerging Topics in Computational Intelligence, vol. 8, pp. 55–68, Sept. 2023, doi: https://doi.org/10.1109/TETCI.2023.3309626.

[34] Y. Ji, H. Bai, C. GE, J. Yang, Y. Zhu, R. Zhang, Z. Li, L. Zhanng, W. Ma, X. Wan, P. Luo, “AMOS: A large-scale abdominal multi-organ benchmark for versatile medical image segmentation,” Nov. 2022. doi: https://doi.org/10.5281/zenodo.7262581.

[35] D. Müller, I. Soto-Rey, F. Kramer, “Towards a guideline for evaluation metrics in medical image segmentation,” BMC Research Notes, vol. 15, p. 210, June 2022, doi: https://doi.org/10.1186/s13104-022-06096-y.

[36] F. Kofler, I. Ezhov, F. Isensee, F. Balsiger, C. Berger, M. Koerner, B. Demiray, J. Rackerseder, J. Paetzold, H. Li, S. Shit, R. McKinley, M. Piraud, S. Bakas, C. Zimmer, N. Navab, J. Kirschke, B. Wiestler, B. Menze, “Are we using appropriate segmentation metrics? Identifying correlates of human expert perception for CNN training beyond rolling the DICE coefficient,” Machine Learning for Biomedical Imaging, vol. 2, pp. 27–71, May 2023, doi: https://doi.org/10.59275/j.melba.2023-dg1f.

[37] J. Ma, Y. He, F. Li, L. Han, C. You, B. Wang, “Segment anything in medical images,” Nature Communications, vol. 15, p. 654, Jan. 2024, doi: https://doi.org/10.1038/s41467-024-44824-z.

[38] J. Ma, Y. Wang, X. An, C. Ge, Z. Yu, J. Chen, Q. Zhu, G. Dong, J. He, Z. He, T. Cao, Y. Zhu, Z. Nie, X. Yang, “Toward data-efficient learning: A benchmark for COVID-19 CT lung and infection segmentation,” Medical Physics, vol. 48, pp. 1197–1210, Dec. 2020, doi: https://doi.org/10.1002/mp.14676.

[39] S. P. Morozov, A. E. Andreychenko, I. A. Blokhin, P. B. Gelezhe, A. P. Gonchar, A. E. Nikolaev, N. A. Pavlov, V. Y. Chernina, V. A. Gombolevskiy, “MosMedData: Data set of 1110 chest CT scans performed during the COVID-19 epidemic,” Digital Diagnostics, vol. 1, pp. 49–59, Dec. 2020, doi: https://doi.org/10.17816/DD46826.

[40] N. Codella, V. Rotemberg, P. Tschandl, M. E. Celebi, S. Dusza, D. Gutman, B. Helba, A. Kalloo, K. Liopyris, M. Marchetti, H. Kittler, A. Halpern, “Skin Lesion Analysis Toward Melanoma Detection 2018: A Challenge Hosted by the International Skin Imaging Collaboration (ISIC),” Mar. 2019. doi: https://doi.org/10.48550/arXiv.1902.03368.

[41] J. Shiraishi, S. Katsuragawa, J. Ikezoe, T. Matsumoto, T. Kobayashi, K.- i. Komatsu, M. Matsui, H. Fujita, Y. Kodera, K. Doi, “Development of a Digital Image Database for Chest Radiographs With and Without a Lung Nodule: Receiver Operating Characteristic Analysis of Radiologists’ Detection of Pulmonary Nodules,” American Journal of Roentgenology, vol. 174, pp. 71–74, Nov. 2012, doi: https://doi.org/10.2214/ajr.174.1.1740071.

[42] Y.-B. Tang, Y.-X. Tang, J. Xiao, R. M. Summers, “XLSor: A Robust and Accurate Lung Segmentor on Chest X-Rays Using Criss-Cross Attention and Customized Radiorealistic Abnormalities Generation,” in Proceedings of The 2nd International Conference on Medical Imaging with Deep Learning, May 2019, pp. 457–467, PMLR.

[43] X. He, S. Wang, X. Chu, S. Shi, J. Tang, X. Liu, C. Yan, J. Zhang, G. Ding, “Automated Model Design and Benchmarking of Deep Learning Models for COVID-19 Detection with Chest CT Scans,” Proceedings of the AAAI Conference on Artificial Intelligence, vol. 35, pp. 4821–4829, May 2021, doi: https://doi.org/10.1609/aaai.v35i6.16614.

[44] J. C. Caicedo, A. Goodman, K. W. Karhohs, B. A. Cimini, J. Ackerman, M. Haghighi, C. Heng, T. Becker, M. Doan, C. McQuin, M. Rohban, S. Singh, A. E. Carpenter, “Nucleus segmentation across imaging experiments: The 2018 Data Science Bowl,” Nature Methods, vol. 16, pp. 1247–1253, Oct. 2019, doi: https://doi.org/10.1038/s41592-019-0612-7.

[45] P. Malík, K. Knapová, Š. Krištofík, “Instance Segmentation Model Created from Three Semantic Segmentations of Mask, Boundary and Centroid Pixels Verified on GlaS Dataset,” in Proceedings of the 2020 Federated Conference on Computer Science and Information Systems, Sept. 2020, pp. 569–576.

[46] Q. Hu, L. F. De F. Souza, G. B. Holanda, S. S. Alves, F. H. Dos S. Silva, T. Han, P. P. Rebouças Filho, “An effective approach for CT lung segmentation using mask region-based convolutional neural networks,” Artificial Intelligence in Medicine, vol. 103, p. 101792, Jan. 2020, doi: https://doi.org/10.1016/j.artmed.2020.101792.

[47] A. Khanna, N. D. Londhe, S. Gupta, A. Semwal, “A deep Residual U-Net convolutional neural network for automated lung segmentation in computed tomography images,” Biocybernetics and Biomedical Engineering, vol. 40, pp. 1314–1327, July 2020, doi: https://doi.org/10.1016/j.bbe.2020.07.007.

[48] R. D. Rudyanto, S. Kerkstra, E. M. van Rikxoort, C. Fetita, P.-Y. Brillet, C. Lefevre, W. Xue, X. Zhu, J. Liang, İ. Öksüz, D. Ünay, K. Kadipaşaogˇlu, R. S. J. Estépar, J. C. Ross, G. R. Washko, J.- C. Prieto, M. H. Hoyos, M. Orkisz, H. Meine, M. Hüllebrand, C. Stöcker, F. L. Mir, V. Naranjo, E. Villanueva, M. Staring, C. Xiao, B. C. Stoel, A. Fabijanska, E. Smistad, A. C. Elster, F. Lindseth, A. H. Foruzan, R. Kiros, K. Popuri, D. Cobzas, D. Jimenez-Carretero, A. Santos, M. J. Ledesma-Carbayo, M. Helmberger, M. Urschler, M. Pienn, D. G. H. Bosboom, A. Campo, M. Prokop, P. A. de Jong, C. Ortiz-de-Solorzano, A. Muñoz-Barrutia, B. van Ginneken, “Comparing algorithms for automated vessel segmentation in computed tomography scans of the lung: The VESSEL12 study,” Medical Image Analysis, vol. 18, pp. 1217–1232, July 2014, doi: https://doi.org/10.1016/j.media.2014.07.003.

[49] A. Depeursinge, A. Vargas, A. Platon, A. Geissbuhler, P.-A. Poletti, H. Müller, “Building a reference multimedia database for interstitial lung diseases,” Computerized Medical Imaging and Graphics, vol. 36, pp. 227–238, July 2011, doi: https://doi.org/10.1016/j.compmedimag.2011.07.003.

Downloads

Published

2026-02-24
Metrics
Views/Downloads
  • Abstract
    89
  • PDF
    31

How to Cite

Gutiérrez, J. D., Lozano-García, N., Delgado, E., Rubio-Largo, Álvaro, and Rodriguez-Echeverria, R. (2026). Exploring the Limits of Foundation Models in Medical Image Segmentation: A Case Study With SAM and Genetic Algorithms. International Journal of Interactive Multimedia and Artificial Intelligence, 1–14. https://doi.org/10.9781/ijimai.2026.2223

Issue

Section

Regular Articles