AWS EC2 based Home Security System using Face Recognition

Download Full-Text PDF Cite this Publication

Text Only Version

AWS EC2 based Home Security System using Face Recognition

Shambhavi V. Chippa1, Dr. R. R. Dube2

1Master of Engineering Student, Dept. of Electronics Engineering, W.I.T. Solapur

2Ph.D. Professor, Dept. of Electronics Engineering, W.I.T. Solapur

AbstractThe smart security system has become indispensable in modern daily life. The proposed security system has been developed to prevent a robbery in highly secure areas like home environment with AWS EC2 which provides the recognition on AWS. The security of home is implemented by using face recognition technology, which grants access to only authorized people to enter that area.

In this paper, the proposed system is introduced where an attempt is made for classification of the faces and recognize and send message to WhatsApp and maintain the records with log file.

Keywords Face recognition, face recognition algorithms, face detection, AWS.


    Face recognition is a difficult task in video and does not give the accuracy. Face recognition with higher accuracy can be achieved with proper training of faces considering the environmental effects like brightness of light, darkness, various angles of persons face etc. Face recognition is achieved with suitable algorithms like haar , LBP, detect multiscale etc. can be used to achieve the recognition.

    An efficient and accurate home security system which is based on face recognition is very important for a wide range of security application. Security is an important aspect or feature in the smart home applications. Most of the countries are gradually adopting smart door security system. The most important major part of any door security systems is identifying accurately the persons who enter through the door. Face recognition is probably the most natural way to perform authentication between human beings. Additionally, it is the most popular biometric authentication trait, after fingerprint technology.

    In this paper we initially detect the face from the video with suitable algorithm, the key problem as Human Faces Classification in the video. In that, we can use the haar , LBP algorithm for detecting the faces and extracting the features from the face.

    The difficulty of finding faces can be viewed as a segmentation problem in machine vision or as a detection problem in pattern recognition. It refers to the identification of all regions in the scene that contains a human face. The image processing steps for the facial recognition process can be divided into stages shown in figure 1.

    Figure 1:- Face Recognition Process

    Face recognition is an enrolment process where the unique features of a persons face will be stored in a database. At the time of image obtained from the camera will be compared with the previously stored faces captured at the time of enrolment for the identification and verification process.


    Xiang-Yu L et al. [1] proposed a face recognition system based on gradient direction histogram (HOG) features extraction and fast principal component analysis (PCA) algorithm [2]. The Haar-feature classifier is used to extract the background interference data and then the HOG features are extracted from the image data. The PCA algorithm is used to extract the main feature components of the data. The Support Vector and not as an independent document. Please do not revise any of the current designations. Machines (SVM) algorithm is used to recognize the face.

    Timo Ahonen et al. Presents an efficient facial image representation based on local binary pattern (LBP) [3][4] texture features. The face image is divided into several regions from which the LBP feature distributions are extracted and concatenated into an enhanced feature vector to be used as a face descriptor. The invariance to monotonic gray-level changes and computational efficiency, make LBP, suitable for demanding image analysis tasks. The LBP can use the texture descriptor to build several local descriptions of the face and combining them into a global description which can be used for face recognition.

    B. Udaya Kumar and et al. present the implementation of a low-cost wireless home security system using ZigBee protocol and remote access through the internet [6]. A ZigBee based star network with two nodes had been established employing Xbee radio, ARM7, PIC, and MBED

    microcontroller. The detection of the intruder motion, gas leakage detection and visual surveillance of the home were provided with the help of Passive Infrared Sensor (PIR), Gas sensor (GH-312) and Camera (LS_Y201). Problem is here multiple microcontrollers are used, usage of ZigBee based network to communicate with the base station is limited to 100-150 meters long distance only. The base station is dependent on the only Ethernet for internet connectivity.

    Francisco et al. [5] in used another statistical technique known as LBA (local binary algorithm) and weighted mask, which is based upon the local or feature-based approach of face recognition. In this system, they extracted facial features such as nose, eyes, and mouth, etc. Face recognition was done by local binary patterns were used to build up the masks through which the areas to be matched were separated. These masks were then applied techniques of data mining, from which weighted masks were got. These weighted masks show that the grayest area had more significance to recognize the face which focuses upon the main features of the face such as the nose, eyes, lips, cheeks, and forehead, etc.

    1. Shankar Kartik et al. [7] Have proposed two systems are proposed, one is based on GSM technology and other uses a web camera to detect the intruder. The first security system uses a web camera, installed in house premises, which is operated by software installed on the PC and it uses the Internet for communication. The camera detects motion of any intruder in front of the camera dimensions or camera range. The software communicates to the intended user via Internet network and at the same time, it gives sound alert. The second security system is SMS based and uses GSM technology to send SMS to the owner [9].

      Mae .Y and et al.[8] presented the system; it monitors everything by moving cameras. The system can increase the efficiency of monitoring and can eliminate the blind spots of fixed cameras. In this system, a mobile manipulator is developed which is equipped with cameras at the arm end for monitoring [6].


    Implementation of home security using Face Recognition This project work proposes an idea of for face recognition concept for security of home and it implemented with the help of Open CV which is a popular computer vision library. Face recognition is an important application of image processing owing to its use in many fields. An effective face recognition system based on Open CV is developed in the project. Face recognition has been the best choice after the problem of biometrics and it has various type of applications in our present life. An efficient face recognition system can be of great help in forensic sciences, identification for law enforcement, authentication for banking and security system, and giving preferential access to authorized users i.e. access control for secure areas, etc.

    A real-time home security system by the face recognition system is presented in the project.

      1. User

      2. Admin

    1. Frame Extraction / Live Camera:

      User uploads video/grabs images using the live camera on the application, the application then extracts frames from the video. These frmes are saved on the local machine. Frames are usually 640×480 formats.

      Figure 2. Structural Design

    2. Face Detection:

      Apply the Haar cascade Classifier for the face detection in images.

    3. Pre-Processing on images:

    Once we get the faces to apply the preprocessing on images like noise removal, normalization, etc.

    1. RGB to Gray Scale Image:

      Convert the image into the Gray scale by taking the average of each pixel RGB.

    2. Local Binary Patterns Histograms:

      1. Divide the examined window into cells (e.g. 16×16 pixels for each cell).

        For each pixel in a cell, compare the pixel to each of its 8 neighbors (on it's left-top, left-middle, left-bottom, right-top, etc.). Follow the pixels along a circle, i.e. clockwise or counterclockwise.

      2. Where the center pixel's value is greater than the neighbor's value, write "0". Otherwise, write "1". This gives an 8-digit binary number (which is usually converted to decimal for convenience).

      3. Compute the histogram, over the cell, of the frequency of each "number" occurring (i.e., each combination of which pixels are smaller and which are greater than the center). This histogram can be seen as a 256-dimensional feature vector.

    1. Optionally normalize the histogram.

    2. Concatenate (normalized) histograms of all cells. This gives a feature vector for the entire window.

    3. The feature set is then saved to a model for later matching process.

    4. Face Recognition on AWS and Record-Keeping:

    Amazon Elastic Compute Cloud, which allows users to have at their disposal a virtual cluster of computers, available all the time, through the Internet. AWS's version of virtual computers emulate most of the attributes of a real computer including, hardware central processing units (CPUs).

    AWS allows multiple local host with only one server and results can be send to their respective destination. In the purposed system co]mparison of stored features and live face features is carried on Linux server, and the results are send to WhatsApp and to local machine. By applying algorithm of LBP facial features we can identify the face of the user. After identification of the person, the message is send to WhatsApp and maintain records in log file.


    1. Haar cascade Classifier for Face Detection:

      In this system we used Haar classifier algorithm for face detection when one of these features is found, the algorithm allows the face candidate to pass to the next stage of detection. A face candidate is a rectangular section of the original image called a sub-window. Generally, these sub- windows have a fixed size (typically 24×24 pixels). This Sub- window is often scaled in order to obtain a variety of different size faces. The algorithm scans the entire image with this window and denotes each respective section a face candidate. The algorithm uses an integral image in order to process Haar features of a face candidate in constant time. It uses a cascade of stages which is used to eliminate non-face candidates quickly. Each stage consists of many different Haar features. Each feature is classified by a Haar feature classifier. The Haar feature classifiers generate an output which can then be provided to the stage comparator. The stage comparator sums the outputs of the Haar feature classifiers and compares this value with a stage threshold to determine if the stage should be passed. If all stages are passed the face candidate is concluded to be a face.

      1. Haar Feature Classifier

        A Haar feature classifier uses the rectangle integral to calculate the value of a feature. The Haar feature classifier multiplies the weight of each rectangle by its area and the results are added together. Several Haar feature classifiers compose a stage. A stage comparator sums all the Haar feature classifier results in a stage and compares this summation with a stage threshold. Each stage does not have a set number of Haar features. Depending on the parameters of the training data individual stages can have a varying number of Haar features.

      2. Haar Features:

        Haar features are composed of either two or three rectangles. Face candidates are scanned and searched for Haar features of the current stage. Each Haar feature has a value that is calculated by taking the area of each rectangle, multiplying each by their respective weights, and then summing the results.

    2. Local Binary Patterns Histograms:

    The LBP feature vector, in its simplest form, is created in the following manner:

    1. Divide the examined window into cells (e.g. 16×16 pixels for each cell).

    2. For each pixel in a cell, compare the pixel to each of its 8 neighbors (on it's left-top, left-middle, left-bottom, right-top,

    etc.). Follow the pixels along a circle, i.e. clockwise or counterclockwise.

    1. Where the center pixel's value is greater than the neighbor's value, write "0". Otherwise, write "1". This gives an 8-digit binary number (which is usually converted to decimal for convenience).

    2. Compute the histogram, over the cell, of the frequency of each "number" occurring (i.e., each combination of which pixels are smaller and which are greater than the center). This histogram can be seen as a 256-dimensional feature vector.

    3. Optionally normalize the histogram.

    4. Concatenate (normalized) histograms of all cells. This gives a feature vector for the entire window.

      The feature vector can now be processed using the Support vector machine, extreme learning machines, or some other machine-learning algorithm to classify images. Such classifiers can be used for face recognition or texture analysis.


Here we used the real time dataset of 200 images. C1, C2, C3, C4 are the classes, where we are considering 200 images of each class for face recognition. The confusion matrix is generated using WEKA tool for different classes are given in table I.


The accuracy and precision is calculated based on TP, TN, FP and FN i.e. Truly Positive, True Negative, False Positive and False Negative images. False positives, which are items incorrectly labeled as belonging to the class and false negatives, which are items which were not labeled as belonging to the positive class but should have been. The true positive, false positive and false negative images from each user are given in below table.


The precision is calculated using the formula

    • Precision = TP / (TP + FP)

  • Accuracy = (TN + TP) / (TN+TP+FN+FP)

The overall evaluation of the system for face recognition in terms of precision, recall, f score and support is given in below table.


The Class wise distribution of the all images used in the system is given in below gure.

Figure 3: Plot for Class wise Distribution

The class wise graph of f1- score from C1 to C4.

Figure 4: Class Wise f1-score


In this proposed home security system by using a face recognition on AWS Ec2 has been presented. This system has been tested successfully with higher accuracy rate with Haar and LBP algorithm. The accuracy depends on training of faces and environmental conditions.

Face recognition is the most challenging issue in the area of image analysis that has received much attention over the last few decades because of its many applications present in various domains. This paper has made an attempt to review a

significant number of papers to deal with the present development in face recognition in a different field.


  1. Xiang-Yu i and Zhen-Xian Lin, Face Recognition Based on HOG and Fast PCA Algorithm, Springer International Publishing AG 2018,Proceedings of the Fourth Euro-China Conference on Intelligent Data Analysis and Applications, Advances in Intelligent Systems and Computing.

  2. S. E. Handy, S. Lukas, and H. Margaretha, Further tests for face recognition using discrete cosine transform and hidden Markov model, in Proc. International Conference on Electrical Engineering and Informatics (MICEEI), Makasar, 2012

  3. Yueqi Duan, Jiwen Lu, Senior Member, IEEE, Jianjiang Feng, Member, IEEE, and Jie Zhou, Senior Member, IEEE Context- Aware Local Binary Feature Learning for Face Recognition,IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017.

  4. Jiwen Lu, Venice Erin Liong, and Jie ZhouSimultaneous Local Binary Feature Learning and Encoding for Face Recognition.

  5. Sushmitamai K Ahire, Prof.Dr.Nilesh R WankhadeA Survey on Face Recognition using Context -Aware Local Binary Feature Learning Method,International Research Journal of Engineering and Technology (IRJET),Volume: 0, 5 Issue: 1 ,1 Nov 2018.

  6. B. Udaya Kumar, D. S. Murty, Ch. R. Phani Kumar, Implementation of Low Cost Ethernet Based Home Security Using Wireless Sensor Network, Journal published at Algorithms Research, March 2013.

  7. Mae .Y, Sasao .N, INNoue .K, Arai .T, Person Detection by Mobile Manipulator for Monitoring, SICE 2003 Annual Conference, pages-2801-2806.

  8. J. Shankar Kartik, K. Ram Kumar and V.S. Srimadhavan3, SMS Alert and Embedded Network Video Monitoring Terminal, International Journal of Security, Privacy and Trust Management ( IJSPTM), Volume 2, October 2013.

  9. Nidhi Soni, A Review on Face Detection and Recognization Techniques, International Journal of Scientific Research Engineering & Technology (IJSRET), 2017.

  10. Yueqi Duan, Jiwen Lu, , Jianjiang Feng, and Jie Zhou, Context- Aware Local Binary Feature Learning for Face Recognition IEEE 02016.

  11. Li Cuimei1, Qi Zhiliang 2, Jia Nan 2, Wu Jianhua 2* Human face detection algorithm via Haar cascade classifier combined with three additional classifiers, ICEMI2017.

  12. M. V. Ganeswara Rao, Rajesh K. Panakala and A. Mallikarjuna Prasad Recent Advances in Face Detection Techniques: A Survey I J C T A, 2016.

  13. S Hengliang Tang, Yanfeng Sun, Baocai Yin, Yun Ge, Face Recognition Based on Haar LBP Histogram, International Conference on Advanced Computer Theory and Engineering(ICA CTE), 2013.

  14. Baoguang Shi, Xiang Bai, Cong Yao, A Comparative Study between LBP and Haar-like features for Face Detection Using OpenCV, International Conference on Engineering Technology and Technopreneuship (ICE2T)

  15. Chinmaya Kaundanya1, Omkar Pathak2, Akash Nalawade3, Sanket Parode4 Smart Surveillance System using Raspberry Pi and Face Recognition IJARCCE 2017

  16. Paul Viola, Michael Jones, Rapid Object Detection using a Boosted Cascade of Simple Features.

  17. S Madan Lal, Kamlesh Kumar, Rafaqat Hussain Arain, Abdullah Maitlo, Study of Face Recognition Techniques: A Survey. (IJACSA) International Journal of Advanced Computer Science and Applications 2018.

  18. Stefanos Zafeiriou, Cha Zhang, Zhengyou Zhang A Survey on Face Detection in the wild: past, present and future ELSEVIER 2014.

  19. R. Manjunatha1, Dr. R. Nagaraja2 Home Security System and Door Access Control Based on Face Recognition (IRJET) 2017.

  20. Ritika Lohiya, Pooja Shah Face Recognition Techniques: A Survey for Forensic Applications (IJARCET) 2015.

Leave a Reply

Your email address will not be published. Required fields are marked *