Abstract
The K-Nearest Neighbors (KNN) has been proven to be an effective method for addressing classification problems. The performance of the KNN algorithm is heavily dependent on the value of parameter K, which represents the number of nearest neighbors. Choosing an inappropriate value for K can affect the classification accuracy because a smaller chosen K can lead to overfitting and vice versa. So, the appropriate selection of the K value has a significant impact on the performance of KNN. Manually, adjusting the value of K is a very difficult process because the appropriate choices for this value depend on the status of the search. Accordingly, the need to utilize an on-line adjusting technique is still existing. One of the recent algorithms is Dragonfly Algorithm (DA), which solves several combinatorial problems. In this work, the DA is adopted to automatically determine the most appropriate value of K for the KNN algorithm. Additionally, the performance of the proposed model is enhanced via utilizing (PCA) for feature extraction. This integration produces the hybrid algorithm named (KNN-PCA-DA). Recently, diabetic retinopathy (DR), a chronic form of diabetes and the leading cause of blindness. Early and accurate diagnosis of DR is essential for early treatment and prevention of irreversible vision loss. Hence, the performance of the proposed model is evaluated using the Diabetic Retinopathy Debrecen dataset. The obtained experimental results demonstrate that the proposed model is an effective solution for the DR problem, achieving competitive results with an accuracy of 99.47% compared to other models.
Keywords
Diabetes retinopathy, Dragonfly algorithm, K-Nearest neighbors, Pattern recognition, Principal component analysis
Subject Area
Computer Science
Article Type
Article
First Page
1282
Last Page
1298
Creative Commons License

This work is licensed under a Creative Commons Attribution 4.0 International License.
How to Cite this Article
Abdalkafor, Ahmed Subhi; Jihad, Alaa Abdalqahar; and Yassen, Esam Taha
(2026)
"Optimizing K-Nearest Neighbor Based on Dragonfly Algorithm for Diabetes Retinopathy Classification,"
Baghdad Science Journal: Vol. 23:
Iss.
4, Article 12.
DOI: https://doi.org/10.21123/2411-7986.5268
