Control Engineering S B Halesh
Control Engineering S B Halesh
Control Engineering S B Halesh
Abstract—The Internet of Things (IoT) is the there is a constant need by users to monitor people and entities
communication of various devices or “things” with each that are dear to them and not everybody is capable of meeting
other by the sharing of usable and relevant data. In the high prices and costs of these systems. Therefore, with the
today’s age of digitization and “smart” devices, one of the introduction of small and smart standalone computers such as
foremost requirements is for new, innovative technology the Raspberry Pi, any user can develop their own surveillance
integral to the concepts of Internet of Things in everyday systems that are not just isolated systems, but ones that also
life. The need for surveillance and monitoring has interact with various other devices and infrastructures.
drastically increased over the course of the past few Businesses can also provide such products at much lower
decades. Both private areas and public areas alike require costs now, very much in contrast to the systems provided in
these types of surveillance systems to ensure security, and the past which were both costly and also required a lot of
are generally very costly. In this paper, is proposed, an manual monitoring.
innovative surveillance system which is powered by the
Raspberry Pi, Amazon Web Services and Google Drive
that provided results with minimal latencies.
I. INTRODUCTION
background subtraction method to detect motion. The system time. However, existing systems are not always area or room-
also incorporates various other features using services specific, and do not alert the user about an infiltration,
provided by Amazon Web Services, such as SES for notifying irrespective of the user‟s location. In addition, none are
the user via e-mail and AWS RDS for storing relevant data. implemented using systems akin to the Raspberry Pi.
Google drive has been used to store images on cloud to make
it easily accessible to the user. A client-side GUI for users has
IV. IMPLEMENTATION
also been developed, to view data in a user-friendly,
interactive format and also to gain relevant insights from
them. Hence, an IoT based system has been successfully The system uses three-tier architecture, where the first tier
implemented using the Raspberry Pi, AWS as well as Google is the background subtraction algorithm running to detect
Drive. motion that keeps constantly running in a loop triggering
certain functions when deemed necessary. The second tier is
the database and cloud storage which stores important data in
II. RELATED WORK cloud servers. It also includes the e-mail servers that aid in
notifying the user in real-time. The third and final tier is the
part of the system that experiences user interaction. This
Extensive research in the field of computer vision has includes a web application that has been developed so that the
paved way for many successful systems that utilize image user can observe information related to their system.
processing techniques. The most common techniques include
background subtraction and differential frame analysis. [1] The system is essentially divided into various steps or
proposes a three layer architecture. The first layer is the processes as listed below:
motion detection layer, which is the outcome of a Python
script and the second layer triggers the actions based on a 1. Video feed is continuously transferred from USB
configuration file. The third layer triggers actions like sending Camera to Raspberry Pi.
an email, storing the images/videos to an FTP server. Live 2. Motion detection script constantly running the
video streaming system based on Raspberry Pi connected to a background uses these input frames to make a
5MP Camera Module. The sensitivity of their system [2] decision based on certain parameters.
revolves around the chosen value for a threshold which is a
measure of the rate of change of a pixel location. [3] delivers a 3. If motion is detected, and is long enough to be
system that compares two successive images and determines regarded as a significant motion, the frame in which
the motion and takes the necessary steps following the motion is detected is immediately uploaded to the
detection. The method proposed in [4] uses a combination of drive in cloud.
temporal frame differences and background subtraction which 4. User is notified with relevant information such as
can successfully detect slow moving targets as well. To motion start time along with an image URL that links
improve the accuracy, a cross-correlation method is adopted to the image uploaded to the drive in previous step.
for better results regarding slow and stationary objects and
background updating is employed. A three-tier based approach 5. Motion time is uploaded into the RDS in cloud for
was proposed in [5], one for efficiently determining the future analysis and visualization.
background (BM Module) using rapid matching followed by 6. User can log into a web application using given
accurate matching, second being a novel block based entropy credentials to view important information regarding
evaluation method for identification of block candidates of their systems and also visualize the data uploaded to
moving targets, and third being the object extraction (OE database.
Module) which examined every block to identify a moving
object.
The system proposed in this paper focus primarily on the
intercommunication of devices and services to build a
successful working surveillance system. It is highly capable
and will work with any of the latest motion detection
algorithms that have been proposed up till today.
III. MOTIVATION
B. Storing image and relevant data on Cloud server detected. It also contains a link to the image uploaded into the
In the Internet of Things era there is a need for this type Google drive for that corresponding motion.
of surveillance system to have the obtained data to be
accessible and available to other authorized systems and D. Data visualization and User interaction
applications, and not just be stored locally in the Raspberry Pi.
For the application to be wholesome, it is imperative that
The system satisfies this need by using a popular AWS service
the user functionality extend beyond merely that of receiving
called RDS (Relational Database System) which is hosted on a
e-mail alerts and viewing pictures. There is a need for the user
virtual instance in the cloud. This remote storage makes it
to be able to view all the data over a certain time-frame in
readily accessible to other applications that can give really
some format, from a remote location at his/her leisure. Hence,
good deductions from the data. It also helps the user to view
a web portal was developed for the same. The user is required
information obtained from their systems in real-time from any
to merely login to the portal using his/her assigned credentials,
authorized device that has access to the network.
and can subsequently view all the stored data regarding
The system uses the PyMySql library to establish foreign movements detected in the form of various interactive
connection to the MySQL server in the cloud and enables graphs. The user could even choose to view the stored data in
execution of SQL queries to insert or update data in the table. raw text form.
To store images of the instances when motions are Python‟s Flask module was used to develop the web
detected, popular cloud storage service „Google Drive‟ is portal, along with HTML and CSS for the UI, while another
used. This is done using the PyDrive API provided by Google couple of Python libraries, Bokeh and Pandas are used to plot
to authenticate the user, upload image to drive and to extract a and render the interactive graphs from which the user can infer
shareable link to the image uploaded directly from our main a lot of information such as rate of occurrences of motion,
program. average duration of motions, etc.
This feature is used to access the cloud services such as Results of earlier experiments with movement caused by
Amazon SES that notifies the user via e-mail, where the email a single entity are as shown in the collection of figures in Fig.
contains important information such as the time motion was 6 which depicts the entry of an entity from the bottom of the
frame and gradually moving upwards. The region of detection At the end of the motion, the end time of the motion is
of the motion has been highlighted by a bounded green also logged into the RDS as it helps in identifying various
rectangle. important factors in the future.
On detection of the motion, the image is immediately
uploaded to Google Drive. After successful upload of the file, To make the system wholesome, it was essential to have
the image URL or link to the image corresponding to the further interaction between the user and the system. For the
motion is extracted. same, a web application was developed that allows authorized
users to view information limited to just their surveillance
system.
The URL of the image in the drive for the current motion Fig. 9. Application home page
is extracted and is sent along with start time of the motion in
the body of the e-mail. The user receives an email notification From the home page the user has options to view various
on any device which has the user‟s email account as a graphs that have been plotted using data extracted from RDS.
connected account. The graphs and data visualized here are unique to each user
The e-mail received by the user contains time of start of and their system.
motion as well as image captured by camera as shown in Fig.
8.
On choosing which graph the user want to see, Flask II. SYSTEM LATENCY ANALYSIS
renders the html template on which Bokeh produces the output
file as a graph. These graphs are interactive and aid the user in
visualizing and analyzing the data. Time it takes for user Total Process
to get notifie d of
detected motion
The system was later tested in a different environment
where multiple entities were causing motion simultaneously.
The system continued to perform accurately by detecting the
Average 5.8731 6.8818
Duration
motion as well as the causes and responding to this change of (sec)
state, instantly and accurately as shown in Fig. 12 below.
Standar d 1.6672 1.5193
Deviation
(sec)
Any room or section of one‟s home can easily be put [1] Aamir Nizam Ansari \ Mohamed Sedkyl, Neelam Sharma,
under effective surveillance using the developed system. Upon Anurag Tyagil, „An Internet of Things Approach for Motion
the detection of foreign motion, the user is instantly notified Detection using Raspberry Pi‟ in 2015 International
along with the required visuals he/she requires to ascertain Conference on Intelligent Computing and Internet of Things,
whether the motion is that of an infiltrator or harmless, leaving pp. 131-134
the due course of action to the user‟s discretion. By virtue of
the Internet of Things concepts implemented while developing [2] Huu-Quoc Nguyen, Ton Thi Kim Loan, Bui Dinh Mao and
the system, the user can receive minimal-latency updates in Eui-Nam Huh, „Low Cost Real-Time System Monitoring
any location as long as there exists an Internet connection. Using Raspberry Pi‟ in ICUFN 2015, pp. 857-859
Similarly, the user is also able to access the stored data from [3] Virginia Menezes, Vamsikrishna Patchava, M. Surya
any remote location on a computer or mobile device, provided Deekshith Gupta, „Surveillance and Monitoring System Using
the correct login credentials are entered. Raspberry Pi and SimpleCV‟ during 2015 International
Conference on Green Computing and Internet of Things, pp.
1276-1278
VII. FUT URE WO RK
[4] M. Chen, X.L. Xu, „An Improved Method for Motion
Wide applications of Motion Detection Systems have Detection by Image Difference‟ in Information Science and
surfaced itself in the last few years from tracking to object Control Engineering 2012, 7-9 Dec
classification. A system that uses a deep learning model to [5] Shih-Chia Huang, „An Advanced Motion Detection
classify the objects into simple things like “person”, “car”, and Algorithm with Video Quality Analysis for Video
“door” has been successfully tested on our computers that Surveillance Systems‟ in IEEE Transactions on Circuits and
possess much better performance specifications than a Systems for Video Technology, 18 Oct, 2010.
Raspberry Pi. This method had consumed a lot of processing
time leading to a lot of delay, mainly because of lower RAM
and CPU processing capability of the Raspberry Pi (1GB).