Batch 2 Project ML
Batch 2 Project ML
ON
Submitted by
22RH1A6668 G.Sushmitha
22RH1A6669 G.Vaishnavi
22RH1A6670 G.Harshini
DEPARTMENT OF
ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
2024-2025
ABSTRACT
This project focuses on developing a real-time face detection and recognition system
using OpenCV, a popular computer vision library in Python. The system captures live
video from a webcam, detects faces in the frame, and recognizes them using a pre-
trained model. It combines techniques like Haar cascades or DNN models for detection
and LBPH, Eigenfaces, or deep learning methods for recognition. The implementation
is lightweight, efficient, and adaptable to various environments. This system has
potential applications in security, attendance systems, and personalized user
experiences. The document outlines the methodology, results, and scope for future
enhancements
INDEX
Abstract i
Introduction 1
System requirement 2
Literature survey 3
System architecture 4
Implementation 5
Result 6
Conclusion 7
Future Scope 8
References 9
INTRODUCTION
Face detection and recognition are critical components of modern computer vision
systems. They enable machines to identify and verify individuals based on their facial
features. With advancements in machine learning and deep learning, real-time face
recognition has become more accurate and reliable. This project leverages OpenCV, a
robust computer vision library, to implement face detection and recognition in real time.
The system uses a webcam to capture video frames, identifies faces using efficient
algorithms, and matches them with a database of known faces. Applications range from
enhancing security to automating attendance and enabling personalize services.
1
SYSTEM REQUIREMENTS
Hardware Requirements :
1. Processor: Multi-core processor (Intel i5 or equivalent) for efficient real-time processing.
2. RAM: Minimum 8GB for smooth operation of face detection and recognition algorithms.
3. Webcam: HD webcam for capturing clear video frames.
4. Storage: At least 1GB of free disk space for saving datasets and model files.
5. Graphics Card(optional): NVIDIA GPU for faster processing when using deep learning models.
Software Requirements:
1. Operating System: Windows 10/11, Linux (Ubuntu), or macOS.
2. Programming Language: Python 3.7 or higher.
3. Libraries: OpenCV, NumPy, and dlib for face detection and recognition.
4. IDE/Tools: Jupyter Notebook or any Python-compatible IDE (e.g., PyCharm, VS Code).
5. Pre-trained Model: Haar cascades or custom-trained models for face recognition.
2
LITERATURE SURVEY
Face detection and recognition have been researched extensively in the field of computer
vision. Traditional methods like Haar cascades and HOG features provide robust
detection, while Eigenfaces and Fisherfaces have been widely used for recognition.
Recent advancements include convolutional neural networks (CNNs), which achieve
higher accuracy by learning complex facial patterns. OpenCV has simplified
implementation by providing pre-built functions for both detection and recognition.
Research also highlights the importance of real-time systems in applications like
surveillance and user authentication, where speed and accuracy are critical.
3
SYSTEM ARCHITECTURE
The system consists of two primary modules: face detection and face recognition. The
face detection module uses Haar cascades or a deep learning-based model to identify
faces in video frames. Once detected, the face is cropped and passed to the recognition
module, which compares it with stored data using algorithms like LBPH or deep neural
networks. The architecture integrates OpenCV for video processing, NumPy for data
handling, and a lightweight database for storing known faces. The output includes the
detected face with a label identifying the person or marking it as unknown.
4
IMPLEMENTATION
import cv2
import numpy as np
# Start webcam
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
cap.release()
cv2.destroyAllWindows()
5
RESULTS
6
CONCLUSION
This project demonstrates the implementation of a real-time face detection and recognition
system using OpenCV. By leveraging powerful algorithms like Haar cascades for detection and
LBPH for recognition, the system achieves high efficiency and accuracy. It proves to be a cost-
effective solution for various applications, including security systems, attendance automation,
and user authentication. The integration of OpenCV simplifies the development process,
making it accessible for developers. This project highlights the potential of computer vision in
solving real-world problems and serves as a foundation for future enhancements in face
recognition technology.
7
FUTURE SCOPE
The system can be extended with several improvements for enhanced performance and
functionality. Incorporating deep learning-based models, such as CNNs, can significantly
increase accuracy for challenging scenarios like occlusion or poor lighting. Adding multi-face
recognition capability would allow handling multiple individuals simultaneously. Cloud
integration for storing and managing large datasets can improve scalability. Implementing
additional security measures, such as spoof detection, can make the system more robust. These
enhancements would broaden the scope of applications and address the evolving needs of
industries relying on face recognition technologies.
8
REFERENCES
1. Bradski, G., & Kaehler, A. (2008). Learning OpenCV: Computer Vision with the OpenCV
Library. O'Reilly Media.
2. Viola, P., & Jones, M. (2001). Rapid object detection using a boosted cascade of simple
features. Proceedings of CVPR.