This research paper presents the design and implementation of a real-time, contactless attendance monitoring system based on face recognition using the K-Nearest Neighbor (KNN) algorithm. With the growing need for secure, automated, and hygienic attendance systems—especially in educational institutions and workplaces—biometric solutions have become highly relevant. The proposed system utilizes a webcam to capture facial images of individuals, which are then pre-processed by converting them into grayscale and resizing them to a standard format. These images are used to train a KNN classifier that learns to distinguish between different individuals based on facial features.
The system employs Haar cascade classifiers for face detection, and during execution, it continuously scans and recognizes faces in real-time, logging attendance data with timestamps. All recognized faces are stored systematically in a text-based log file organized by individual and date. The solution was tested under various environmental conditions including well-lit indoor, low-light, and outdoor scenarios. The experimental results indicate a high level of accuracy, particularly in controlled lighting environments, with performance gracefully degrading in low-light scenarios.
The simplicity and efficiency of the KNN algorithm make it well-suited for small- to medium-scale applications, offering a cost-effective and scalable alternative to more complex deep learning models. This system serves as a practical demonstration of how traditional machine learning methods can still offer viable solutions for real-world biometric identification tasks.
Introduction
Attendance management is crucial in institutions and workplaces but traditional methods like paper registers or RFID cards are inefficient and prone to errors or misuse. Biometric systems, especially facial recognition, offer a non-intrusive, hygienic, and automatic alternative. This project proposes a real-time face recognition attendance system using the K-Nearest Neighbors (KNN) algorithm, implemented with Python and OpenCV. The system captures face images via webcam, detects faces with Haar cascades, and classifies them using a trained KNN model to log attendance automatically.
The literature survey reviews key face recognition methods such as PCA (Eigenfaces), Local Binary Patterns (LBP), and Support Vector Machines (SVM), highlighting their strengths and limitations and justifying the choice of KNN for simplicity and effectiveness.
The project aims to automate attendance marking, improve hygiene by being contactless, and offer a cost-effective solution suitable for small organizations and educational institutions.
Implementation details include face data collection, grayscale conversion, feature extraction, KNN training, and real-time recognition with attendance logging. Testing showed high accuracy in normal indoor lighting, with some performance drop in poor lighting, suggesting future improvements could involve lighting normalization or deep learning methods.
References
[1] M. Turk and A. Pentland, \"Eigenfaces for Recognition,\" Journal of Cognitive Neuroscience, vol. 3, no. 1, pp. 71–86, 1991.
[2] T. Ahonen, A. Hadid, and M. Pietikäinen, \"Face Description with Local Binary Patterns: Application to Face Recognition,\" IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 28, no. 12, pp. 2037–2041, 2006.
[3] G. Bradski, \"The OpenCV Library,\" Dr. Dobb\'s Journal of Software Tools, 2000.
[4] F. Pedregosa et al., \"Scikit-learn: Machine Learning in Python,\" Journal of Machine Learning Research, vol. 12, pp. 2825–2830, 2011.
[5] S. Zhao, Y. Liu, and H. Yang, \"Real-Time Face Recognition Using KNN Classification Algorithm,\" International Journal of Computer Applications, vol. 133, no. 1, pp. 25–30, 2016.