Implementation of the K-Nearest Neighbor (KNN) Algorithm in Handwritten Digit Pattern Recognition Using the Zoning Method
DOI:
https://doi.org/10.51903/kf6s5f56Keywords:
Digit Recognition, Handwriting, K-Nearest Neighbors, Digital Image Processing, Google ColabAbstract
Handwritten digit recognition is one of the key challenges in the field of digital image processing and artificial intelligence, with significant potential in various applications such as automatic form input systems, handwritten data correction, and attendance systems based on handwriting. This study aims to develop a web-based information system capable of automatically recognizing handwritten digits using the K-Nearest Neighbors (KNN) classification method. The system is designed through several main stages, including image preprocessing (conversion to grayscale, thresholding, and image size normalization), feature extraction using the zoning technique, and classification using the KNN algorithm. This research utilizes the MNIST dataset, which contains thousands of handwritten digit images ranging from 0 to 9. The system is developed using the Google Colab platform, supported by Python libraries such as OpenCV, NumPy, and Scikit-learn. Test results show that the system can achieve an accuracy of over 90% at certain K values, indicating that the KNN method is quite effective and efficient in recognizing handwritten digit patterns. This system is expected to be applicable for various digitization needs of handwritten numbers in education, administration, and information technology sectors.
References
H. Syahputra, R. Givent, and A. Simanjorang, “Penerapan Algoritma K-Nearest Neighbor (KNN) dalam Pengenalan Pola Tulisan Tangan Angka 0-9,” vol. 28, no. 2, p. 2023.
V. Oktavia and N. Wijaya, “Pengenalan Tulisan Tangan Huruf Latin Bersambung Menggunakan Local Binary Pattern dan K-Nearest Neighbor,” 2022.
M. I. Mubarok, C. Informatika, S. Karawang, J. H. Ronggo Waluyo, T. Timur, and I. Karawang, “PENERAPAN ALGORITMA K-NEAREST NEIGHBOR (KNN) DALAM KLASIFIKASI PENILAIAN JAWABAN UJISAN ESAI,” 2023.
C. Ramadhona Hassolthine, R. Sahara, F. Asy, S. N. Haq, and S. Abdullah, “Hlm 358-363 1,2,4 PJJ Informatika,” JOISIE Journal Of Information System And Informatics Engineering, vol. 7, no. 2, pp. 2780–6189, 2023.
Z. A. Muhammad, G. Budiman, and S. Saidah, “PENGGUNAAN COMPRESSIVE SENSING PADA PENGENALAN HURUF DENGAN TULISAN TANGAN MENGGUNAKAN METODE K-NEAREST NEIGHBOR”, doi: 10.25126/jtiik.202295612.
M. Suyal and P. Goyal, “A Review on Analysis of K-Nearest Neighbor Classification Machine Learning Algorithms based on Supervised Learning,” Jul. 01, 2022, Seventh Sense Research Group. doi: 10.14445/22315381/IJETT-V70I7P205.
Downloads
Published
Issue
Section
License
All articles published in this journal are open access and licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0).
Under this license:
-
Authors retain copyright of their work.
-
Others are free to:
-
Share — copy and redistribute the material in any medium or format;
-
Adapt — remix, transform, and build upon the material for any purpose, even commercially;
-
-
As long as they:
-
Give appropriate credit to the original author(s) and the source;
-
Provide a link to the license;
-
Indicate if changes were made;
-
Distribute their contributions under the same license as the original.
-
This ensures that derivative works will also remain free and open under the same terms.













.png)