0% found this document useful (0 votes)
18 views

An IoT Based House Intruder Detection and Alert Sy

IOT based house

Uploaded by

tusarkantas47
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

An IoT Based House Intruder Detection and Alert Sy

IOT based house

Uploaded by

tusarkantas47
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Journal of Computer Science

Original Research Paper

An IoT based House Intruder Detection and Alert System


using Histogram of Oriented Gradients
Nico Surantha and Wingky R. Wicaksono

Department of Computer Science, BINUS Graduate Program – Master of Computer Science,


Bina Nusantara University, Jl. Kebon Jeruk Raya No 27, Jakarta 11480, Indonesia

Article history Abstract: This research aims to design and implement a home security
Received: 13-02-2019 system with human detection capability. Traditional home security systems,
Revised: 25-05-2019 i.e., Closed-Circuit Television (CCTV) can only capture and record videos
Accepted: 06-08-2019 without the ability of giving warning feedback if there is any suspicious
Corresponding Author:
object. Therefore, an additional object detection and warning method is
Nico Surantha required. The proposed design is implemented using Raspberry Pi 3 and
Department of Computer Arduino, that is connected by USB cable. The PIR sensor is installed on
Science, BINUS Graduate Arduino and webcam is mounted on Raspberry Pi 3. The Raspberry Pi 3 is
Program – Master of Computer used to process inputs from sensors and process images for human
Science, Bina Nusantara detection. PIR sensor detects the movement around the sensor to activate
University, Jl. Kebon Jeruk the webcam to capture a picture. Then, the object recognition is performed
Raya No 27, Jakarta 11480, using Histogram of Oriented Gradients (HOG) and Support Vector
Indonesia Machine (SVM) to detect the suspicious object. If the suspicious object is
Email: [email protected]
detected, then the alarm is activated and sends an email to warn the house
owner about the existence of the intruder. The results show that it takes on
average 2 seconds for the proposed system to detect an intruder and that the
system can successfully detect the intruder with accuracy of 90%.

Keywords: Smart Home, Histogram of Oriented Gradients, PIR Sensor,


Internet of Things, Raspbery Pi

Introduction data without interference or with minimal human


intervention. This technology has been widely used
House is a residential building, an asset, as well as a for smart city application, personal health monitoring,
place to store wealth. Therefore, security becomes one of manufacturing and smart lighting. Some researchers
mandatory considerations in keeping the house from have developed security monitoring system based on
undesirable events or accidents (Eseosa and Promise, IoT concept (Charadva et al., 2014; Chitnis et al.,
2014). The traditional solution for house security is a 2016). They utilize the capability of sensors, e.g.,
Closed-Circuit Television (CCTV). CCTV is a device Passive Infrared (PIR) motion sensor, door open
for monitoring the situation around an office area, house sensor, glass break detector to monitor the occurrence
and building. CCTV is also useful for monitoring the of any suspicious activity. The system is also
situation around a house, both when the residents are at equipped with feedback mechanism which warns the
home and when they are not at home (Bangali and house owner if there is any intruder entering the
Shaligram, 2013). Despite the benefits, there are some house. In general, this technology offers better
problems related to the use of CCTV. Firstly, CCTV protection compared to the traditional CCTV.
does not produce any notification and warning whenever In this paper, an IoT system for monitoring the
it captures any suspicious object. Secondly, CCTV presence of intruders in a house using the combination
streams continuously to capture events that occur in the of motion detection and object recognition is
home environment even when there is no suspicious proposed. The motion detection is performed using
object or activity. Therefore, the streaming requires huge PIR sensor (Ansari et al., 2015; Chuimurkar and
consumption of bandwidth and storage media due to the Bagdi, 2016; Raja et al., 2017) After the motion of
continuous video streaming and storing. object is detected, the web camera takes the picture of
Internet of Things (IoT) is a network of the suspicious spot. The system then performs object
interconnected electronic devices capable of sending recognition by using Histogram of Oriented Gradient

© 2019 Nico Surantha and Wingky R. Wicaksono. This open access article is distributed under a Creative Commons
Attribution (CC-BY) 3.0 license.
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

(HOG) (Dalal and Triggs, 2005) and Supports Vector the sound recording: "Intruder" or "smoke detected"
Machine (SVM) methods. Finally, the system is when there is detection.
expected to recognize the appearance of an intruder Al-qaness et al. (2016) conducted a study entitled
and warn the house owner via alarm and send an "Device-Free Home Intruder Detection and Alarm
email notification. The system is implemented on System Using Wi-Fi Channel State Information". This
Raspberry Pi 3 and Arduino. The evaluation of the study discusses the design of an intruder detection
system includes the measurement of accuracy and system and an alarm system using WiGarde by utilizing
delay of intruder recognition. The system is expected to information from the Channel State (CSI) to detect
recognize the intruder accurately in the shortest time. intruders through a door or window. WiGarde extracts
This paper is an extended version of our previous CSI amplitude information across MIMO antennas. This
published conference proceeding (Surantha and
system is very good because it can avoid the occurrence
Wicaksono, 2018). In this paper, the literature review
of false alarms as it uses the bad stream elimination
and the explanation of HoG in detecting objects are
algorithm. Support Vector Machine (SVM) is used to
extended. More experiments are also conducted to
evaluate the performance of the system. classify human intrusion. The results of this study were
This paper is divided into five sections. Section II compared to CSI-based intruder detection and RSSI-
discusses previous works that have been done by based intruder detection and good results were obtained.
researchers in this field. Section III describes the system The fifth study was conducted by Patidar et al.
design approach. Section IV presents performance (2014) with the title "Real Time Vision Based Security
evaluation results and discussion. Finally, section V System". This study discusses cheap security devices
outlines the conclusions of this research. on the implementation side for detection of changes in
the monitoring area. The tools used in this study are
installed with linux and OpenCV. These tools were
Related Work employed for image processing, GPU and GUI
There have been some previous studies on home libraries. A webcam was used for area monitoring. The
security system. Tanwar et al. (2017) conducted a study webcam is placed 2.5 m above the ground with a 30°C
entitled "An Advanced Internet of Thing based Security camera angle. Therefore, the webcam can get an
Alert System for Smart Home". It describes inexpensive effective distance of about 4 m. The study uses a
home security systems using Infrared (PIR) and Raspberry change detection technique in the monitoring area with
Pi modules to minimize delays during e-mail alerts. image acquisition stages, image segmentation and pre-
Therefore, there are PIR sensors as motion detector and processing image. If there are differences in the
monitoring area, the calculation is done. The test was
Raspberry Pi as its processing module.
carried out by activating the system for 1 h 23 min and
Another research was conducted by Bangali and
a detection rate of 86.11% was obtained. During this
Shaligram (2013) entitled "Design and
time, 72 movements were detected and 10 of them were
Implementation of Security Systems for Smart Home 10 undetected movements. Overall, a detection rate
based on GSM technology". It proposed two methods above 86% at 5-6 frames/sec was obtained.
for home security systems that are implemented into The sixth study was conducted by Parab and Amol
one application. The first system used a web camera Joglekar (2015) under the title "Implementation of
used for capturing motion and objects, producing Home Security System using GSM module and
warning sounds and sending feedbacks to the user. Microcontroller". This research discusses the design
The second method sent SMS using GSM-GPS and implementation of a home security system using a
Module (sim548c) and Atmega644p microcontroller, GSM modem, where the power used was very low. In
sensor, relay and buzzer. addition to using a GSM modem, magnets were also
The third study was conducted by Chuimurkar and used with relays on doors and LEDs. So, when the door
Bagdi (2016) entitled "Smart Surveillance Security is opened, the yellow LED will turn to red. Then, the
system will send an SMS to the owner.
and Monitoring System Using Raspberry PI and PIR
From the literature review, there have been few
Sensor". It focused on the design and implementation
researchers who focus on the IoT, home security system
of monitoring systems using Raspberry PI and PIR and motion detection. However, there has been no
Sensors for mobile device. The system has the ability researcher specifically discussing IoT technology for
to detect smoke and human movement, providing home security with an additional ability to recognize
precautions against potential crime and potential fire. intruders. In addition, there are several studies which did
The hardware used was Raspberry Pi (RPI) with not present the results of accuracy obtained by the
OpenCV for handling image processing, alarm control system. Therefore, in this research, the design is
and send captured photos to user email via WiFi8 proposed to maximize the existing system and provide
Alarm system for the initial sign, the system will play better feedback to users.

1109
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

System Design Approach process, the system will activate the function for human
detection. In human detection, we use the HOG and
Based on the problems faced, an IoT system with an SVM methods. Features of the photo are extracted
additional capability of detecting and recognizing using HOG and then a classification of features is
intruders using HOG and SVM methods is proposed performed by using SVM. SVM matches the features of
(Dalal and Triggs, 2005; Satpathy et al., 2014). The the photos with features in the dataset. If human
system is implemented on Raspberry Pi 3 (Kumar and
presence is detected in the photo, then the system will
Reddy, 2016) and Arduino (Abdullah et al., 2016;
activate the buzzer as an alarm and send an email
Badamasi, 2014). The Raspberry Pi 3 is used because
this board can process image processing with low power notification. If the-re is no human presence detected in
from computer and laptop. Arduino is used to integrate the picture, then the system will re-read the movement
all the electronic devices in one environment. To detect or return to the initial process. The complete system
the motion, the PIR sensor is utilized (Sahoo and Pati, workflow is shown in Fig. 2.
2017). In this section, the system design approach for the Hardware Design
proposed home security system is discussed.
This section outlines the hardware design. The
General System Design hardware design includes the selection of electronics
In designing a system, the first step is to develop the equipment and the integration of all of components.
architecture of the system. Firstly, the scenario of Figure 3 shows the hardware design for our security
possible intruder entry and how the warning informs monitoring system. Meanwhile, the specifications of every
need to be considered. The possible intruder scenario component are presented in Table 1. The number in Fig.
can be seen in the “Arrival of Intruder” section in Fig. 3 corresponds to the order of component in Table 1. For
1. In this research, we assume the intruder to enter the processing module, we use Raspberry Pi 3 model B. This
house from the front door. As the intruders arrive/enter, board is equipped with wireless LAN module for
the PIR Sensor located near the front door detects the
communication. Arduino is used to collect the signal
motion of the intruders. The PIR sensor reads every
from PIR sensor through jumper cable. Arduino is
movement that passes through the detection range of
the PIR sensor, i.e., approximately 4-7 m. In the process connected to Raspberry Pi via USB cable. To capture the
of motion detection, the system will read continuously picture, USB webcam is mounted to the Raspberry Pi 3
until a movement is found. via USB cable. To release warning, buzzer module is
If there is a movement, then the system will activate connected to Raspberry Pi 3 through GPIO port. The
the camera. The generated images are then stored in the Raspberry Pi 3 is also connected to the internet so that
system directory. After the photo capture and storage the system has the ability to send an email notification.

Table 1: Hardware specification


No Name Description
1 PIR Sensor PIR Sensor for movement detection
2 Arduino Arduino Uno
3 Camera Using webcam camera USB 2.0 (Logitech c525) for take picture
4 Raspberry Pi 3 Using Raspberry Pi 3 Model B, ARM Cortex-A53 1.2 GHz, 1 GB RAM, 802.11n
wireless LAN. In this Raspberry Pi 3 image processing has been installed (OpenCV)
5 Buzzer Passive buzzer for alarm

Arrival of Activate the Notification


intruder hardware module to user
Power supply
Camera

PIR sensor

Raspberry pi Email User


Intruder Arduino

Alarm

Fig. 1: Proposed system architecture

1110
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

Algorithm : Motion Detection in Arduino


Start
Declare :
Pin, pirState, val := 0,
Algorithm :
1. While val <> 1 do
Movement 2. If pin := HIGH
No
detection 3. If pirState := LOW
4. val := 1
5. pirState := HIGH
No
6. Else
7. IF pirState := HIGH
Any
8. val := 0
movement?
9. pirState := LOW
Any
10.End While
people? Listing 1. Pseudo Code of Software in Arduino
Yes
Movement detection is handled by PIR Sensor and
Yes Arduino sends the true or false value to Raspberry Pi 3.
Photo captured is triggered after Arduino sends the data.
Take picture
Raspberry Pi 3 controls the camera. Figure 5 shows the
software architecture. This diagram shows the position
Active buzzer or location of each application function on the hardware
that will be installed and arranged from the application.
HOG and SVM are also installed in Raspberry Pi 3.
People
HOG is used to extract the features of human objects in
detection the image. In the first step, the HOG method will convert
RGB image (red, green, blue) to grayscale image. Then,
Send email gamma normalization will be done to calculate the result
of the square root of each channel (red, green and blue
channel). Then, the gradient value of each pixel will be
calculated by dividing it into 8×8 cells. The next process
is to determine the number of orientation bin that will be
End used in the histogram (spatial orientation binning). After
that, the normalization process of block 16×16 is done to
cells to overcome the lighting changes. In this process
Fig. 2: System workflow
there are blocks that overlap due to their shifting cells.
The final process is to calculate the HOG feature vector.
1 The resulted HOG feature will be processed using the
5 SVM method to determine whether the feature is a
3 human feature or not. The full process of human
detection can be seen in the Fig. 6.
4 System Setup
2
1. PIR Sensor on Arduino
Programming for motion detection using PIR sensor
is performed on Arduino IDE application. The source
code is then embedded into Arduino by connecting the
Arduino with a computer using a USB cable and the
Fig. 3: Hardware architecture programs are downloaded to Arduino.
2. Raspberry Pi 3
Software Design
a. Raspbian Stretching. OpenCV and Python
After the hardware design, software was then designed.
Firstly, we create a use case diagram as shown in Fig. 4. The operating system used for Raspberry Pi 3 is
The user starts activating the system in Rasp-berry Pi 3. Raspbian Stretch. This operating system can be

1111
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

downloaded on the official Raspberry site. This Raspbian Strech is installed, the applications required on
operating system operates on 32GB MicroSD. The type Raspberry Pi 3 are OpenCV and Python to run HOG and
of MicroSD used is MicroSD Class 10 which is SVM. For the computer vision library, opencv 3.3.0,
commonly used on Android smartphones. After opencv_contrib and Python 3.0 is used in this research.

System
Activate the system Take a photo

<<extend>>
<<extend>>
<<extend>>

Detect movement People detection

User <<extend>>
<<extend>>

Send email Activate the alarm

Fig. 4: Use case diagram

Arduino Raspberry Pi 3

PIR sensor Raspbian stretch

Movement Opencv 3
detection
Capture Active Send
image HOG + SVM buzzer email

Fig. 5: Software architecture

Start

Normalize Weighted vote


Compute into spatial and
Input image gamma and
gradients orientation cell
clour

Collect Contrast
Person/non- HOG’s over normalize over
person Linear SVM detection overlapping
classification window spatial block

Start

Fig. 6: Human detection process

1112
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

b. Camera photo was obtained. The photo is stored by the system in


the temporary folder, namely directory /home/pi/Home
The webcam camera function uses the fswebcam Security/images. The photo can be seen in Fig. 7.
library. Then the .sh file is created with a program script. Then the extracted photo using HOG, with the first
The resulting photo is 640×480 pixels and the FPS step is color normalization. At this stage, the original
parameter 15. The purpose of the low-resolution setting is color photo is transformed into a grayscale one. The
to perform the photo process quickly, i.e., less than 1 sec. trick is to take all the pixels in the image then from the
c. Alarm color of each pixel, information about the 3 basic
colors, namely red, blue and green, is obtained. These
The Alarm function on the Raspberry Pi 3 already three basic colors will be added, then divided by three
supports the gpiozero pin interface. Therefore, the alarm so that the average values are added. This average
can be used immediately. value will be used to give color to the pixels of the
image so that the color becomes grayscale. The three
d. E-mail
basic colors of a pixel will be set to the average value
To send an email using SMTP, some configurations (via RGB function). The grayscale value can be obtained
are conducted. In this study, two emails with the Gmail with the following equations:
domain is utilized. The first e-mail address is
[email protected], used as server initialization f i R ( x , y ) + f i G ( x, y ) + f i B ( x, y )
(from e-mail sender, from) and second e-mail address f ( x, y ) = , (1)
3
[email protected], used as the recipient. Then,
the email as the sender and recipient's email are
configured. The configuration is performed on the sender The photos that have been processed into grayscale
and recipient's gmail account in order to allow the less can be seen in Fig. 8. After being converted to grayscale,
secure applications, therefore email can be sent then normalization is made from the grayscale photo.
automatically without any problem. The results of photo normalization can be seen in Fig. 9.

[email protected]
mailhub=smtp.gmail.com:587
FromLineOverride=YES
[email protected]
AuthPass=your_password
UseSTARTTLS=YES
UseTLS=YES
# Debug=Yes
Listing 3. Configuration in ssmpt.conf file.
Then the next step is to configure the
/etc/smtp/ssmtp.conf file on the Raspberry Pi 3. Listing 3
shows the configuration in ssmtp.conf file.
e. Network Fig. 7: Sample photo

For networks, WiFi is used as media for internet


connection. Static IP is used for IP configuration. These
settings aim to facilitate connection and remote access to
Raspberry Pi 3.
3. Training Dataset
Dataset training is not performed on the system. In
this study using a dataset provided by OpenCV. The
function is HOGDescriptor_getDefaultPeopleDetector().

Intruder Detection Using HoG


In this section, the intruder detection process using
HoG is explained. From the results of the experiments
that have been carried out according to the scenario, one Fig. 8: Grayscale picture

1113
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

The result is used to normalize each cell in a block, the


following is a calculation of the histogram in the block:

1. L1 - norm : v → v / ( v 1 + ε ) , (6)

2. L1 - sqrt : v → v / ( v 1 + ε ) , (7)

that is the number to treat vector descriptor as an


opportunity distribution.

 2 
3. L2 - norm : ν →  v + ε 2  , (8)
 2 
Fig. 9: Picture after being normalized
4. L2 - Hys, L2 – norm followed by clipping and
The next process is to calculate the gradient value. renormalization where is an un normalized vector
Gradient is the result of measuring changes in an
intensity function and an image can be seen as a In this process, descriptors from all blocks are
collection of several continuous intensity functions of collected, which are R-HOG. The R-HOG is an
the image. This process is used to obtain edges of objects overlapping grid used in classifiers. The R-HOG
in the image. The gradient of an image can be obtained descriptor block uses square grid-shaped cells. R-HOG
by filtering with a 2-dimensional filter comprising calculates the grid (which defines the number of cells in
vertical and horizontal filters. The commonly used each block) of cell pixels which each contain bin. The
method is 1-D centered with a matrix of [−1, 0, 1]. description of the HOG of the image is visualized using
Partial derivative formula for image functions (x, y): a 9×1 normalization histogram at 8×8. In Fig. 11 it is seen
that the dominant direction of the person's histogram is
∂ρ f ( x + h ) − f ( x − h ) shaped, especially around the body and legs.
1. x − axis : = (2)
∂x 2h To check whether there are people or not in the
window, SVM Classifier is used to separate classes of
∂ρ f ( y + h ) − f ( y − h ) people and non-people or in this study, it is the detection
2. y − axis : = (3) of people in the SVM Classifier and classification
∂y 2h
algorithms that try to separate a hyperplan. Classification
problems can be translated by finding a line (hyperlane)
The values of x and y are used to calculate the gradient:
that separates the two classes. Feature HOG that has
been processed is used as input from SVM learning.
1. Gradient Magnitude: g = g 2 x + g 2 y (4) Feature HOG is changed to feature vector with size
4608×1. Feature vector size is generated from
gy multiplication of block size (2×2 cells), number of bins 9
2. Gradient Direction: θ = arctan (5) and number of blocks formed from photos. This feature
gx
vector is used as input for the SVM learning process. If
The photos from the gradient calculation can be seen the results in the SVM process can produce true values
in Fig. 10. When the gradient computation process (there are people detected), the system will create a box
(green box) that shows the position of the person in the
obtains different gradient values, it is necessary to group
image as shown by Fig. 12.
each cell into a larger group called block. After grouping
The system will then store the value of bounding
into blocks, this block usually overlaps. In normalization, boxes or true values in the previous process to the
this block uses R-HOG square block geometry. variable x1. The value of x1 will then be used as a filter
This process is the final process of the HOG method that where if the value of x1> = 1 then it means that the system
produces features. This process is carried out when the detects people. If not, there are no people in the photo.
windows detector process is like in the process of Then, the notification is sent to the email that has
calculating bin orientation. Windows detector size used been configured. The screenshot of the email
is 64×128 which consists of 8×8 pixels. Calculating notification can be seen in Fig. 13. From this scenario,
block normalization takes cell groups and normalizes the it produces a system log that shows the process of the
overall contrast response. This is done by accumulating application to process each of its functionalities. The
the size of histogram from the cell group called block. system log can be seen in Fig. 14.

1114
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

(a) (b)

Fig. 10: Gradient Image (a) X-Gradient Image (b) Y-Gradient Image

Fig. 11: Visualization of histogram of oriented gradients

Fig. 12: Bounding boxes

1115
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

Fig. 13: Email notification

Fig. 14: System log

The captured image will be saved to the directory • The system will detect the movement of the intruder
HomeSecurity/images/. After the system has finished and take photos of the intruder
analyzing, the photos that have been detected will then • The system will analyze the existence of intruder
be moved to the directory HomeSecurity/images_detect and activate the buzzer
and photos that cannot be detected will be moved to the
directory HomeSecurity/images_fail. Accuracy and Processing Time Evaluation
Results and Discussion In this section, the accuracy of detection is described.
The experiment used 2 objects, which are human (the
This section discusses the implementation of IoT true-event) and animal object (the false-event). The tests
security monitoring system and the evaluation results. include checking from the start of the detection until the
Firstly, we integrate and implement the designed system alarm is activated. For human detection, the input is in
as shown in Fig. 15a to 15c. The figures show the the form of humans from the beginning of detection until
connection between Arduino with PIR sensor, the alarm is activated and also testing from the beginning
connection between Arduino and Raspberry Pi 3 and of detection until the alarm is activated to check whether
connection between Raspberry Pi 3 with buzzer and the animal is detected or not.
webcam, respectively. This scenario is repeated for l00 times with various
Figure 16 shows the sketch of evaluation condition of intruders, e.g., carrying goods, half
environment. The entrance access to this room is through standing, facing sideways, half body, etc as shown in
l door and 1 window. The PIR sensor and camera are Fig. 18. There are two parameters measured in this
located in front the door as shown by Fig. 17. The evaluation. The first parameter is about the processing
scenario of the evaluation is described as follows: time of intruder detection. The second parameter is the
accuracy of intruder detection.
• First, the system is activated and the intruder will Figure 19 shows the result of the processing time.
open the door and enter the room The x-axis indicates the index of experiment (the total

1116
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

experiment is 100 times), while the y-axis indicates the be seen in Fig. 20. In this sample, 1 person in that photo
measured time in seconds (s). Blue line indicates time to have a contrast colour with background, such as wall and
take pictures. It means the time started from the PIR door. Therefore, the system can detect the person in that
sensor detects the movement until the photo is taken. Red photo easily. On the other hand, the sample image for true
line indicates time for human detection. It means the time negative event can be seen in Fig. 21. From this image, the
started from taking the picture, system analyzes the picture, full human body cannot be recognized perfectly because
until the decision is made. The result shows that the average the intruder is on the position of climbing the window.
time to take the picture is 0.92 s, while the average time to For animal detection testing, the same scenario was
detect the intruder is 0.99 s. Therefore, the total time from used. The animal object was a cat and the number of
movement detection until the intruder image detection is tests performed was 30 times. Figure 22 shows a cat that
1.91 s. Based on the processing time measurement, the was successfully photographed by the system. Figure 23
system can be considered capable of securing the house is the result of processing time. The x axis shows the
because it can detect the intruder within seconds. trial index, while the y axis shows the time measured in
Then, the accuracy of the human detection process is seconds. The blue area shows the time to take pictures.
evaluated. The experiment produces 100 photos. From the This means that the starting time of the PIR sensor
photos, the existence of people on the photo is detected or detects motion until the photo is taken. The red area
in other words, the system is able to detect people or not indicates the time for animal detection. This indicates the
from the photos. From the results of checking, 89 images time starting from taking pictures, analyzing images, to
were successfully detected (true-positive) and 11 other the final conclusion. The results show that the average
images could not be detected (false-negative). The time time to take pictures is 1s, while the average time for
when the system successfully detects the intruder and detection is 1.35 s. Therefore, the total time from motion
when it does not successful in detecting the intruder is detection to animal detection is 2.35 s.
analyzed. The sample of image for true positive event can

(a) (b) (c)

Fig. 15: (a) Arduino with PIR sensor (b) Arduino connected with Raspberry Pi 3 (c) Raspberry Pi 3 with buzzer and webcam

Legend:
Window
Door PIR Sensor

Camera

Desk

4,5 Meter

Cabinets

Bed

3 Meter

Fig. 16: Test environment

1117
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

(a) (b)

Fig. 17: Implementation in real environments, (a) installation of arduino and PIR sensors at the wall, (b) Installation of Raspberry Pi
3, cameras and buzzers above the table

Fig. 18: Sample of captured image human

RESULT EXPERIMENT FOR HUMAN

Time to capture image Time to human detection


4
3.5
3
2.5
2
1.5
1
0.5
0
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58 61 64 67 70 73 76 79 82 85 88 91 94 97 100

Fig. 19: Human detection time

1118
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

Fig. 20: Sample image of true positive event

Fig. 21: Sample image of true negative event

Fig. 22: Sample of captured image animal

RESULT EXPERIMENT FOR PET

Time to capture Time to detection


4
3.5
3
2.5
2
1.5
1
0.5
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

Fig. 23: Animal detection time

1119
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

Fig. 24: Sample image of false negative event

Fig. 25: Sample Image of False Positive Event

Table 2: Confusion matrix table


Prediction
------------------------------------------------------------
Total sample = 130 Negative Positive
Actual Negative TN = 28 FP = 2
Positive FN = 11 TP = 89
Accuracy: (TP+TN) / (TP+FP+FN+TN) = 0.9

Table 3: Comparison result


No Works Method Sensitivity Time detection (second) System accuracy
1 Patidar et al. (2014) Change detection technique - - 86% (at 5-6
frames/second)
2 Our proposal HOG + SVM 98% 1.9044 90%

Further, we analyze the sample of cat figure. It turns out It takes a little longer time for animal detection. It
that there are 2 false-positive results and 28 true-negative may happen due to the dark room and difficulty to
events. As shown in Fig. 24. In the true-negative event, the estimate the edge in the picture of the cat.
cat is not detected as a human. Therefore, it meets our From the data obtained, we have 100 photos for
expectation. The false-positive event is shown by Fig. 25. human intruder case and 30 photos of non-intruder
The cat in this figure is detected as a human because the case (animal object). To calculate accuracy, a
shape and direction of the cat in the picture resembles a confusion matrix is used, as shown by Table 2. The
human, from the appearance of the head, body and 2 legs. number of correctly detected photos is 117 photos.
Meanwhile, the long body of the cat and the tail do not From the results of accuracy testing, the accuracy of
appear in the figure. the home security system using the HOG and SVM
From the results of the tests, the following results methods is 90% with the true positive rate (TPR) of
are obtained: 97.8% and the False Positive Rate (FPR) of 28.2%.
average time for human detection : 1.91 s The results outperform the works of Patidar et al.
average time for animal detection : 2.35 s (2014) as shown by Table 3.

1120
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

Therefore, it can be concluded that the system has Badamasi, Y.A., 2014. The working principle of an
achieved sufficient level of accuracy. It only takes Arduino. Proceedings of the 11th International
around 2 sec for processing time, which is sufficient for Conference on Electronics, Computer and
the implementation. Therefore, it can be concluded that Computation, Sept. 29-Oct. 1, IEEE Xplore Press,
the system has achieved sufficient level of accuracy. It Abuja, Nigeria, pp: 1-4.
only takes around 2 sec for processing time, which is DOI: 10.1109/ICECCO.2014.6997578
sufficient for the implementation. Bangali, J. and A. Shaligram, 2013. Design and
implementation of security systems for smart home
Conclusion based on GSM technology. Int. J. Smart Home, 7:
201-208.
This paper has proposed a security monitoring system Charadva, M.J., R.V. Sejpal and N.P. Sarwade, 2014. A
based on IoT technology. The proposed system consists study of motion detection method for smart home
of Raspberry Pi 3, Arduino, PIR sensor, webcam and
system. Int. J. Innovat. Res. Adv. Eng., 1: 148-151.
buzzer. The novelty of the system is the inclusion of
Chitnis, S., N. Deshpande and A. Shaligram, 2016. An
human detection capability by HOG and SVM method
and buzzer as method to warn the house owner. The investigative study for smart home security: Issues,
simulation results show that the system can detect an challenges and countermeasures. Wireless Sensor
intruder within seconds with accuracy of 90% with Netw., 8: 61-68. DOI: 10.4236/wsn.2016.84006
processing time around 2 seconds. Future research will Chuimurkar, R.M. and V. Bagdi, 2016. Smart
explore other feature extraction and classification surveillance security monitoring system using
method to improve the accuracy of intruder detection. Raspberry PI and PIR sensor. Int. J. Recent Trends
Eng. Res., 2: 364-371.
Acknowledgement Dalal, N. and B. Triggs, 2005. Histograms of oriented
gradients for human detection. Proceedings of the
The publication of this research is supported by Bina Computer Society Conference on Computer Vision
Nusantara University. and Pattern Recognition, Jun. 20-25, IEEE Eplore
Press, San Diego, CA, USA, pp: 886-893.
Author’s Contributions DOI: 10.1109/CVPR.2005.177
Eseosa, O. and E. Promise, 2014. GSM based intelligent
Nico Surantha: Idea of research, research advisor home security system for intrusion detection. Int. J.
and paper author.
Eng. Technol., 4: 595-605.
Wingky R. Wicaksono: Implementation, experiment
Kumar, A.S. and P.R. Reddy, 2016. An internet of things
and co-author.
approach for motion detection using raspberry-pi. J.
Int. J. Adv. Technol. Innovat. Res., 8: 3622-3627.
Ethics Parab, A.S. and A. Joglekar, 2015. Implementation of
The authors agree with the publication of this home security system using GSM module and
manuscript, which does not contain ethical issues. All microcontroller. Int. J. Comput. Sci. Inform.
references are stated in the references section. Technol., 6: 2950-2953.
Patidar, S., A.P. Pandey, K. Ketan and G.R. Pareshkumar,
References 2014. Real time vision based security system. IOSR
J. Electron. Commun. Eng., 9: 46-53.
Abdullah, R., Z.I. Rizman, N.N.S.N. Dzulkefli, S.I. Ismail DOI: 10.9790/2834-09554653
and R. Shafie et al., 2016. Design an automatic Raja, M.A., G.R. Reddy and Ajitha, 2017. Design and
temperature control system for smart tudungsaji implementation of security system for smart home.
using Arduino microcontroller. ARPN J. Eng.
Proceedings of the International Conference on
Applied Sci., 11: 9578-9581.
Al-qaness, M.A.A., F. Li, X. Ma and G. Liu, 2016. Algorithms, Methodology, Models and Applications
Device-free home intruder detection and alarm in Emerging Technologies, Feb. 16-18, IEEE Xplore
system using Wi-Fi channel state information. Int. J. Press, Chennai, India, pp: 1-4.
Future Comput. Commun., 5: 180-186. DOI: 10.1109/ICAMMAET.2017.8186705
DOI: 10.18178/ijfcc.2016.5.4.468 Sahoo, K.C. and U.C. Pati, 2017. IoT based intrusion
Ansari, A.N., M. Sedky, N. Sharma and A. Tyagi, 2015. An detection system using PIR sensor. Proceedings of
internet of things approach for motion detection using the 2nd IEEE International Conference on Recent
Raspberry Pi. Proceedings of the International Trends in Electronics, Information and
Conference on Intelligent Computing and Internet of Communication Technology, May 19-20, IEEE
Things, Jan. 17-18, IEEE Xplore Press, Harbin, China, Xplore Press, Bangalore, India, pp: 1641-1645.
pp: 131-134. DOI: 10.1109/ICAIOT.2015.7111554 DOI: 10.1109/RTEICT.2017.8256877

1121
Nico Surantha and Wingky R. Wicaksono / Journal of Computer Science 2019, 15 (8): 1108.1122
DOI: 10.3844/jcssp.2019.1108.1122

Satpathy, A., X. Jiang and H.L. Eng, 2014. Human Tanwar, S., P. Patel, K. Patel, S. Tyagi and N. Kumar et al.,
detection by quadratic classification on subspace of 2017. An advanced internet of thing based security
extended histogram of gradients. IEEE Trans. Image alert system for smart home. Proceedings of the
Process., 23: 287-297.
International Conference on Computer,
DOI: 10.1109/TIP.2013.2264677
Surantha, N. and W.R. Wicaksono, 2018. Design of Information and Telecommunication Systems, Jul.
smart home security system using object recognition 21-23, IEEE Xplore Press, Dalian, China, pp: 25-29.
and PIR sensor. Proc. Comput. Sci., 135: 465-472. DOI: 10.1109/CITS.2017.8035326
DOI: 10.1016/j.procs.2018.08.198

1122

You might also like