# Advanced Medical Image Segmentation Enhancement:
## 5 Conclusions  
In this study, we investigated the potential of particle swarm optimization (PSO) as a medical image segmentation method and specifically focused on lung CT scan and chest X-ray images. Our results underscore the significant role of preprocessing techniques, particularly histogram equalization (HE), in shaping the quality and precision of segmented images. HE, when applied, led to a notable improvement in accuracy and Dice in lung CT scan images and elevated the overall segmentation quality. The challenges encountered with chest X-ray images, characterized by lower spatial resolution and the presence of overlapping structures, emphasize the importance of choosing the appropriate segmentation method, especially when HE is not employed. Here, certain alternative techniquesdemonstrate competitive performance, highlighting the need to consider image-specific characteristics in the selection process.  
Comparative assessments against other segmentation methods, including Otsu, Watershed, and K-means, accentuate the ability of the PSO segmentation approach to generate images with superior clarity and accuracy, particularly when preprocessing is integrated. Dice similarity coefficient (DSC) and Jaccard index values approaching one indicate the high accuracy and precision of the proposed PSO method and signify its potential in medical image segmentation tasks. In future work, the domain of medical image segmentation can benefit from further exploration and integration of machine learning and deep learning approaches. These methodologies, equipped with robust algorithms and vast datasets, have the potential to further enhance the accuracy and efficiency of medical image segmentation, which will provide invaluable support to medical practitioners and researchers for image analysis and diagnosis.  
Conceptualization, S.S. and R.D.; Data curation, S.S.; Formal analysis, S.S. and R.D.; Funding acquisition, R.D.; Investigation, S.S.; Methodology, S.S.; Project administration, R.D.; Resources, S.S.; Software, S.S.; Supervision, R.D.; Validation, S.S. and R.D.; Visualization, S.S.; Writing--original draft, S.S. and R.D.; Writing--review and editing, S.S. and R.D. All authors have read and agreed to the published version of the manuscript.  
The research presented in this paper was partially supported by funds from the Polish Ministry of Education and Science assigned to AGH University of Krakow. Additionally, it was also partially supported by PLGrid Infrastructure with grant number PLG/2023/016757.  
Not applicable.  
The datasets used in this study are freely available and can be accessed from [[https://www.kaggle.com/datasets/kmader/finding-lungs-in-ct-data](https://www.kaggle.com/datasets/kmader/finding-lungs-in-ct-data)]([https://www.kaggle.com/datasets/kmader/finding-lungs-in-ct-data](https://www.kaggle.com/datasets/kmader/finding-lungs-in-ct-data)) and [[https://www.kaggle.com/datasets/tawsifurrahman/covid19-radiography-database](https://www.kaggle.com/datasets/tawsifurrahman/covid19-radiography-database)]([https://www.kaggle.com/datasets/tawsifurrahman/covid19-radiography-database](https://www.kaggle.com/datasets/tawsifurrahman/covid19-radiography-database)) (accessed on 23 June 2023).  
The authors declare no conflicts of interest.