Report
Report
BACHELOR OF ENGINEERING
IN
ELECTRICAL AND ELECTRONICS
ENGINEERING
BONAFIDE CERTIFICATE
Certified further that to the best of my knowledge the work reported herein does
not form part of any other thesis or dissertation on the basisof which a degree
or award was conferred on an earlier occasion on this or any other candidate.
SIGNATURE SIGNATURE
ABSTRACT
ACKNOWLEDGEMENT
We would like to express our gratitude to the below mentioned people who
have been instrumental in the completion of this project.
We express our deep respect to Padma Bhushan Dr. Shiv Nadar,
Chairman, SSN Institutions for providing the best infrastructure and
helping us realize our project.
We would like to thank Dr. Kala Vijaykumar, President of SSN College
of Engineering, Dr. V.E. Annamalai, Principal of SSN College of
Engineering, Dr. S. Radha, Vice Principal of SSN College of Engineering
for providing us the facilities to carry out the project successfully.
We would like to sincerely thank Dr. V. Rajini Head of Department of
Electrical and Electronics Engineering and our project guide Dr.
G.R.Venkatakrishnan Assistant professor who has been kind, patient and
provided great support and her expert guidance and constant support
throughout the project.
We express immense pleasure in thanking all the faculty members of the
Department of Electrical and Electronics engineering for their constant
guidance and cooperation.
DIVYA DHARSHINI N
MANIKANDAN S
MONA ABISHEK A
v
TABLE OF CONTENTS
CHAPTER PAGE
TITLE
NO. NO.
1 ABSTRACT iii
LIST OF TABLES x
1 INTRODUCTION 12
1.1 OVERVIEW 11
1.2 RASPERRY PI MODULE 13
1.3 LITERATURE SURVEY 14
1.4 OBJECTIVE OF REPORT 16
1.5 ORGANIZATION OF REPORT 17
1.6 CONCLUSION 17
2 HARDWARE APPLICATION 19
2.1 INTRODUCTION 19
2.2 RASPBERRY PI 20
2.3 PI CAM MODULE 24
2.4 CIRCUIT CONNECTION 27
2.5 CONCLUSION 38
3 FACIAL RECOGNITION 40
IMPLEMENTATION
3.1 INTRODUCTION 40
3.2 PYTHON 41
3.2.1 PYTHON IN FACIAL 41
RECOGNITION
vi
LIST OF FIGURES
FIGURE
LIST OF FIGURES PAGE NO.
NO.
LIST OF TABLES
TABLE PAGE
LIST OF TABLES
NO. NO.
C - Celsius
DB - Data Base
GND - Ground
GPIO - General Purpose Input/Output
I2C - Inter-Integrated Circuit
IDE - Integrated Development Environment
KB - Kilo Byte
MHz - Mega Hertz
PWM - Pulse Width Modulation
SPI - Serial Peripheral Interface
TTL - Transistor-Transistor Logic
UART - Universal Asynchronous Receiver/Transmitter
USB - Universal Serial Bus
V - Voltage
CNN - Convolutional Neural Network
HDMI - High Definition Multimedia Interface
DIP - Dual In-Line Package
12
CHAPTER 1
INTRODUCTION
1.1 Overview
1.6 Conclusion
CHAPTER 2
HARDWARE APPLICATION
2.1 Introduction
2.2 Raspberry Pi
The Raspberry Pi is a very cheap computer that runs Linux, but it also
provides a set of GPIO (general purpose input/output) pins, allowing you
to control electronic components for physical computing and explore the
Internet of Things (IoT). Due to the nature of the IoT technology in the
Raspberry Pi, it can be used to communicate with other devices around a
home, and even automate some processes with some smart applications of
a few simple lines of code.
Features:
• They support microSD card storage for operating system and data
storage, with options for expanding storage using external drives.
SPECIFICATION DESCRIPTION
Module model Raspberry Pi
Package DIP (Dual In-line Package)
22
Raspberry Pi - Pinout:
A powerful feature of the Raspberry Pi is the row of GPIO pins along the
top edge of the board. A 40-pin GPIO header is found on all current
Raspberry Pi boards, although it is unpopulated on Raspberry Pi Zero,
Raspberry Pi Zero W, and Raspberry Pi Zero 2 W. The GPIO headers on
all boards have a 0.1in (pin pitch.
Two 5V pins and two 3.3V pins are present on the board, as well as a
number of ground pins (GND), which can not be reconfigured. The
remaining pins are all general-purpose 3.3V pins, meaning outputs are set
to 3.3V and inputs are 3.3V-tolerant. A GPIO pin designated as an output
pin can be set to high (3.3V) or low (0V). This is made easier with the use
of internal pull-up or pull-down resistors. Pins GPIO2 and GPIO3 have
fixed pull-up resistors, but for other pins this can be configured in
software.
24
Features:
• Resolution – 5 MP
• HD Video recording – 1080p @30fps, 720p @60fps, 960p
@45fps and so on.
• It Can capture wide, still (motionless) images of a resolution
2592x1944 pixels.
• CSI Interface enabled.
• Compact Static Images Resolution: 2592×1944
• Aperture (F): 1.8
• Visual Angle: 65 degree
• Supported OS: Raspbian (latest version recommended)
The Raspberry Pi Camera Module 2 replaced the original Camera Module
in April 2016. The v2 Camera Module has a Sony IMX219 8-megapixel
sensor (compared to the 5-megapixel OmniVision OV5647 sensor of the
original camera).
The Camera Module 2 can be used to take high-definition video, as well
as stills photographs. It’s easy to use for beginners, but has plenty to offer
advanced users if you’re looking to expand your knowledge. There are lots
of examples online of people using it for time-lapse, slow-motion, and
25
other video cleverness. You can also use the libraries we bundle with the
camera to create effects.
The camera works with all models of Raspberry Pi 1, 2, 3 and 4. It can be
accessed through the MMAL and V4L APIs, and there are numerous third-
party libraries built for it, including the Picamera Python library. See the
Getting Started with Picamera resource to learn how to use it.
All models of Raspberry Pi Zero require a Raspberry Pi Zero camera
cable; the standard cable supplied with the camera module is not
compatible with the Raspberry Pi Zero camera connector. Suitable cables
are available at low cost from many Raspberry Pi Approved Resellers, and
are supplied with the Raspberry Pi Zero Case.
The camera module is very popular in home security applications, and in
wildlife camera traps.
SPECIFICATION DESCRIPTION
Image Sensor Sony IMX 219 PQ CMOS image
sensor in a fixed-focus module.
Resolution 8-megapixel
Still picture resolution 3280 x 2464
Max image transfer rate 1080p: 30fps
(encode and decode)
720p: 60fps
Connection to Raspberry Pi 15-pin ribbon cable, to the
dedicated 15-pin MIPI Camera
Serial Interface (CSI-2).
Image control functions Automatic exposure control
Automatic white balance
Automatic band filter Automatic
50/60 Hz luminance detection
Automatic black level calibration
Temp range Operating: -20º to 60º Stable
image: -20º to 60º
Lens size 1/4”
Dimensions 23.86 x 25 x 9mm
Weight 3g
27
Insert FFC firmly until it hits the deepest part of the FFC entry and push
down the black switch.
28
3. Insert the SD card in the card reader then plug the card reader into the
computer. You should click CHOOSE SD CARD to let the following SD
Card page appear. Now, select the SD card information bar. Back to the
RPi page and click WRITE to download and flash the RPi system.
30
4. Replug the card reader once the flash is finished and create a file named
ssh without suffix name in / boot directory.
Step 2: Connect the RPi to the screen, configure RPi wifi & password,
choose country & language, and click the icon to check the RPi ip.
Got the ip, you can use putty tool to control RPi remotely via ssh remote
connection.
Putty download
link: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
Download finished, putty page is as shown. You need to input RPi ip, and
type in 22 in the port box. Check ssh and click open to connect with RPi.
34
The terminal page appears once you click open. By default, the ID is "pi"
and the password is "raspberry". Note the alphabetic case.
2.5 Conclusion
CHAPTER 3
3.1 Introduction
3.2 Python
3.3 Libraries
The choice of libraries for this project stems from their collective ability
to provide a comprehensive and efficient framework for facial recognition.
Each library brings unique advantages, contributing to the seamless
implementation of the algorithm.
3.3.1 OpenCV
3.3.2 NumPy
Feature Extraction: For each cell in the image, LBPH computes a Local
Binary Pattern (LBP) histogram. To compute the LBP histogram, LBPH
examines each pixel within the cell and calculates its binary pattern based
on the intensity comparisons with neighbouring pixels. The resulting
binary patterns are concatenated to form a histogram, which represents the
distribution of local texture patterns within the cell. The histogram
45
Face Detection: During face detection, the trained Haar cascade classifier
is applied to the input image. The classifier evaluates each region of the
image using the learned features, efficiently narrowing down the search
space to regions likely to contain faces.
By leveraging the Haar cascade classifier for face detection, our system
can efficiently locate faces within images, facilitating subsequent
recognition tasks using the LBPH algorithm.
cv2: As the cornerstone of the script, OpenCV (cv2) provides a rich array
of functionalities for computer vision tasks, including face detection and
image manipulation.
psycopg2: The psycopg2 library serves as the bridge between Python and
PostgreSQL, enabling seamless communication and interaction with the
PostgreSQL database for storage and retrieval of attendance records.
datetime: The datetime module equips the script with capabilities for
working with dates and times, essential for timestamp generation and
time-based operations during attendance tracking.
random: The random module enriches the script with the ability to
generate random numbers, empowering it to introduce variability and
randomness, such as in generating random check-out times for attendance
records.
These imported libraries collectively lay the groundwork for the script's
functionality, providing a comprehensive toolkit for image processing,
database connectivity, timestamp management, and randomization.
size: This variable governs the scale factor used for resizing captured face
images, influencing the processing and recognition accuracy.
haar_file: The script specifies the file path to the Haar cascade classifier
XML file, which is instrumental in detecting faces within images and
video streams.
Code:
saving the recognized face image to the output folder, inserting attendance
data into the database, and updating the timestamp of the last entry.
User Interaction: The recognition process continues until the user presses
the 'q' key, at which point the webcam is released, and OpenCV windows
are closed.
Code:
Code:
3.6 Conclusion
We adopt two key algorithms for facial recognition: the Local Binary
Pattern Histogram (LBPH) and the Haar cascade classifier. Implemented
within Python, these algorithms enable accurate face detection and
recognition across diverse environments.
CHAPTER 4
DATABASE INTEGRATION
4.1 Introduction
Image Path: The image path field stores the file path to the image of the
recognized individual. This image is captured during the facial recognition
process and serves as visual evidence of the student's presence during
attendance tracking sessions. Storing the image path allows for efficient
retrieval and display of attendance records along with corresponding
student images.
Timestamp: The timestamp field records the date and time at which the
attendance record was created. This temporal information is crucial for
tracking attendance over time, enabling educators to monitor student
62
Purpose:
The primary objective of the web application is to streamline the process
of accessing and analyzing attendance data. By offering a user-friendly
interface accessible from any internet-enabled device, educators can
effortlessly track attendance, identify patterns, and make data-driven
decisions to improve student engagement and performance.
Key Features:
Login Page: The web application includes a secure login page where
authorized users, such as teachers and administrators, can authenticate
themselves before accessing attendance data. User credentials are
validated to ensure only authorized individuals can access sensitive
information.
Attendance Display: Upon successful login, users are presented with an
intuitive interface for viewing attendance data. Attendance records are
displayed in a structured format, allowing users to quickly navigate
through different sessions, classes, or students.
Benefits:
Accessibility: The web appl
The login page serves as the gateway for authorized users to access the
attendance tracking system. It provides a secure authentication mechanism
to verify the identity of users before granting them access to sensitive
attendance data. Below is a description of the login page functionality:
Functionality:
User Authentication: The login page prompts users to enter their
credentials, typically a username and password, to authenticate their
identity. This process ensures that only authorized users with valid
credentials can access the system.
68
Credential Validation:
Upon submitting the login form, the entered credentials are validated
against the system's user database. This validation process verifies the
accuracy and authenticity of the provided credentials, ensuring that only
registered users can log in.
Error Handling:
The login page includes error handling mechanisms to handle various
authentication scenarios, such as incorrect username or password, expired
sessions, or account lockouts due to multiple failed login attempts. Clear
and informative error messages are displayed to guide users in resolving
authentication issues.
Benefits:
Security: The login page enhances the security of the attendance tracking
system by requiring users to authenticate their identity before accessing
sensitive data. This helps prevent unauthorized access and protects the
integrity and confidentiality of attendance records.
Benefits:
Efficient Monitoring: The attendance display page streamlines attendance
monitoring, enabling users to track student attendance status and trends
with minimal effort.
Informed Decision-Making: Through detailed attendance records and
visualizations, users gain insights into attendance patterns, empowering
them to make informed decisions to improve student engagement and
outcomes.
4.10 Conclusion
The database structure, comprising fields for student names, image paths,
and timestamps, serves as the foundation for efficient data management
and retrieval. Maintaining a structured schema facilitates data integrity,
query efficiency, and standardization, enabling educators to track
attendance accurately and analyze trends effectively.
CHAPTER 5
5.1 Conclusion
The future scope for the automated attendance system using contactless
facial recognition is vast and promising, extending its application across
diverse sectors. In the educational domain, the system could evolve to
encompass more advanced analytics, providing insights into attendance
patterns, engagement levels, and even student sentiments through facial
expressions. Machine learning algorithms could be integrated to enhance
facial recognition accuracy and adapt to varying environmental
conditions, ensuring a robust and reliable system.
The system could be adapted for use in offices, conferences, and events,
simplifying registration processes and improving overall security.
Integration with access control systems could enhance workplace security
by ensuring that only authorized personnel gain entry.In essence, the
future scope for this project extends far beyond its current educational
application, with the potential to revolutionize attendance tracking and
access control in various sectors, contributing to a technologically
advanced and streamlined future.
74
REFERENCES