Keywords

1 Introduction

In prospective of “security,” there are many options that can be taken into consideration. Few of the various preferred approaches could be biometric password, retina scan, voice enabled and so on in reference with the developing technology. One of the authentication systems is facial recognition system used in most of the modern day industries as well as in developing smart phones and high security regions in industries and cooperate sectors.

Face recognition system is used to recognize certain features of the faces, and by matching the image of the face with the stored model of each individual face stored in the database. Face recognition plays an important role in an security and authentication in day-to-day lives for recognizing the intruders. Along with considering the following trend, we need to chalk out and remove the drawbacks of the existing security system. Face recognition system is more complex due to its unstable characteristics, for example, beards, glasses will show some impact on face detection which can be countered by considering the different angles and multiple images of face of the same person [1].

To make the system more authenticated, the system was integrated with the traditional method of keypad input password which would work hand in hand with the face recognition system to provide two-way authentication that could be more relied upon. The keypad input takes the input from the subject which uses Arduino board to verify the input password with the correct password.

The Arduino board serves as the two-way authenticator. If the subject face is a recognized face stored in a database and the password input by the subject both matches simultaneously, then only the door of this system is unlocked which is indicated by the glowing of green LED, which will indicate that the persons face is stored in the database and password input by them is correct, and hence, two-way authentication is achieved. If any of the condition is not matched, the door will remain unlocked.

The aim for this project is on developing an “real-time face detection module that uses the web camera to view and recognize the individual face using open CV an open-source library for computer vision and machine learning along with the password input authentication from user using keypad and integrate both output to ensure two-way security” [2].

This article is explained through several sections. Section 3 describes about the system analysis of the model. The working model block diagram has been explained in this section. There are various methodologies used in facial recognition. In this, we are using Haar Cascade, LBPH [3] and scale selection. Haar Cascade feature is an machine learning algorithm approach in where a cascading function is trained by a lot of a people and image negatives. It is then used to detect other images. Local binary pattern (LBP) is simple yet very efficient texture operator which labels the pixels of an image by threshing upon the neighborhood of each of the pixel so as to consider the result as a binary number. Now, we have learned about the overview and the methodology in building the module, so we have to now build such model. This model is made using modules like Arduino, keypad, LED and breadboard. These modules have been explained in detail in Sect. 5. Section 5.5 describes about training the model where we have to first create a raw image directory. When the person’s face comes in front of camera, it will detect the person if his/her image is present in the raw image directory else the face will not be recognized. If the face is recognized, then the person has to enter the password using Arduino keypad lock system. If the person enters the correct password, then the door will open else it remains closed. The above algorithm is explained in Arduino keypad lock system in Sect. 6.

2 Overview

This part is concentrated on the problems related to the face recognition. There are several aspects used by the face detection algorithm such as pattern recognition, neural network, deep learning [4]. The face recognition has its application mainly toward the fields of biometric, surveillance system, access control.

The face recognition system problem can be considered as a classification problem as it deals with identifying one or more person in the scene, detecting and mapping the face from data base stored faces. Training the model accordingly with the training sets (faces) of known individual and classify the newly confronted test image to the one of the classes and making the prediction is the main aspects of the face recognition system.

Some of the features that might be seen that cause difficulty to face recognition system which are easily recognizable by humans are the existence of limited memory and some of the other like:

  • Facial expression may change

  • Scaling factor

  • Pose change

  • Occlusion due to obstacles in front, mask, or scarf

  • Illustration change

  • Presence or absence of spectacles, beard, mustache, makeup, etc. [5].

Face recognition algorithm could be categorized in following classes, geometry feature base and image template based. Template method computes the correlations between one or more model template and the faces for estimating the identity of the face. Local facial features and geometric and appearance property are extracted by the feature-based method as the features to identify face.

As a human, we can recognize thousand of faces that comes across us having significance of certain extent. This feature could be used as one of the key feature in the facial detection. Computer used for recognizing face could be confronted to a wide variety of problem that including criminal identification, security systems, image and film processing, but unfortunately building a facial detection system of such context are complex. Eigen face is a face recognition technique which could be used to detect/track the face of the subject and then confirming the person through comparison of characteristics of face of subject to that of faces in database. Euclidean distance is taken into consideration for calculating the distance between nose and eye or distance between forehead and chin. These parameters are matched with the stored database to get accurate result [6].

3 System Analysis

In this, we are using open CV platform to capture the image and matching the image with the images stored in the database. If any image features matches any face in the database, the Arduino1 synchronized with the open CV platform gets high signal and led in the Arduino board is lit indicating the same. Arduino1 now signals the Arduino2 that has been programmed for keypad door lock security to enter the password. If password as entered by person is found to be correct, then the door gets unlocked which is indicated by the conversion of red light to green light, else the door remains locked (Fig. 1).

Fig. 1
figure 1

Block diagram

4 Methodology

In this, we are using Haar Cascade, LBPH and scale selection. Haar Cascade feature is based on cascade classifiers; it can be considered effective for the object detection methods. It is the machine learning algorithm-based approach where a cascade function is trained from a lot of a people and negative images. It is then used to detect other images. LBP (Local binary pattern) is a very simple yet very effective texture operator which labels the pixels of the image by threshing the neighborhood of each pixel to consider the result as a binary number. LBP is then combined to histogram of oriented gradients (HOG) descriptor that helps in improving the detection performance considerably on some of the data sets [7].

LBPH uses four parameters such as: radius, neighbors, grid X, grid Y. The LBPH algorithm will take number of images in different angles and then will use them in the time of recognition. In this, we are using web camera to capture the image and store image in databases. The different individual faces were saved in different folder with their respective names which were then used to train the system and store it into the database. At first, algorithm converts the color image into gray scale image, then it is converted into pixel for detecting images, this will divide images into various pieces, and then it is arranged in a matrix format in order to recognize the new image captured through web camera to that of image stored in database, depending upon different angle and portion of the face (Fig. 2).

Fig. 2
figure 2

Data set of training images

5 Modules

5.1 Arduino Board

The Arduino UNO is an open-source microcontroller based on the Microchip ATmega328P microcontroller and developed by Aruino.cc. It consists of six analog pins (I/O), 14 digital pins that can be used to interface to other boards. The Arduino is programmed with the help of Arduino IDE via a USB cable. Two Arduinos are used in this project, one is programmed for keypad door lock security system and the other one is used for synchronizing with the open CV platform [8].

5.2 Keypad

A keypad is a set of buttons arranged in a “pad” or a block bearing digits, alphabetical letters, symbols. In this project, a (4 × 4) matrix Keypad is used. Keypad is used for the security system of door lock for the purpose of entering password.

5.3 Light Emitting Diode

A light emitting diode (LED) is a semiconductor device that emits light when current flows through it. In this project, two LEDs, green and red, are used to display the output. If the face is recognized by the open CV platform, then the Arduino1 signals the Arduino2 for entering the password. If the password is found to be correct, then the green LEDs glow indicating that the door is unlocked, else red LED continues to glow indicating that the door is locked.

5.4 Breadboard

A breadboard is a solderless device used for testing circuit designs. The components on the breadboard are inserted by their leads or terminals in the holes in the breadboard and then connection is made through wires where appropriate.

5.5 Training the Model

Open CVs open face is core for the face detection module that provides us with features extraction method so as to obtain a low dimensional representations of any faces. Demos/classifier.py is a library represented to show a demo on how this representation can be used, to create a face classifier. Model is used for representation of feature and to train the model for classifying people with the said model. There are distinct featureS that can be used to differentiate people using feature of DNN model.

There are some major ways to train a classifier

  • Using HOG algorithm to create simplified version of the image.

  • Finding the landmarks of face and wrap the image.

  • Use of neural network that is capable of measuring and extracting the features of the image by passing the centered face image.

  • After the generation of features, the use of SVM classifier for recognizing new face (Fig. 3).

Fig. 3
figure 3

(Source Face recognition with MATLAB—Video—MATLAB and Simulink)

Classification and similarity detection

5.6 Create a Classification Model

5.6.1 Creating a Raw Image Directory

Creating a directory for the raw images so that the images of different people can be placed in different subdirectory with their names as the name of subdirectory. Each subdirectory containing certain amount of images of that person.

5.6.2 Prepossessing of Images

The algorithm described above will detect the face from the part of image and will extract the features of given images and align the particular image.

5.6.3 Classification and Generate Model

After extracting the features of each and every input image, model will create representation and label of each image. After generating the representation, it will generate a classification of number of people present in the database. Let us, suppose there are five different people subdirectory in data set, then it will recognize five classifiers present in the classification model.

The test images are put to compare with the images in database after the generation of classifier .pkl file. If the provided image was found in the training set, then the system would recognize the image with confidence. Otherwise it would recognize the image with certain level of confidence (percentage) (Figs. 4 and 5).

Fig. 4
figure 4

Face detected after matching with stored database

Fig. 5
figure 5

Unknown person infront of camera

6 Arduino Keypad Door Lock System

After the face of the person is recognized, the LED pin of the Arduino1 which is synchronized with the open CV platform gets into high state.

6.1 Configuration of Arduino1

The LED of Arduino1 will be high for 25 s.

  1. 1.

    During this short span of 25 s, the Arduino1 will send a signal to Arduino2 to enter the password.

  2. 2.

    If the password is entered during this time interval and if it matches with the password which was preset, then the door will unlock, else the door remain locked.

  3. 3.

    If the password is entered after this interval, then the door will remain unlocked.

The person has to once again go through the process of facial recognition and keypad door lock system.

To enable the Arduino1 to enter the password by the user by giving signal through digital pin no 12 of Arduino1 to analog pin A0 of Arduino2.

6.2 Connection and Reading a Key

The circuit connection for the keypad door lock system is performed on Arduino2 which is clearly depicted in Fig. 6. The connection is done as:

  1. 1.

    The eight pins of the keypad (4 × 4) are connected with the pins ranging from 2–9 on the Arduino.

  2. 2.

    The red and green LEDs are connected on the breadboard.

    1. (i)

      The positive terminals of the green LED are connected with the pin number 13 on the Arduino.

    2. (ii)

      The positive terminal of the red LED is connected with the pin number 11 on the Arduino.

    3. (iii)

      The negative terminal of the green and red LED is connected in series with the 220 Ω resistor which is connected to ground (GND) of the Arduino [9, 10].

Fig. 6
figure 6

Arduino keypad door lock system

6.3 Cases Possible After Entering Password

CASE 1: If the person whose face matches the images stored into the database enters a wrong password by mistake, then red LED continues to glow indicating that the password entered is incorrect and door remains unlocked. The user has to once again go with the process of facial detection and then entering the correct password to unlock after a 10 s lapse. Figure 7 clearly depicts this case.

CASE 2: If the person whose face matches the images stored into the database, then the green LED glows indicating that door is unlocked now. Figure 8 clearly depicts this case.

Fig. 7
figure 7

Wrong password is entered

Fig. 8
figure 8

Password entered is correct

7 Conclusion

In this project, we have used facial recognition system using an open CV platform with the Python as the language. In the facial recognition system, we have stored data set of different persons at different angles, expressions, etc. When a person comes in front of the camera, the camera is used to capture the image, and if the images matches with the stored data base, then the LED pin of Arduino1 gets high and Arduino1 now signals the Arduino2 to allow the user to enter the password. If the password entered is found to be correct, then the door gets unlocked which is indicated by the glowing of green light, else red LED continues to glow indicating that the door is locked. The system is highly reliable as it provides the enough needed flexibility that suits the requirement and its face detection system makes it is more secure. Thus, we have successfully built and implemented a facial recognition-based security system.