0% found this document useful (0 votes)
178 views10 pages

Face Recognition Door Lock System Using Raspberry Pi

One of the crucial difficulties we aim to find in computer vision is to recognize items automatically without human interaction in a picture. Face detection may be seen as an issue when the face of human beings is detected in a picture. The initial step towards many face-related technologies, including face recognition or verification, is generally facial detection. Face detection however may be quite beneficial.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
178 views10 pages

Face Recognition Door Lock System Using Raspberry Pi

One of the crucial difficulties we aim to find in computer vision is to recognize items automatically without human interaction in a picture. Face detection may be seen as an issue when the face of human beings is detected in a picture. The initial step towards many face-related technologies, including face recognition or verification, is generally facial detection. Face detection however may be quite beneficial.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

9 VI June 2021

https://doi.org/10.22214/ijraset.2021.34896
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 9 Issue VI Jun 2021- Available at www.ijraset.com

Face Recognition Door Lock System using


Raspberry Pi
K. V. Usha Ramani1, Imroze Jahan2, Mr. P. Anvesh3
1, 2 3
U.G. Student, Assistant Professor Dept. of ECE, Sreenidhi Institute of Science and Technology, Hyderabad, Telangana-501301
India

Abstract: One of the crucial difficulties we aim to find in computer vision is to recognize items automatically without human
interaction in a picture. Face detection may be seen as an issue when the face of human beings is detected in a picture. The
initial step towards many face-related technologies, including face recognition or verification, is generally facial detection. Face
detection however may be quite beneficial. A biometric identification system besides fingerprint and iris would likely be the most
effective use of face recognition. The door lock system in this project consists of Raspberry Pi, camera module, relay module,
power input and output, connected to a solenoid lock. It employs the two different facial recognition algorithms to detect the
faces and train the model for recognition purpose.
Keywords: Face recognition, raspberry pi, opencv

I. INTRODUCTION
Robbery and illegal entrance are both common occurrences in today's society. As a result, security is crucial in everyday life. People
are typically preoccupied with their daily activities, but they also want to ensure the safety of their valuable items. They are prone to
misplacing important goods such as keys, wallets, and credit cards. If they don't have these, they won't be able to get to their
residence or any other destination. A lock opener, an authentication password, a RFID tag, or an ID swipe card are mostly required
for getting into a typical security system. On the other side, many security measures have flaws, such as the danger of being
forgotten or stolen by unauthorized individuals. As a result, enhanced authentication solutions that provide a greater level of security
as a template are required [1]. Biometric Authentication is one of them.
The word "Biometrics" refers to the measuring of human characteristics. In computer science, biometric authentication is a method
of identity and access control. It's also used to figure out who's who in a group of people that are being watched. Individuals are
identified using unique biometric identifiers with measurable qualities. Physiological biometric indicators are commonly used to
identify and categorize persons. In contrast to behavioural attributes, the shape of the body has an impact on physiological
characteristics. Fingerprints, palm veins, facial recognition, DNA, palm print, hand geometry, iris identification, retina, and
odour/scent are only a few examples [2].

A. Face Recognition
Face Recognition looks to be one of the most widespread, collected, and accessible technologies among the above listed methods of
biometric identifications. Because it relies on the same identifier that people use to differentiate one person from another, biometric
face recognition, also known as Automatic Face Recognition (AFR) [2], is a particularly appealing biometric technique.
Understanding the complicated human visual system and how humans represent faces in order to differentiate between different
identities is one of its key focuses. Faces can be divided according to their algorithms. There are several facial recognition
techniques. These includes: Classical face recognition approach, holistic approach, statistical approach, model-based approach,
feature based, artificial intelligence approach, hybrid approach, Gabor wavelets approach, Face descriptor‐ based methods, 3D‐
based face recognition and Video‐ based face recognition.

II. LITERATURE SURVEY


In the year 2018, Suma S L [6] implemented a real time face recognition algorithm using Linear Binary Pattern Histogram (LBPH)
and Viola Jones algorithm. This method consists of com fusion and recognition. is done using Viola Jones algorithm is applied is for
Face detection, feature extraction is done by LBPH technique and Euclidean Distance Classifier is used for face recognition. This
work has recognition rate of about “85%-95%”. This work can be further amended to favour in all conditions such as brightness, in
case of twins, beard and wearing goggles.

©IJRASET: All Rights are Reserved 138


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 9 Issue VI Jun 2021- Available at www.ijraset.com

In the year 2017, Li Cuimei [5] implemented a human face detection algorithm using three weak classifiers including Haar cascade
classifier. Skin hue histogram, Eye detection and Mouth detection are the three classifiers adopted by this method. This yields
sufficiently high detection. The proposed method generates a position prediction value (PPV) to about 78.18% - 98.01%. This can
be amended to detect human faces only of multiple races and reduce the delay for detecting and recognizing various faces among
different images of people with variation in light and background conditions.

III. BACKGROUND THEORY


Majority of face authentication systems look for distinguishing features such as the length of the nose, the wideness of the eyes, the
width and angle of the jaw, the prominence of the cheekbones, and the spacing between the eyes, and allocates a ID to each. The
system then compares that image to another image using these numerical values and determines how collinear images are. Face
recognition image origin includes pre-existing photographs from numerous perspectives as well as video camera feeds. Face
detection, Pre-processing, Feature extraction, and Feature matching/Face recognition are all aspects of a facial recognition system.
Now the important point in face recognition is, both the detection of faces and recognition have same four common procedures
namely,
1) Acquisition/ Face Detection
2) Pre-Processing
3) Feature Extraction
4) Training

Fig. 1 Process Flow after detecting a face while creating data set and while recognition process.

In this project, both of these processes undergo four common procedures namely, face acquisition, face detection using Haar
cascade classifier and pre-processing, feature extraction using Linear Binary Pattern algorithm to compute LBP values. These values
are stored in the database only in case of processing an input image. Finally, comparison of the values in the database with the
values computed via live streaming takes place which recognizes the human face as known or unknown based on the matching.

A. Face Detection
Face detection algorithms come in various types, each with its own set of flaws and advantages. Some employ skin tones, while
others employ contours, and still, others utilize templates, neural networks, or filters. The difficulty with these methods is that they
are computationally costly. A picture is nothing more than a set of pigment and/or light intensity values.
Because of the significant differences in form and pigmentation inside a human face, analyzing these pixels for face identification
takes time and effort. Re-analysis of pixels is frequently required for scaling and accuracy. Viola and Jones developed Haar
Classifiers, a method that uses AdaBoost classifier cascades based on Haar-like properties rather than pixels to quickly recognize
any object, including human faces. This is the algorithm that we’re using in this project for detecting the faces.

©IJRASET: All Rights are Reserved 139


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 9 Issue VI Jun 2021- Available at www.ijraset.com

1) Haarcascade Algorithm: Haar-like properties are the foundation for Haar categorizer object detection. Rather of using a pixel’s
illumination values, these characteristics employ the difference in brightness values between consecutive quadrilateral
groupings of pixels. To determine relative bright and dull regions, the contrast variances between pixel sets are employed. A
Haar-like characteristic is made by two or three neighbouring sets with a relative brightness variance. To detect a picture, Haar-
like characteristics are employed, as illustrated in Fig 2. By adjusting the index of pixel set under investigation, Haar
characteristics may be readily scaled. This makes it possible to employ features to detect objects of varied sizes.

Fig. 2 Common Haar Features

B. Pre-Processing and Feature Extraction


For feature extraction, we’re using LBPH (Local Binary Pattern Histogram) algorithm is utilized. The Linear Binary
Pattern Histogram is the most common choice for "Feature extraction". It works with a great deal of discrimination. Using this
technique, the image's features will be extracted in real-time. The Linear Binary Pattern Histogram method is divided into two
phases: training and assessment. During the training phase, picture samples are taught to be recognized, and during the estimation
phase, the picture to be tested is compared to the samples trained in the dataset.
1) LBPH Algorithm: Following the detection of the face, the following step is to extract features using the linear binary pattern
technique. The test image is converted to greyscale as the first stage in this technique. This picture, which is L x M pixels in
size, will be separated into areas. The areas have the same pixel size, resulting in n × n regions. Linear binary pattern operator
will be applied to each area. In this process, it will compare the centre pixel with its neighbour pixels. If the pixel size is greater
to centre pixel it is ‘1’ or it is ‘0. Accordingly, the LBP code for the centre pixel is generated by joining the neighbour pixel
values (ones or zeroes) into a binary code, which is converted to 256-dimensional decimal for ease as a texture description of
the centre pixel.

Fig. 3 LBPH Feature Extraction

©IJRASET: All Rights are Reserved 140


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 9 Issue VI Jun 2021- Available at www.ijraset.com

IV. SYSTEM BLOCK DIAGRAM


A. Block Diagram
The architecture of the Raspberry pi facial recognition system is smaller, easier than the PC-based facial recognition system, and has
lower power consumption. It is freer to build applications on Linux due to open-source code. For the face recognition and
identification method, the principal component analysis (Eigen faces) algorithm is used. The system is inexpensive, fast, highly
durable and offers sufficient versatility to satisfy various system requirements. Using technology:
1) Image Processing: This method is used for image capture and recognition compared with database images.
2) Embedded System Design: This approach is used for the module, which combines hardware, software and many other featured
components.

Fig.4 Block diagram of the system

Raspberry Pi GPIO pins give an output of 3.3V only. The solenoid lock requires 9-12V to operate. So we used an external DC
source and relay connected with pi to work the lock. The VCC and GND of the relay module connected to Raspberry Pi pins. Then
the signal pin of the relay module is given to the GPIO 26 of Raspberry Pi. On the other side of the relay module, connect the
negative from the external DC source to the negative of the solenoid door lock. Connect the positive from the DC power source to
the common of the relay module and then connect normally open from the relay module to positive of the solenoid door lock.

Fig 5 Connected Circuit

©IJRASET: All Rights are Reserved 141


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 9 Issue VI Jun 2021- Available at www.ijraset.com

V. IMPLEMENTATION
The project is designed and implemented with the help of Raspberry Pi for the door unlocking, which ensures that our homes are
safely protected. Raspberry Pi operates the video camera to capture images and monitors them. Open CV/ Python Library is
developed by using a stored facet database as a given picture of a scene to recognize or check one or more people in the scene. The
pictures are then derived and will match photographs from the collection. The door opens automatically if the pictures are paired.
Otherwise, the door lock remains closed.

Fig.6 Flow Chart of the process

The architecture of the Raspberry pi facial recognition system is smaller, easier than the PC-based facial recognition system, and has
lower power consumption. It is freer to build applications on Linux due to open-source code. For the face recognition and
identification method, the principal component analysis (Eigen faces) algorithm is used. The system is inexpensive, fast, highly
durable and offers sufficient versatility to satisfy various system requirements. Using technology:
1) Image Processing: This method is used for image capture and recognition compared with database images.
2) Embedded System Design: This approach is used for the module, which combines hardware, software and many other featured
components.
In this project, we worked on 3 very distinct phases for Face Recognition:

A. Collect the Data


We worked with face detection using this Haarcascade classifier. We need to extract features from positive and negative images and
train the model which then detects the faces. The OpenCV consists of a trainer as well as a detector. OpenCV already contains many
pre-trained classifiers for face, eyes, smile, etc. Those XML files can be download from Haarcascades directory. This python
code consists of 2 phases face detection and then gathering the detected data into a dataset. For collecting the data into the dataset,
create a folder to hold the data inside the project directory.

B. Train the Model


On this second step, we took all user data from the dataset and train the OpenCV Recognizer. This is done straight by a specific
OpenCV function. The result will be a .yml file that will be saved on a “trainer/” directory. A new python file training.py is created
to write the trainer program.

©IJRASET: All Rights are Reserved 142


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 9 Issue VI Jun 2021- Available at www.ijraset.com

C. Recognize the Faces


In the final step of the project, we will capture a fresh face on our camera through a live video stream and if this human’s face is
snapshotted and features extracted before, the recognizer model makes a prediction returning the person’s name and an index,
shown how confident the recognizer is with this match. And then the solenoid lock is opened to which the electrical is send by
raspberry Pi through the relay module.

VI. RESULTS
A. Collecting the Data
When this program is run, first it asks us to enter the face id to store the images captured later under that face id. Then it informs us
to look at the camera and wait till the face images are captured. Since it’s only a single camera, it won’t take much time.

Fig. 7 Face ID Fig. 8 Live Capture

The camera is turned on and it starts taking pictures of what is present in front of the camera. It does detect the face and takes frames
of the video capture happening at live. We took 90 images per face, i.e., 90 frames throughout the video capture. Given below are
the dataset frames of face 1and face 2. They are stored into the dataset directory which is inside the project directory.

Fig. 9 Face id =1 face frames Fig. 10 Face id =2 face frames

After the detection of 90 faces is completed, the program stops the live capture and informs us at the output window that face
detection is completed.

©IJRASET: All Rights are Reserved 143


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 9 Issue VI Jun 2021- Available at www.ijraset.com

B. Training the Data


After collecting the data, the data is to be trained. So training.py program is run each and every time a new face is detected. It trains
all the faces present in the dataset directory everytime. More the faces, more is the time taken by the program to extract all the
required features from the dataset that are to perform face recognition.
All the features extracted and the face ids are stored in a file “trainer.yml”. It is a .yml file that can be read by recognizer only. In
this project, we’re using LBPH Face Recognizer for face recognition.

Fig. 11 Training Faces Fig. 12 All faces in the dataset are trained.

C. Face Recognition and Door Lock Operation


This the main code of the project where the recognition of face and the operation of door lock is determined. When a person is
standing in front of the door, the program is run, first it enables the camera to start capturing the visual in front it.
The solenoid lock is kept closed until the face is recognized. If the face is recognized, the raspberry pi sending signal to solenoid
lock through relay module which is opened then and then it closes off again after time lapse of 10 seconds. The time lapse value is
manually set and can be altered whenever.

Fig. 13 Output Window Fig. 14 Face Recognized

VI. FUTURE SCOPE


The usage of the current projects can be seen in the authentication in home, banks and other public places. As machine learning is
very crucial in today’s technological world, there are many zones where this technique can be maximized. While carrying out this
project, we have observed that some areas need improvement, such as limitations of distance, the updating the techniques and
camera qualities. Accuracy can be enhanced in the coming future, which is straight related to our work. Internet of Things
capabilities can be incorporated by making use of sensors. The project can be further enhanced by focusing on a multi parameter
recognition system with additional mechanical support and an alerting system.

©IJRASET: All Rights are Reserved 144


International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429
Volume 9 Issue VI Jun 2021- Available at www.ijraset.com

VII. CONCLUSION
In this project, door locking system using face recognition process has been devised using a Raspberry Pi, relay module, solenoid
lock and a raspberry pi camera. We used the Haar Cascade classifier method to detect the face and Local Binary Pattern Histogram
(LBPH) in recognizing the face. The face recognition process depends on various attributes like illumination, face position and so
on, these problems have been addressed to get better results, thereby giving an output with a confidence between 60 to 70
percentage. We conclude that various operations are successfully tested and results are documented.

VIII. ACKNOWLEDGEMENT
Firstly, we are grateful to the Sreenidhi Institute of Science and Technology for allowing us to work on this project.
We are fortunate to have worked under the supervision of our guide Mr. P. Anvesh. His guidance and ideas have made this
project work.
We are thankful to Dr. Syed Jahangir Badashah for being in charge of this project and conduction reviews.
We are also thankful to the HOD of Electronics and Communication Engineering [ECE], Dr. S.P.V. Subba Rao for giving us access
to all the resources that went into building this project.

REFERENCES
[1] “Implementation of Human Face Detection System for Door Security using Raspberry Pi” 1. Shrutika V. Deshmukh, 2. Prof Dr. U. A. Kshirsagar, IJIREEICE,
ISO 3297:2007 Certified, Vol. 5, Issue 4, April 2017.
[2] “Home locking system through face recognition using Raspberry Pi and GSM module” 1. Ms. Poojitha S, 2. Ms. Yashodha S.A, 3. Ms. Priyadarshini S,
Bangalore institute of technology, Bengaluru, India, Project reference no.: 40s_be_0592.
[3] “Survey on real-time facial expression recognition techniques” 1. Shubhada Deshmukh, 2. Manasi Patwardhan, 3. Anjali Mahajan 1. PIET, VIT, Pune, India 2.
Computer Engineering, VIT, Pune, India 3. PIET, Nagpur, India, ISSN 2047-4938.
[4] “Face Recognition Using Haar - Cascade Classifier for Criminal Identification” 1. Senthamizh Selvi.R, 2. D.Sivakumar, 3. Sandhya.J.S , 4. Siva Sowmiya.S,
Ramya.S , Kanaga Suba Raja.S International Journal of Recent Technology and Engineering (IJRTE) ISSN: 2277-3878, Volume-7, Issue-6S5, April 2019.
[5] Cuimei Li, Qi Zhiliang. “Human face detection algorithm via Haar cascade classifier with three additional classifiers”, 13th IEEE International Conference on
Electronic Measurement & Instruments, pp. 01-03, 2017.
[6] S L Suma, Sarika Raga. “Real Time Face Recognition of Human Faces by using LBPH and Viola Jones Algorithm.”, International Journal of Scientific
Research in Computer Science and Engineering, Vol.6, Issue.5, pp.01- 03, Oct. 2018.

©IJRASET: All Rights are Reserved 145

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy