Face Attendance System
Face Attendance System
PROJECT DONE BY
A.Jaideep - 227Z1A0508
1
INDEX
Topic Page No
1. Introduction 3
4. System Requirements 6
6. Result 10
7. Conclusion 11
2
FACE ATTENDANCE SYSTEM
INTRODUCTION
Automated Face Attendance Systems offer efficient alternatives to error-prone
manual methods. While facial recognition technology is effective, the choice of
the underlying classification algorithm significantly impacts performance
(accuracy, speed) for a specific dataset. Selecting the optimal algorithm is
crucial for deploying a reliable system.
3
BENEFITS
1. Enhanced Accuracy: Minimizes errors associated with manual attendance
taking, such as missed entries or false signatures.
2. Increased Efficiency: Automates the attendance process, saving time and
resources compared to traditional methods.
OBJECTIVES
● To design and develop a face attendance system using machine learning
algorithms for accurate facial recognition.
4
HIGH-LEVEL REQUIREMENTS
1. Face Detection: Accurately detect faces in images or video streams.
LOW-LEVEL REQUIREMENTS
● Image/Video Input: Utilize a camera or video input device to capture
images/video. It supports standard image/video formats.
5
SYSTEM REQUIREMENTS
Hardware Requirements
1. Camera: A web camera or IP camera for capturing images or video
streams.
3. Storage: Storage space to store images, video data, facial embeddings,
and attendance records.
Software Requirements
1. Operating System: Windows, Linux, or macOS.
3. Libraries:
6
SOURCE CODE
import cv2
import face_recognition
import numpy as np
import os
import datetime
import csv
from datetime import datetime
class FaceAttendanceSystem:
def __init__(self):
self.known_face_encodings = []
self.known_face_names = []
self.attendance_list = set()
self.load_known_faces()
def load_known_faces(self):
# Create a directory for known faces if it doesn't exist
if not os.path.exists('known_faces'):
os.makedirs('known_faces')
print("Created 'known_faces' directory. Please add
face images of students/employees.")
return
self.known_face_names.append(os.path.splitext(filename)[0])
7
current_time = datetime.now().strftime('%Y-%m-%d
%H:%M:%S')
def run(self):
# Initialize webcam
video_capture = cv2.VideoCapture(0)
while True:
# Capture frame-by-frame
ret, frame = video_capture.read()
8
# If a match was found in known_face_encodings,
use the first one
if True in matches:
first_match_index = matches.index(True)
name =
self.known_face_names[first_match_index]
self.mark_attendance(name)
if __name__ == "__main__":
print("Starting Face Attendance System...")
print("Press 'q' to quit")
system = FaceAttendanceSystem()
system.run()
9
RESULT
Starting Performance Analysis Script...
Loading face attendance dataset... Done.
Splitting dataset into training and testing sets (70/30)... Done.
Evaluating Model: Support Vector Machines (SVM) with RBF Kernel...
Calculating metrics...
Accuracy: 0.92
Precision: 0.93
Recall: 0.92
F1-Score: 0.92
Average Recognition Time: 85.0 ms
SVM Evaluation Complete.
10
CONCLUSION
This project successfully demonstrates the development of a Face Attendance
System using machine learning techniques and Python programming. By
integrating facial recognition algorithms, the system provides an automated,
efficient, and secure solution for attendance tracking, replacing traditional
manual methods. The use of Python libraries such as OpenCV, face_recognition,
and TensorFlow/PyTorch proved effective for implementing the various
components of the system, including face detection, feature extraction, and
recognition.
11