Security System to Prevent Tailgating Using Face Recognition and Ultrasonic Sensor

Tailgating is the one where an employee holds the office door for others to enter into the building with one access. This leads to insecure where in the unknown person can also enters into the building with the access of the original employee. To overcome this, introducing security system that prevents tailgating that provides authentication, accuracy, flexibility and gives more convenience to the security guards. It is an embedded based system and built under the Linux environment. First the faces of all the people is captured and trained using OpenCV python package for the purpose of further experimentation in the future. In this Raspberry pi is used as a main controller along with camera which enables to access image processing with any portable embedded system. When the person enters near to the gate, the ultrasonic sensor starts to sense and triggers the camera which detects the person face and checks with the trained dataset using the Haar Cascading algorithm, if it matches the gate gets opened. If suppose the person enters the gate with other person with one access control, then again, the camera gets triggered to capture the unauthorized person face and sends the mail of the detected person to the concerned authority through firebase cloud database.


Introduction
The purpose of the security system is mainly to avoid malpractices or any other form of actions against security. In early times, a person needs to be available for all the time to monitor the in and out entries of all the employees or unknown person. In this if that person is not available there may be a chance for the unknown person to enter into the restricted area. So, this can lead to many problems. Later time this is enhanced by introducing some biometric actions like fingerprint, face recognition, Iris recognition for monitoring. This has reduced the man power and improved some sort of security. This is implemented in many places like office, banks, and private places. Other than this biometric many electronic accesses control is available nowadays RFID tags, etc. But here there may arise disadvantage like one person can take the access card of another person who is authorised and enter into the building, where in biometric this will not happen but sometimes tailgating may occur. This is a embedded face recognition system which can be used in any places. The entering persons face is recognized and detected based on the trained datasets in database the door will open, otherwise if the unauthorized and persons face is detected the door remains closed. If suppose the unauthorized person goes along with access person the second level of authentication takes place here. The camera captures the image of the unauthorized person and sends that image to the concerned mail.

Existing System
In the Existing Recognition based system, the fingerprint-based system is used for the in and out entry for the office and for secure authentication. The problem with this system is one can able to duplicate the fingerprint of the other and get the access which might cause a problem. Then comes the RFID (Radio Frequency Identification) based system where the access card (ID) can be stolen to get the access. Next level of Biometric system is Face Recognition and detection system. Here the face features of the person are detected and recognized and they can get the access. In this one can't able to do any duplication because each and every person's face features are unique like distance between their mouth and nose etc. Traditionally face recognition is developed by PCA and other facial features. The disadvantage of the existing system is that tailgating is the major issue. Then the Security problem arises by allowing the unauthorized person. The outcome of the existing system gives no Satisfactory results.

Proposed System
In the proposed system, two level of authentication is provided which helps to prevent malpractice. First level of authentication is outside the door and Second level of authentication is inside the door. Only the authenticated person is allowed to move in. Otherwise the second level authentication takes place if more than one person enters with one access control. Here the Firebase cloud database is used to store the captured images and directly sends mail to the concerned authority person. This helps the authority to monitor all the activities which takes place in offices or in private places. If the unknown person enters the door remains closed. This provides accuracy, convenience and flexibility. In the proposed system, it can overcome tailgating problem which is monitored and avoided. Another advantage is unauthorized person images can be viewed in the mail instantly. This system reduces the malpractice and in turn the processing time.

Explanation
The main working principle of the proposed system is that the camera captures the person once the ultrasonic sensor detects the minimum distance of the person. Then it detects and recognises the captured face, checks with the database, if suppose there is a mismatch it sends the mail to the concerned person. It is built in python programming language in Linux operating system. The 10 X Digital Camera, Raspberry pi, servo motor, HC-SR04 Ultrasonic sensor are used. For the storage purpose, Firebase cloud database is used.

Camera Triggering Phase
In this phase, the ultrasonic sensor (HC-SR04) is used which has 4 pin configuration that is Vcc, Trigger, Echo and ground. This sensor is used to measure the distance or sensing object. This sensor is measured using the formula,

DISTANCE= SPEED X TIME
The sensor is connected with the microcontroller in the raspberry pi. Vcc and ground pin is used to give the power supply, trigger and the echo pin is used as input and output to the microcontroller. This ultrasonic sensor triggers the camera when the general threshold reaches, for example 2 -450 cm. Servo motor is used as a prototype for the door which is an electrical device that can rotate 0 to 180 degree which indicates the door opening and closing.

Capture and Training the Image
In this, the faces of all the employees in the office is captured by the camera using OpenCV python package and it is trained and stored as a dataset for the future experimentation.

Face Detection and Recognition
In this once the camera is triggered the object is detected and recognized, if it matches with the trained dataset the door gets open otherwise it remains closed. If more than one person enters with one access control then inside camera gets activated for second level of authentication. The camera will get triggered only when it's needed, it reduces the power consumption. Face Recognition package is used here. Haar Cascading algorithm is a machine learning algorithm used to detect the face features. It analyses the image features by using square by functions.

Database and Mail Service
Once the image gets recognized, the unauthenticated or an unknown person images stored in the firebase cloud database, from the database the captured image of the unknown person is sent to the concerned authority through the mail service.

Experimental Results
The application contains the camera triggering modules to capture the image with the help of ultrasonic sensor.

Conclusion and Future Enhancement
In this paper the security system is implemented that prevent tailgating. This can be implemented in attendance system and also in any other system. This security system is capable of handling many different situations have been implemented successfully. In future enhancement the person carrying another person can be resolved using this system also and improve the accuracy level. There are several benefits for implementing this system on an embedded system that is affordability-based control unit can lower do the cost for the whole security system, operating cost also be reduced due to processor low power consumption.