Face Recognition Door Lock System Using Raspberry Pi
Face Recognition Door Lock System Using Raspberry Pi
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
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.
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.
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.
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.
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.
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.
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:
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.
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.
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.
Fig. 11 Training Faces Fig. 12 All faces in the dataset are trained.
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.