Visitor/Intruder Monitoring System using Haar-cascade Classifier Algorithm

- Home security system plays a predominant role in the modern era. The purpose of the security systems is to protect the members of the family from intruders. The main idea behind this system is to provide security for residential areas. In today’s world securing our home takes a major role in the society. Surveillance from home to huge industries, plays a significant role in the fulfilment of our security. There are many machine learning algorithms for home security system but Haar-cascade classifier algorithm gives a better result when compared with other machine learning algorithm This system implements a face recognition and face detection using Haar-cascade classifier algorithm, OpenCV libraries are used for training and testing of the face detection process. In future, face recognition will be everywhere in the world. Face recognition is creating a magic in every field with its advanced technology. Visitor/Intruder monitoring system using Machine Learning is used to monitor the person and find whether the person is a known or unknown person from the captured picture. Here LBPH (Local Binary Pattern Histogram) Face Recognizer is used. After capturing the image, it is compared with the available dataset then their respective name and picture is sent to the specified email to alert the owner.


Introduction
Modern digital home security systems are very efficient in tracking intrusion. In the today's world, everyone prefers to go for job's and at the same time they are sure about the home security. Detection and recognition of objects become most important in image processing [1]. Studies have shown that simply by having a security system, your home is much less likely to be targeted by intruders. There are many systems that exists in the machine learning projects for home security system. Each one differs and stands unique in its technology. This is more like the door security system but not exactly it. Each system has its own advantage. One of the advantages of the system is to reduce cost and the time. The main objective of this paper is to secure the home from any intruders, thieves to avoid any theft [2]. With the help of the monitoring system the owner can easily identify the person who visit their home even when they are out of station. In Machine Learning algorithm, this is employed with Raspberry pi and a web camera. Haar-cascade classifier algorithm is used for recognition and detection of the human face [3]. Machine Learning Algorithms are used for the maximum accuracy of identifying the image and producing the accurate result. This system allows the Owners of the home to monitor the visitors or some intruders when they are front of their home and can be able to see the person's face through the g-mail. This system will help the owner to identifying the person/intruders easily within the short time. To make advancement in this system one can use deep learning algorithms [4]. Since it is a home security system, Machine learning algorithms are more enough to get a better result within a short span of time.

Machine Learning
Machine Learning is undeniably one of the most influential and powerful technologies in today's world. Machine learning a study of algorithms and statistical models that computer systems use to perform a specific task without using explicit instructions. Machine learning algorithms build a mathematical model based on sample data, known as training data, in order to make predictions or decisions without being explicitly programmed to perform the task [5]. Machine learning focuses on making predictions using computer. The future in the areas of Machine Learning are unpredictable. This Algorithms can exceed the human assumption in the near future. Machine Learning is of types, Supervised learning, Unsupervised learning, Reinforcement learning,

Machine Learning in Home Security
Machine Learning in the field of home security is enabling the home automation and reducing the human interaction. This will make the home as a secure. There are numerous ML applications in the home security system such as collecting data of family members, relatives, often visiting persons [6]. This data can be used to automate the process with maximum accuracy and to improve the quality of the outcome. Machine learning concepts plays a major role in the home security system in this modern day. The simple concept behind the home security system is monitoring in the entry point into the house with a web camera. In Machine Learning, with the help of minimum interaction of human, the result can be found easily and properly. With the help of Security system, one can reduce the number of crimes happening in our home. This system will provide a detail note more than the person guarding our home.

Overview of the proposed method
The block diagram and the details of the proposed visitor/intruder monitoring system using Haar-cascade is presented here. The main aim is to design and develop a monitoring system using Machine Learning to protect our home from intruders and view the visitors who visit our  [7]. With the help of this system the owner can monitor his/her house even when they are out of house. Figure 1 represents the flow of the visitor / intruder alert system.

Haar-Cascade Classifier Algorithm
Haar-cascade is a machine learning object algorithm used to identify objects in an image or video [8]. It is a machine learning based approach where a cascade function is trained from a lot of positive and negative images [9]. OpenCV allow one to create our own classifier that are used to detect other objects with the help of training the created classifier [10]. A Haar feature mainly considers the adjacent rectangular regions at a selected location during a detection window, and then sums up the pixel intensities in each region and calculates the difference between these sums. The cascade classifier consists of a set of stages, where each stage is an ensemble of weak learners. The weak learners are simple classifiers called decision stumps. Each stage is trained employing a technique called boosting. Boosting provides the power to coach a highly accurate classifier by taking a weighted average of the choices made by the weak learners [11].
The region defined by the present location of the window is labelled by each stage of the classifier as either positive or negative. The value positive indicates that an object was found and negative value indicates no objects were found. If the label is negative, the classification of this region is complete, and therefore the detector slides the window to next subsequent location. If the label is positive, the classifier passes the region to subsequent stage [12]. When the ultimate stage classifies the region as positive, the detector reports an object found at the present window location. The stages are designed in such a way to reject negative samples as fast as possible. The idea is that the overwhelming majority of windows does not contain the thing of interest. Conversely, true positives are rare and taking more time to verify. It is then used to detect objects in other images. This system mainly has three process: 1.Creating the dataset.
2.Training the model.

3.Recognizing the face.
Creating the dataset Here, the frontal face recognition is used to identify the human face. The image of a single person's face is captured. A single person's face is captured n number of times in front side, side angle. We can add our frequently visiting person to our house in the dataset. The captured image is converted to grey scale and the size of image is converted to small picture and stored in the dataset. Recognizing the face After training the model, the captured image is compared with the dataset [13]. After comparing, if the image is in the dataset, then the name of the person is sent to the owner's email. If the person is not in the dataset, then the person's image is sent to the owner's mail. From the email, he/she can able to identify the person who visit their home.
With the help of this system, one can reduce the time and it's cost efficient.

Components
The hardware requirements for this system includes-1.Raspberry pi 2.Web camera

Raspberry pi
The main component of the project is Raspberry pi. The Raspberry pi is a low cost, credit -card sized computer that plugs into a computer monitor or TV developed by raspberry pi foundation. In the Raspberry pi an SD card is inserted into the slot on the board acts as the hard drive. It is powered by powered by USB and the video output can be hooked up to a traditional TV set, a more modern monitor, or even a TV using the HDMI port. The model used here is Raspberry pi 3 B+. Raspbian OS is installed in the SD card. In this model the raspberry pi is connected to the web camera through port 0 of Raspberry pi [14].

Web camera
A Web Camera plays an important role in face detection and face recognition. It is a video camera that feeds or streams an image or video in real time to or through a computer to a computer network, such as the internet. In Raspberry pi, the standard USB web camera is used to take pictures and video. The web camera used here is zebronics Crystal Plus Web camera. The reason for choosing this web camera is even when the surrounding is dark. we can on the light in the web camera, it makes the face even more clear. Using the Haar-cascade Algorithm, when the motion is detected, the webcam will capture the picture with high resolution.

Results and Discussions
Using Haar-cascade algorithm, the dataset for housemates is created by capturing n no of images of each person, the model is trained and the faces are detected and recognized. If the webcam captured face is matched with the dataset face, then an email is sent to the owner of the house indicating the name and their image . If the captured picture is not in the dataset, then the email is sent to owner as describing unknown with their image. Pseudocode of face recognition.
• Creating a function for known person detected, if person is known sent mail to the specified mail id as subject "their name" has arrived and add the captured image. • Else sent a mail to specified person as "Unknown intruder detection" and add the captured image. When the motion is detected, the image is captured and compared with the dataset and the image is matched with the dataset, then their name will be mentioned in the email along with their image or if the image is not matched with the dataset, then the intruder image is sent along with notification as unknown intruder detected. We can also add our frequently visiting relatives to our dataset by adding their image to the dataset, so that the owner need not able to worry about the known visitors. OpenCV works good in grey scale more than the coloured images. As shown in Table 1, the image will be resized as the face will be in the middle of the image or else it will be cropped and failed to recognize the person. Final outcome with image as mentioned "unknown person" (Unknown intruder).
The Owner can monitor the house with the help of the email image. It updates about the motion in the front of the house and informs through email . The reason for choosing email is nowadays everyone has their own email id with a protected password, where they can only access the email.
The Person in the picture is one among the house, when this person arrives in front of the house, the camera captures the image and compared with the dataset [15]. When comparing is done, the result is found as the image matched with the dataset that are created. So, along with the image their name is sent to owner through email.
When the captured image is not matched with the already created dataset, then the intruder's image is sent to the owner as Unknown intruder detected [16].