{'fraction_non_alphanumeric': 0.02646593799408813, 'fraction_numerical': 0.006805526912765519, 'mean_word_length': 4.656298600311042, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Smart System for Detecting the Entry of Authority People in the Security Facilities Based IoT using SURF Recognition and Viola-Jones Algorithms

Modern security systems are beginning using advanced technologies to detect any security breaches via a combination of devices, programming methods and notify security personnel of monitoring of any security breach, starting with people entering the building, ending with monitor the electronic archive in computers, monitor employees-customers calls, and banking accounts. Which consists of two stages, as the first stage relates to building an Arduino system to detect employees entering the building using the Arduino UNO, passive infrared sensor (PIR) hardware then requesting from the employee to go to the security audit platform to compare the face image with the database images using the viola-jones algorithm facial recognition program based on SURF algorithm. If the image is identical, he is allowed to enter and if the face image does not match the set of images in data set, he is asked to wait in the queries office. Also, the system can send all data to the central security authority with the date and times of entry for persons through the WhatsApp using Twilio IoT application.


Introduction
Community security and protecting individuals, institutions and their property from all strangers has become a renewed mission every day from the tasks of companies specialized in security and protection in establishing expert systems, with the requirements of the real-time activity recognition system, these systems are very smart technologies to contribute to security specialties and benefit from the Internet of Things technologies. Internet of Things (IoT) is interactive systems at the level of internal or external devices, supports the integration, analysis and transmission of data over the various wired and wireless communication media that have been created. And find solutions to conceptual and technological challenges to address them [1]. Motion sensors are currently important technologies used in many engineering, medical and civil applications in all aspects of life for their ability to detect the movement of objects through infrared emitted from them, this feature can be used and connected to any other system to control all devices and tools used, these sensors are characterized by a cost low and low energy. The motion sensor and Arduino fields give strong technology when used together. Arduino is an open-source system [2,3], which is a mixture of hardware and software that has been used to create projects that interact with the physical world in easily [4]. Face recognition is used in the most vital areas of research in computer vision, machine recognition, psychology, and neuroscience, and it is a very important field used in the safety system in criminal recognition, as well as health care, advertising, airports, etc. [5]. There are many facial detection algorithms; Viola-Jones object detection framework provides fast technologies and is the best one most common methods for face detection [6] and SURF algorithm depend and gives many advantages at every stage, as the analysis shows it is fast, the speeded up robust features (SURF) is good for rounded and blurry images, but not much good for dealing with visibility changes and fluorescence changes and based on Viola-Jones algorithm. Real-time detection is accomplished by analysing pixels in images for the full front face. The limitations relate to the situation, or if there are things blocking parts of the face or slight tilt of the head [7]. In this paper, a real-time system model was developed in collaboration with Viola Jones' facial recognition algorithm.

Related work
There are many researches that dealt with designing alarm systems. Some of these working are referred: Nosiri O.C.and his colleagues in (2018) design a security system using Passive Infrared sensor, Raspberry Pi and integration of cameras in the web application. It developed to send the video to a web server which enables the homeowner to access to videos using a web application [8]. Siti Syaidatul Syazlina Mohd Soleh and others in (2019) building a system that prevents intruders from opening a home without approval. They used an Arduino and Passive infrared sensor (PIR) to detect such movements. Microcontroller is used to process data and if the movement occurs, it will be send an alarm message via Wi-Fi module to the smartphone application, also it can inform the user to stop alarm or not, the application, Wi-Fi module is used to connect between the application and smart phone [9]. A group of researchers at the University of Kufa (UoK) (2019) designed a system to automatically monitor to detect any suspicious activities inside Kufa University. They used servo motor connected via a passive infrared sensor to rotate the camera 360 degrees to the direction of the active sensor and transfer a signal to Arduino which transmits live video to the laptop, tablet or a smartphone to track the movement of people as they pass through these sensors. Fritzing software is used to simulate the test and design the circuits of the system [10]. Anju P, Midhuna S., Nasiya Y S., Vince P. in (2019) they designed a system to achieve home security by sending a message to the homeowner about any intruder standing in front of the house depending on the Passive Infrared (PIR) which is connected to the Raspberry and ATmega 328 microcontroller to detect and send a message to the homeowner to see the person through a webcam on smart phone web page , homeowner accesses the video directly using the static IP address and the alarm message will be sent via internet [11]. Zoltán B and et. al. in (2019) they designed a smart face recognition and motion detection system intended for use at home or in the largest online systems. In this system, they use a computer, Raspberry Pi 3, as well as an application that can recognize faces and detect movement. The output is stored in dropbox storage, for further processing or archiving and tracking of spatial activity of people or animals. To detect movement, two programs were created. The first program (detektor_ pohybu.py) and when he realizes a motion creates an image and stores it in a folder, 3 and the second program (monitorovaci_system.py) uses the OpenCV library to collect and recognize images for decision making [12].

System Design Structure
The proposed system consists of two parts, the first part is motion detection part (MDP), and the second part is face recognition part (FRP).

A. Motion Detection Part (MDP)
The first section in this stage is to detecting the movement of any person who intends to enter the security organization through the motion sensor (PIR ) which connected to a microcontroller Arduino, if the sensor is motion-sensitive meaning it is ready to read and detect any movement of employees of the organization within a range of approximately 4-7 meters, it will be sent an analog signal to Arduino and send its data via serial port to PC to issue a call through the computer," please go to the inspection platform take a picture", that is programmed in C Sharp language, also in this part, the time and the date of the arrival person are saved in a cloud database for comparing the number of authorized persons and numbers who are wanted to entire to an organization. Furthermore, a notification message sends to WhatsApp of an administrator. Figure 1 illustrates this part of the proposed system.

B. Face Recognition Part (FRP)
After a security alert occurs, the person is called to the image acquisition platform for the security investigation. A portrait of the face is taken and compared to the personal image stored in the database that is allowed to pass depending on the image recognition program Viola-Jones algorithm. Figure 2 illustrates this part.

Hardware design
Arduino is an open-source control system [13,14]. Arduino is powered by an adapter circuit from DC to AC a 5-V. [15] and is often connected via a computer USB cable. It has its own programming language. This device contains 6 analog input pins and 14 digital input or output pins for input and output signals to the computer or other devices connected to it to control it and this is one of the types of a microcontroller [16]. Figure 3 show the circuit design of the first part using Proutes simulation program. In this circuit, Arduino receives the signal from PIR sensor which gives zero when no motion detection and one when a motion detects. Figure 4 shows the flow chart of the system. It gives the basic idea about how the system works. First of the initialization of the system, and it read sensor data, if the system in normal state, it will be re-read the sensor data. If the system is not in normal state then a motion detects. Then it sends a voice message to the person, send notification to WhatsApp, and store all the information of the person on a cloud data base. After that, the picture will be taken to the person and apply the Viola Jones algorithm. At last the person checked if he is in authorizes people or not to give decision on pass or not.

Viola-Jones Facial & SURF Recognition Algorithms in Proposed System
In the proposed system divided this algorithm in to two parts, first for cropping face detecting to store in folder and the second part for make decision to allow for the person to pass or reject after matching the pictures using VIOLA-JONES algorithm. Viola-Jones algorithm is one of the best face detection algorithms, which features a high detection rate, low error rate, and fast calculation time [17, 18,19 ]. Viola Jones's algorithm is often built in three or four stages, at most 1-A simple rectangle called Haar features. 2. Conduct image integration to quickly detect shapes or faces 3. Use the AdaBoost machine-learning theory. 4. Facial assembly (mouth-to-mouth nose) to create an image using a cascaded classifier.
The create a square wavelet consisting of pairs of adjacent rectangles, each in black and white. Haar is calculated in each rectangle by subtracting the sum of the pixel values in the black areas from the sum of the pixel values in the white areas and dividing them by the pixel sum's in the two regions, if the result of the difference is higher than the limit that is determined during the AdaBoost machinelearning theory [20], this part is part of the face and tends to search For the remaining parts, using integration means adding small parts together, in which case the smaller parts are pixel values. The integral values for each pixel are the sum of all pixels that are located above it.
It begins by moving the search box (which contains Haar rectangles) from the top left of the image and executes Haar rectangles on each pixel in the box in search of the person's face, then moves the box to the right and continues until it reaches the end of the right part, then the box moves down and continues line after line on Each image has a specific square size, The size of the square increases and the search process restores the entire image again and continues to enlarge the box and implement HaaR rectangles on each pixel in the square until the last time the square equals the image size until all faces in the image are discovered, no matter how big the difference is the size of a person's head. In figure 6 show the value of pixel in position 3 is (A + C), the value of pixel in position 2 is (A + B) the value of pixel in position 1 in (A) that mean the pixel in position 4 is the sum of (A + B + C + D). The process is summarized in this equation: (x4, y4) -(x2, y2) -(x3, y3) + (x1, y1).

Fig (5) Using the integration method
SURF algorithm is a patented local feature detector and descriptor. It can be used for tasks such as object recognition, image registration, classification, or 3D reconstruction. SURF algorithm is Similar to scale-invariant feature transform (SIFT) algorithm, it depend on the scale space theory. and primarily applied to Determinant of Hessian, the extraction the highlights points in the image are realized by rounding and simplifying [21]. To detect interest points, SURF uses an integer approximation of the determinant of Hessian blob detector, which can be computed with 3 integer operations using a precomputed integral image. Its feature descriptor is based on the sum of the Haar wavelet response around the point of interest. These can also be computed with the aid of the integral image.

Algorithm (I): Database creation
Input: the image (Ii), where i=1,2,…,n, (for everyone who is allowed to enter the building, take five camera shots for each one to build database). Output folder (Ffaces) contains only faces target of all input images. Create a compressed: Start algorithm: 1. Open loop for i=1 to n. I Algorithm ( i=1,2,…,n, (for everyone who is allowed to enter the building, take five camera shots).
The DB

Results with Case Study
The proposed system was tested on a group of employees where the fig. (8) shows the messages sent to the security center on WhatsApp application when someone wanted to entering the facility. All data which include the number of employees, date, and time, is saved on a cloud database by twillio IOT application. This technology allows the security observer to know the number of people present in the facility in addition to the date and time of each arrival. Fig. (9) shows a curve for the numbers that arrived and that came out effectively and can be adopted in the workforce division of the organization.

Conclusion
In this paper, an IOT security system is design. Our propose system consist of two parts. Motion Detection Part (MDP) and Face Recognition Part (FRP) , the first part includes Arduino and PIR sensor which used for detecting any person wanted to enter to the facility, the second part is Face Recognition Part (FRP) which used a Viola-Jones Facial and SURF Recognition algorithms to detect and recognize between authorized and unauthorized persons from entering the facility. This system is characterized by its ease of use, low cost, and quality in terms of security. Several results can be extracted from the information obtained from the system in addition to high accuracy in the comparison process for the photos of people who are allowed to enter the organization. The cost of devices and equipment is relatively simple with other systems. The recommended will explore other feature extraction and classification method to improve the accuracy of people detection.