Theft Identification - Alert Through Motion Detection - Facial Recognition Using IOT - Report
Theft Identification - Alert Through Motion Detection - Facial Recognition Using IOT - Report
PROJECT REPORT
ON
BACHELOR OF ENGINEERING
IN
BY
CERTIFICATE
It is hereby certified that the project work entitled “THEFT IDENTIFICATION & ALERT
THROUGH MOTION DETECTION AND FACIAL RECOGNITION USING IOT” is a bonafide
work carried out by KRISHNA VINEETH P (1NH16CS052), NASIR HASAN DILAWAR
(1NH16CS069), NITHINDRA D (1NH16CS075) in partial fulfilment for the award of
Bachelor of Engineering in COMPUTER SCIENCE AND ENGINEERING of the New Horizon
College of Engineering during the year 2019-2020. It is certified that all
corrections/suggestions indicated for Internal Assessment have been incorporated in the
Report deposited in the departmental library. The project report has been approved as it
satisfies the academic requirements in respect of project work prescribed for the said
Degree.
External Viva
1. ………………………………………….. ………………………………….
2. …………………………………………… …………………………………..
Theft Identification & Alert through Motion Detection & Facial
Recognition using IoT
ORIGINALITY REPORT
5 %
SIMILARITY INDEX
%
INTERNET SOURCES
5%
PUBLICATIONS
%
STUDENT PAPERS
PRIMARY SOURCES
1
Lekshmi, S. Vijaya, and M. P. Revathi.
"Implementing secure data access control for
1%
multi-authority cloud storage system using
Ciphertext Policy-Attribute based encryption",
International Conference on Information
Communication and Embedded Systems
(ICICES2014), 2014.
Publication
2
Sen-Tarng Lai, Fang-Yie Leu, William Cheng-
Chung Chu. "Combining IID with BDD to
<1%
Enhance the Critical Quality of Security
Functional Requirements", 2014 Ninth
International Conference on Broadband and
Wireless Computing, Communication and
Applications, 2014
Publication
3
B. Maga, K. Jayasakthi Velmurgan. "An efficient
approach for object detection and tracking",
<1%
2017 Third International Conference on Science
Technology Engineering & Management
ABSTRACT
In the current scenario it is necessary to provide secure cost effective and efficient system
and hence developing an efficient security solution with minimum effort is the main goal
of this project. The current system is becoming dated in terms of its capabilities as most
of the houses, banks, businesses that do have a security system consists of mainly a Closed
Circuit Television(CCTV) cameras placed at various locations such as the main entrance,
backyard, storage rooms, basements etc. which just sits there and records everything. This
also has to be monitored by some security personnel at all times, but clearly this approach
is considered old-fashioned now and is inefficient as it requires too much attention to
detail and is not very cost effective either. Hence the project offers a smarter solution to
such problems in the form of a surveillance system with a smart video technology making
use of IOT and Machine Learning concepts. This feature can be monitored from a remote
location with very less effort. It includes motion sensing, reviewing the footage as
recordings. It only contains time frames of event occurrence and thus saves memory
usage. The architecture contains both hardware and software which provides a robust
and an enhanced security system. Raspberry Pi is the hardware component which is
connected to a camera for the process of Image capturing. Facial detection involves Image
processing in a series of steps. The process of detection and alerting system is automated
in the current system.
I
ACKNOWLEDGEMENT
The satisfaction and euphoria that accompany the successful completion of any task
would be impossible without the mention of the people who made it possible, whose
constant guidance and encouragement crowned our efforts with success.
I have great pleasure in expressing my deep sense of gratitude to Dr. Mohan Manghnani,
Chairman of New Horizon Educational Institutions for providing necessary infrastructure
and creating good environment.
I am grateful to Dr.Prashanth C.S.R, Dean Academics, for his unfailing encouragement and
suggestions, given to me in the course of my project work.
I would also like to thank Dr. B. Rajalakshmi, Professor and Head, Department of
Computer Science and Engineering, for her constant support.
I express my gratitude to Mr. Gagan S Purad, Assistant Professor, my project guide, for
constantly monitoring the development of the project and setting up precise deadlines.
His valuable suggestions were the motivating factors in completing the work.
II
CONTENTS
III
5 IMPLEMENTATION 34-36
6 TESTING 37-40
6.1 Unit Testing 37
6.2 Integration Testing 37
6.3 Validation Testing 38
6.4 System Testing 38
6.5 Test Cases 39
7 OUTPUT SCREENSHOTS 41
8 FUTURE SCOPE 42
9 CONCLUSION 43
REFERENCES 44
IV
CHAPTER 1
INTRODUCTION
LIST OF FIGURES
The safety of one's
priced belongings
FIGURE NO. FIGURE NAME of a person
PAGE NO in his
absence when he
leaves his/her
2.1 Supervised Learning 7
house, workplace,
shop etc. is always
2.2 Unsupervised Learning 8
a concern
especially with the
2.3 Reinforcement Learning 8
ever-increasing
2.4 Open CV Structure
number14
of crimes
such as theft,
2.5 Haarcascade Classifier robbery
17 etc. The
threat possessed
2.6 Haarcascade Classifier Steps by these
18 types of
crimes is ever
3.1 Raspberry Pi present
22 and there
are hard numbers
3.2 Pi Cam to back
23 this up,
there is one
3.3 GSM Module burglary
24 attempted
every 13 seconds,
3.4 PIR Sensor while 25on a yearly
basis there are
4.1 System Architecture roughly
28 2.5 million
burglaries
4.2 Dataflow Diagram happening
29 in the
USA alone out of
4.3 Sequence Diagram which 30 a staggering
66% are home
4.4 Flowchart – Motion Detection 31
break-ins, and
while the police
4.5 Flowchart – User Registration tries32to address
most of them they
4.6 Use Case Diagram are 33only able to
solve a mere 13%
5.1 Hardware Connection of it 36
due to lack of
witness or physical
7.1 Notification for Unauthorized user 41
evidence present.
But even then,
7.2 Unauthorized user 41
larceny-theft
accounts to 75%
of the total
property crime and
burglary adds up
18% more. The
reason behind this
is that out of the
total cases of
home break-ins
recorded, only
V 17% of the houses
actually had a
security system in
pla
Theft Identification & Alert through Motion Detection & Facial Recognition using IOT
CHAPTER 1
INTRODUCTION
The safety of one's priced belongings of a person in his absence when he leaves his/her
house, workplace, shop etc. is always a concern especially with the ever-increasing
number of crimes such as theft, robbery etc. The threat possessed by these types of
crimes is ever present and there are hard numbers to back this up, there is one burglary
attempted every 13 seconds, while on a yearly basis there are roughly 2.5 million
burglaries happening in the USA alone out of which a staggering 66% are home break-ins,
and while the police tries to address most of them they are only able to solve a mere 13%
of it due to lack of witness or physical evidence present. But even then, larceny-theft
accounts to 75% of the total property crime and burglary adds up 18% more. The reason
behind this is that out of the total cases of home break-ins recorded, only 17% of the
houses actually had a security system in place.
It is clear that the current system is becoming dated in terms of its capabilities as most of
the houses, banks, businesses that do have a security system consists of mainly a Closed
Circuit Television(CCTV) cameras placed at various locations such as the main entrance,
backyard, storage rooms, basements etc. which just sits there and records everything. This
also has to be monitored by some security personnel at all times, but clearly this approach
is considered old-fashioned now and is inefficient as it requires too much attention to
detail and is not very cost effective either. This therefore calls for a surveillance system
that is not only cheap and can be afforded by smaller firms and households but one that
utilizes the potential of the recent technological advancements to the fullest.
In the modern day what we require is a system that leverages the capabilities held by
advanced technology to provide better security solutions with minimum effort. This is
where this project comes into the picture, it aims to provide a prototype that offers a
smarter video surveillance system which makes use of IoT concepts along with image
recognition through machine learning algorithms in order to identify unknown suspicious
activity or any intrusion and immediately inform the owner about it. This can prove to be
useful in many ways, it can provide monitoring from a remote location, avail 24x7
automated surveillance, get better and more efficient recording as it can be configured to
record footage only when a movement is detected, hence making good use of motion
sensing, it would also help reduce the time spent on reviewing and rewinding the footage
as the recordings would only contain the time frames when the event occurred thus also
saving memory usage.
The main goal of the project is to develop an architecture consisting of both hardware and
software, to provide a robust security system. The two main concepts being used include
IoT(Internet of Things) for the remote access and alert system and Machine Learning for
image processing and facial recognition. The project is divided in two parts, the hardware
configuration and the software, the software is basically the scripts written to make the
hardware components function and also perform internal process of image processing for
face detection which is done by using OpenCV’s Haar Cascade classifier.
On the other hand, the hardware consists of four main components. The GSM module
which is required to send alerts via a cellular network or using Wi-Fi for e-mail, next is the
PIR sensor which is used for motion detection through thermal capturing, the Pi Camera
is connected along with the camera module to capture high definition videos when
alerted, all of it is stored and connected to the main hub which is the Raspberry Pi 3, the
mini-computer from where everything is controlled.
CHAPTER 2
LITERATURE SURVEY
Literature survey is the most important step in software development process. Before
developing the tool, it is necessary to determine the time factor, economy and company
strength. Once these things are satisfied, then the next step is to determine which
operating system and language can be used for developing the tool. Once the
programmers start building the tool the programmers need lot of external support. This
support can be obtained from senior programmers, from books or from websites. Before
building the system the above consideration is taken into account for developing the
proposed system.
G. P. Saroha and Pawan Kumar Mishra in their paper (2016) titled “Video Surveillance
System for Object Detection and Tracking” have studied the role of motion tracking to
detect objects in a video frame and its impact on the surveillance system as a whole. They
emphasize the point stating that a visual surveillance system is basically used for analysis
and explanation of object behaviors for which it should be able to detect static as well as
moving objects. The main objective of the paper is to determine different techniques in
static and moving object detection along with tracking of mobile objects. A video frame
consists of one or more objects in perpetual motion which can be classified into different
categories but recognizing moving objects in a frame is a challenging task for any video
surveillance system. The use of methods like background subtraction, statistical method,
and temporal frame differencing helps in detecting moving objects. The paper also
describes the various tracing methods like Point tracking, Silhouette Tracking and Kernel
tracking for live video tracking.
R V Prasad and Bhookya Nitesh Gaikwad in their paper (2017) titled “IOT Based Secured
Smart Home Automation Using Raspberry Pi” discuss about the design and
implementation of Raspberry pi based IOT concepts. It talks about implementing the
concepts of IoT through Raspberry Pi and bringing security features through remote
access to one’s home and workplace environments. The main focus however is on the
camera module which captures and uploads the images into a cloud based platform and
also stores the same in Raspberry pi module in an SD card. A WI-FI module is used to
enable remote access feature which basically allows the devices to be accessed and
controlled by the user via a web interface app from another location that is not exactly in
the vicinity of the house or office of the user. Raspberry pi is also equipped with different
sensors like a fire sensor, soil moisture sensor, temperature sensor and PIR sensor. The
fire sensor further connects to an alarm buzzer and also a water pump on the ceilings
while the Soil moisture sensor is connected to the water sprinkler is in the backyard for
plantations. The motion sensor is paired up with the camera to capture image and videos.
Raspberry-Pi is connected to the Internet via Wi-Fi or LAN which can be accessed by the
user through web interface.
This term was first devised around the year 1959 by Arthur Samuels, the American who is
considered as a trendsetter in the field of computer gaming and artificial intelligence.
Later a formal definition was proposed stating as follows: “Consider experience E, a class
of tasks T and a measure of performance P, then a computer program is said to learn if its
performance at the task T which is measured by P get better with experience E”
Machine Learning refers to the study of algorithms and models which is used by
computers to perform definite functions without the need for any external instructions to
do so. It depends mostly on patterns and inferences/insight gained through the data that
is received in place of actual instructions. ML is considered as a subdivision of the much
larger Artificial Intelligence (AI) domain, the Machine Learning algorithms that are used
everywhere build models, more specifically mathematical models which are based on the
data given as input to it, this sample data is known as training data which, as the name
suggests, allows the algorithms to make decisions on its own and hence don’t need to be
programmed in any way to perform any kind of task.
The machine learning algorithms are many in number and each of them have their own
separate approach towards solving a problem, even the type of input and output data
accepted differs from one algorithm to another along with the type of problem that they
are proposed to solve. Three of the learning algorithms that are most prominent include:
1. Supervised Learning
2. Unsupervised Learning
3. Reinforcement Learning
Supervised Learning: This algorithm tends to build a mathematical model which consists
of both, inputs and desired outputs. In the artificial neural network, there are input and
output vectors where each input vector corresponds to a target vector (a target vector
basically represents the desired output). The input vector results in output vector and
both of them combined is called a training pair. After processing, the actual output vector
is compared with the desired output vector and if an error is encountered then that leads
to an error signal that is generated by the network. That signal is then used for weight
adjustments until the actual and desired outputs are the same.
Unsupervised Learning: Unsupervised learning algorithms take a set of data that contains
only inputs, then during the training process that input pattern is analyzed to discover and
form arrangements like grouping or clustering of data points. It is observed that there are
no feedbacks applied from the environment to inform the network what the output
should be or whether they are correct or not. Hence the algorithm learns from test data
that has not been categorized or categorized. The network itself discovers patterns,
regularities, features, categories from the input data and relations for the input data over
the output. Instead of responding to feedback/error signals generated, unsupervised
learning algorithms identify similarities in the data and react based on the presence or
absence of such similarities in each new piece of data.
Internet of Things (IoT) is a platform that has been in existence for a long time, the concept
goes as far back as around 1926 when it was mentioned by Nikola Tesla himself in an
interview, but the term itself was devised in the recent past, in 1999 by Kevin Ashton. But
it came into the mainstream market less than a decade ago that is around 2010/2011.
According to the basic definition, the Internet of Things is basically a collection of radars,
sensors, activators/triggers etc. that are implanted into physical entities and are linked
wirelessly or through wired medium to communicate among themselves, it can be
thought of as a network for multiple embedded systems or collection of networks of
multiple embedded systems to communicate and perform tasks as required. These
systems can be programmed in many different ways to perform one or more set of tasks.
This network is also safe as it is ever present on the internet so the chances of failure is
low to none, and even the data that is stored stays online so it can be accessed quickly
and more efficiently without the fear of data loss or manhandling. The main objective of
a network like this is to allow a person to attain remote access to a host of devices which
then can be controlled by the user to perform desired tasks. In the last two to three years
this concept has been implemented and has led to very successful results in the form of
products among diverse fields. One such example is that Google’s home automation
ecosystem manager called Google Home which is a handheld smart speaker integrated
with home automation capabilities, not only it allows simple voice commands to control
basic operations like playing/switching songs, view picture galleries, provide news and
updates etc. but it can also be used to interact with smart devices present in any corner
of your home. This is achieved by the use of Google Assistant, the smart AI virtual assistant
made by Google which is always connected to the servers around the world that enables
language processing at a much faster rate after which the commands are interpreted in
order to take appropriate actions and trigger the required device to work.
There are many more upcoming smart speakers such as Alexa by Amazon, Apple’s Home
kit and now even automobile companies such as BMW, MG Motor and even Tesla are
trying to embed the smart speaker system within their cars. But besides Home utility
automation and Automobile, IoT has also helped several other industries, one of them
being the Gaming industry. With the release of Sony’s PlayStation 3, a new feature called
Remote Play was introduced which was later carried on to the next generation PlayStation
4, this was very well received and instantly became very popular in the gaming community
as now you could play all your console games in your laptops and computers while sitting
in some other corner of the world, this basically allowed users to connect their systems
via the internet with the console making the PC as a screen and then it can be controlled
and any of the games could be played remotely from anywhere in the world. This made
the console system portable without having even though you don’t actually need to carry
it everywhere.
IoT is not limited to only the advanced technological industry, its reach is beyond that, it
is now also proving to be immensely useful in primary industries such as Agriculture. Its
application enables much more efficient use of available tools and workforce by
decreasing the amount of overall labor put in the entire process, most of the monitoring
of surrounding environment is done by the setup established around the farms. The idea
of Smart Farming is on the rise now and has proven to be major game changer in the way
the entire agricultural process is carried out. A huge amount of data related to climate
conditions, soil quality, cattle health etc. can be used to monitor the condition of the
business as well as improve efficiency of total workforce which includes both, human and
equipment labor. With the help of data collected by sensors and other measuring devices
placed around the farms, one can better foresee the gross production and hence plan the
distribution of their crops in a way such that it can provide maximum possible profits none
of it is left unsold at the end. By observing to find out any irregularity in growth or overall
production, appropriate measures can be taken to find reduce the waste and manage cost
more resourcefully while increasing the use of smart devices a host of processes such as
fertilization, pest control, irrigation etc. in the production cycle can be automated. Since
automation also provides much better accuracy, this leads to increased control on
production while also improving crop quality and maximum growth capacity.
The demands on video surveillance are rapidly expanding in the present day. One of the
primary things individuals will need to think about their surveillance system is whether
they can interface with it over the web for remote review. Security literally means a way
or process by which is protected and prevented from breaching which is done through
different components and devices. They are networks of interconnected electronic
devices working parallel with a single point control panel Previously, the recording must
be checked by a concerned person who was to be seated at the same place throughout
the day watching the screens to ensure that nothing would occur. The other alternative
was to check the system and audit the recording but this would take a lot of time and the
loss would have occurred. Therefore, CCTV manufacturers and developers had to come
up with different ideas to overcome this and now has the ability to view from any smart
device at their convenience and record beside live video streaming of the intruder but the
cost incurred for implementing this is very expensive. A digital camera transmits video via
network to a single central location for monitoring, recording, and video analysis and has
superior quality, scalability, flexibility and remote accessibility. The main disadvantages of
the existing system are that the wiring which has to be done is complex and expensive
and has very limited features when compared to IP cameras.
As we have seen the various disadvantages that are there in the existing system, it is clear
that an improved setup is needed to tackle those problems mentioned in the previous
topic and build a more self-sufficient structure that can significantly improve the current
security surveillance system. One of the most important concerns to be taken into
consideration is to setup a system that is smarter in terms of its operation, the dated CCTV
cameras are just like any other video camera which can only record and playback a footage
and are therefore not very efficient in terms of storage and time consumption as
everything is recorded which takes a lot of space and reviewing the footage takes a lot of
time to get to the point where the incident actually happened, also the cost of the product
itself is high along with extra installation charges.
The project takes a step forward and tackles the issues in the current system with a
smarter approach to build upon upon the existing technology in the field of video
surveillance by creating a modern Closed Circuit Television for local and private use. This
is basically a CCTV camera setup equipped with the capabilities of motion detection along
with facial recognition which is aided by Image Processing and Machine Learning using
Python. The main hub what brings everything together is the Raspberry Pi which is a
compact computer as small as a credit card, this is where all the other hardware
components, the Pi Camera, Passive Infrared (PIR) Sensor and the GSM module come
together and it provides a platform to merge the entire setup and program them to work
in conjunction. Next is the PIR (Passive Infrared) sensor which is attached to the Raspberry
Pi. There are various different models available for it, the one that is being used in this
project is the HC-SR501 sensor. It consists of a pyroelectric crystal on top of which is the
Fresnel lens that is needed to focus the infrared signal on to the crystal, the main
advantage of using this is that it is cost effective and still provides decent features as it
has good viewing angle of around 120 degrees and can cover a distance of roughly 7
meters, this gives a larger filed-of-view. It also is very effective in terms of power
consumption which is as low as 65mA and it can work in extreme weather conditions
ranging from +80 degree Celsius to -20 degree Celsius.
The PIR sensor is mainly used for motion detection by sensing the change in heat emitted
as infrared signal which it captures, the change in the incoming radiation signal is
converted to output voltage which in turn triggers the detection and this signal is then
sent to the Pi Camera. The Pi camera is attached to Raspberry Pi through a Raspberry Pi
via a 15cm ribbon cable, it is a 5 megapixel fixed-focus camera which is able enough for
1080px30fps(30 frames per second), 720px60fps(60 frames per second) and VGA90 video
capturing, as well as stills capture. It also supports a selection of applications that are
based on command line operations for stills and video output which deliver some of the
characteristic features that one might find on a compact camera such as image resizing,
quality of image compression, exposure mode, ISO and more. The signal received from
the PIR sensor immediately triggers the camera which then starts recording or taking
pictures, the picture is then used to compare with the ones in the database. Through the
Haar Cascade algorithm the processed image is identified with the ones in the database
of registered members, if no match is found that person in the frame is classified as an
intruder and then the GSM module is instructed to quickly send an alert via text message
or e-mail to the owner.
Advantages:
• Speed up the process of post investigation:
The camera is configured to record only when there are movements detected
which helps reduce the time spent on rewinding and reviewing footages.
• Increase recording period for the camera:
Since a footage is recorded based on noticed movements, this enables the
recorder to prolong its recording period.
• Enhances Security:
The alert system is designed to send a notification in the form of email or text
message if an unknown entity is noticed in the pre-determined restricted area,
therefore this takes a more proactive approach when guarding ones property.
• Maintains Privacy:
It is designed to perform surveillance when an intrusion is observed else not, this
maintains the owner’s privacy.
• Saves space:
Unlike basic CCTV cameras the recording is not 24x7 thus it saves a lot of space.
2.4.1 OPEN CV
OpenCV (Open Source Computer Vision) is an Open Source Machine Learning software
library. It was introduced by Intel and now Itseez, but this again was taken over by Intel.
This is mainly used for Clustering and Statistical Pattern Recognition. A simple
infrastructure is provided for Computer Vision Application and is used to accelerate the
usage of Machine Perception in commercial products. It includes a set of classic and state
of art computer vision and machine algorithms. Usage of the above algorithms allows the
users to identify objects, faces, human actions from videos, extracting models of objects,
track movements of objects and so on.
Computer Vision overlaps with Photogrammetry, Image Processing and Pattern
Recognition.
OpenCV supports a number of programming languages like Java, C++, Python and more.
All the latest Developments and Algorithms are done in C++ interface. It also supports
various platforms such as Windows, Linux, OS X, iOS, Android and more. OpenCV does
Automatic Memory Management, Automatic Allocation of Output Data, implemented
using Multi-Threading and Re-Enterability and mainly OpenCV is portable.
• Video I/O
• Highgui
• Objdetect
• Features2d
Detection based on Appearance- This is used to find out Face models based on a set of
delegate training face images. This can be used for feature extraction.
Detection based on Appearance can be further divided into following sub-categories:
• Eigen-face based
• Distribution based
• Neural Networks
• Support Vector Machine
• Sparse Network of Winnows
• Naïve Bayes Classifiers
• Information Theoretical Approach
• Inductive Learning
• Verification –It is also called as Identification. An image should match only one
image in a database. When the image matches multiple images in the database
then the image with maximum score is matched.
In detection phase of Haar Cascade Classifier, window of target size is moved on the input
size and Haar features are calculated on each section of the image. The difference is
compared with a threshold value that differentiates objects and non-objects. To get a
strong classifier, a number of Haar features with higher accuracy are required to describe
an object and each of these classifiers are organized in a cascading method.
While training, for each feature after comparison, a score is known. The best threshold is
chosen and then the related feature is considered. There would be few misclassifications
or errors, but the features with minimum error rate is considered. Each image is equally
weighted in the beginning and based on the error rates the weight of the image is
increased. Sum of weight of each weak classifier is the weight of the Final classifier. Since
it cannot classify the image, it is called as Weak Classifier. This method is not simple.
Cascade of Classifiers is used to overcome the complexity of previous method. Rather than
applying all the features in a single window, we group the features into various stages and
then accept/reject the image. So, when the match fails in the first stage we do not proceed
to the next stage of Classification and hence better accurate results are obtained in an
efficient manner.
CHAPTER 3
REQUIREMENT ANALYSIS
• ACCESSIBILITY
Accessibility is a general term used to describe the degree to which a product,
device, service, or environment is accessible by as many people as possible.
In our project people who have registered with the cloud can access the cloud to
store and retrieve their data with the help of a secret key sent to their email ids.
User interface is simple and efficient and easy to use.
• MAINTAINABILITY
In software engineering, maintainability is the ease with which a software product
can be modified in order to:
1. Correct defects
2. Meet new requirements
New functionalities can be added in the project based on the user requirements
just by adding the appropriate files to existing project using ASP.net and C#
programming languages.
Since the programming is very simple, it is easier to find and correct the defects
and to make the changes in the project.
• SCALABILITY
System is capable of handling increase total throughput under an increased load
when resources (typically hardware) are added.
System can work normally under situations such as low bandwidth and large
number of users.
• PORTABILITY
Portability is one of the key concepts of high-level programming. Portability is the
software code base feature to be able to reuse the existing code instead of
creating new code when moving software from an environment to another.
Project can be executed under different operation conditions provided it meet its
minimum configurations. Only system files and dependent assemblies would have
to be configured in such case.
3.3.1 RASPBERRY PI
The Raspberry Pi is a low cost minicomputer which is almost as small as the size of a credit
card that can directly be plugged into a desktop monitor or television screen and attached
with a standard keyboard and mouse in order to make it a fully functional computer. Even
though it’s small in size, it still is very much capable of providing all the possible
functionalities expected from a standard desktop computer such as audio-video playback/
recording and processing, surfing the internet, creating spreadsheets/word-processing,
high level programming, playing games etc. It supports a host of different functionalities
through various different ports that can provide connection to multiple external devices
like sensors, cameras, secondary screen and more. After the initialization, Raspberry Pi
can be operated through a command line system or a proper Graphical User
Interface(GUI) based Operating System, whichever is more suited for the user. It is
attuned with Linux based operating systems and has a variety of options in terms of
specialized versions of Linux based kernel, the most popular being the Raspbian OS which
can run almost all programs which are Linux compatible.
3.3.2 PI CAM
The Pi Camera can be used to take high-definition video, as well as still photographs and
can take time-lapse, slow-motion and other types of videos too. It contains a 5 megapixel
fixed-focus camera which is able enough for 1080px30fps(30 frames per second),
720px60fps(60 frames per second) and VGA90 video capturing, as well as stills capture. It
is attached to the Raspberry Pi via a 15cm ribbon cable to the CSI port and can be accessed
through numerous libraries built for it, including the Picamera Python library.
The Camera Module allows the Raspberry Pi to connect to optical photo/video cameras
through the provided port on the Raspberry Pi using via the short ribbon cable mentioned
before. It enables connectivity for a camera capable of capturing still images or video
recordings. In Raspberry Pi’s system on chip(SoC), the Camera Module joins to the Image
System Pipeline (ISP), which is where the data incoming from the camera or any other
optical instrument is treated and in due course converted to an image or video that is
stored on the SD card (or some other external storage). It also supports a selection of
applications that are based on command line operations for stills and video output. Such
applications deliver some of the characteristic features that one might find on a compact
camera, image resizing, quality of image compression, exposure mode, ISO and more. It
is popular in home security applications, and in wildlife camera traps.
A GSM module or a GPRS module is a chip or circuit that will be used to establish
communication between a mobile device or a computing machine and a GSM or GPRS
system. The modem (modulator-demodulator) is a critical part here.
These modules consist of a GSM module or GPRS modem powered by a power supply
circuit and communication interfaces (like RS-232, USB 2.0, and others) for computer. A
GSM modem can be a dedicated modem device with a serial, USB or Bluetooth
connection, or it can be a mobile phone that provides GSM modem capabilities.
• Language: Python
Python is an interpreted, high-level, general-purpose programming language.
Created by Guido van Rossum and first released in 1991, Python's design
philosophy emphasizes code readability with its notable use of significant
whitespace.
• IDE: Spyder
Spyder is an open source cross-platform integrated development environment
(IDE) for scientific programming in the Python language. Spyder integrates with a
number of prominent packages in the scientific Python stack, including NumPy,
SciPy, Matplotlib, pandas, IPython, SymPy and Cython, as well as other open
source software.
CHAPTER 4
DESIGN
Designing the project is an important aspect when it comes to the planning of a project.
The following chapter will talk about what are the design goals of the system and how the
system architecture of the system will be and the flow of the data in the application will
be explained in a detailed visual and contextual way. This chapter also gives an idea of
how the application will be developed and what are the possible upshots of this
application and how will be the approach of the team towards the building of the
application in a specific and conceptual way. The conception stage of the application will
be put forth in this chapter.
4.5 FLOWCHART
CHAPTER 5
IMPLEMENTATION
The prevailing systems as we know then turn out to be highly ineffective in terms of
prioritizing the security of their surroundings and are very dated as they work just like any
other normal video camera with records and playback. The modern era requires a modern
system that is proactive and does more than just collect data for review, it is clear that an
improved setup is needed to tackle those problems to improve the current security
surveillance system. The project takes a step forward and tackles the issues in the current
system with a smarter approach and builds upon the existing technology in the field of
video surveillance by creating a modern Closed Circuit Television for local and private use.
This setup is equipped with the capabilities of motion detection along with facial
recognition which is aided by Image Processing and Machine Learning using Python.
The setup is built around the core of the entire architecture that brings everything
together which is the Raspberry Pi that is a compact computer as small in size as a credit
card, it provides a platform to further expand on by working as the host to other hardware
components that are the Pi Camera, Passive Infrared (PIR) Sensor and the GSM module,
and then it also provides a platform to merge the entire setup and program them to work
in conjunction since it is a fully functional computer system. Next is the PIR (Passive
Infrared) sensor which is attached to the Raspberry Pi. There are various models available
for it, the one that is being used in this project is the HC-SR501 sensor. It consists of a
pyroelectric crystal on top of which is the Fresnel lens that is needed to focus the infrared
signal on to the crystal, the main advantage of using this is that it is cost-effective and still
provides decent features as it has a good viewing angle of around 120 degrees and can
cover a distance of roughly 7 meters, this gives a larger field-of-view. It also is very
effective in terms of power consumption which is as low as 65mA and it can work even
under extreme weather conditions ranging from +80 degree Celsius to -20 degree Celsius.
The sensor is mainly used for motion detection by sensing the sudden rise and fall in heat
emitted as an infrared signal which it captures, the change in the incoming radiation signal
is converted to an output voltage which in turn triggers the detection and this signal is
then sent to the Pi Camera. The Pi camera is attached to Raspberry Pi via a 15cm ribbon
cable, the one being used here is a 5-megapixel fixed-focus camera which is good enough
for 1080px30fps(30 frames per second), 720px60fps(60 frames per second) and VGA90
video capturing, as well as stills capture.
It also supports a selection of applications that are based on command line operations for
stills and video output which deliver some of the characteristic features that one might
find on a compact camera such as image resizing, quality of image compression, exposure
mode, ISO and more. The signal received from the PIR sensor immediately triggers the
camera which then starts recording or taking pictures, the picture is then used to compare
with the ones in the database.
Through the Haar Cascade algorithm, the processed image is identified with the ones in
the database of registered members through the comparison of the facial structure of the
person in the frame with that of the registered users added in the database, if no match
is found that person in the frame is classified as an intruder and then the GSM module is
instructed to quickly send an alert via text message or e-mail to the owner. However, if a
match is found the camera stops its recording and the sensor is reset to keep checking for
any sort of motion thus avoiding any extra media clips from getting and therefore saving
a considerable amount of memory.
CHAPTER 6
TESTING
The purpose of testing is to discover errors. Testing is the process of trying to discover
every conceivable fault or weakness in a work product. It provides a way to check the
functionality of components, subassemblies, assemblies and/or a finished product it is the
process of exercising software with the intent of ensuring that the Software system meets
its requirements and user expectations and does not fail in an unacceptable manner.
There are various types of test. Each test type addresses a specific testing requirement.
TYPES OF TESTS
6.1 UNIT TESTING
Unit testing involves the design of test cases that validate that the internal program logic
is functioning properly, and that program inputs produce valid outputs. All decision
branches and internal code flow should be validated. It is the testing of individual software
units of the application .it is done after the completion of an individual unit before
integration. This is a structural testing, that relies on knowledge of its construction and is
invasive. Unit tests perform basic tests at component level and test a specific business
process, application, and/or system configuration. Unit tests ensure that each unique path
of a business process performs accurately to the documented specifications and contains
clearly defined inputs and expected results.
Serial Number TC 01
Serial Number TC 02
Serial Number TC 03
CHAPTER 7
SCREENSHOTS
CHAPTER 8
FUTURE SCOPE
As we see the project improves upon some of key issues that are present in the current
system by leveraging the knowledge of recent technologies available to us but in the
modern era technology is ever changing and hence there are always new possibilities
available to work upon and innovate something even better. Each project has a possibility
of being superior to the present version. The upgrade can be as User Interface
amplification, processing enhancements, innovation change, effectiveness
improvements, including greater functionality and so on. One of the primary ideas is to
better the User Interface. The current UI is a rather dull version which could be redesigned
which will make it progressively functional as providing significantly more options and give
the users a more immersive and user friendly experience.
The camera setup can be improved as even though the current camera has a decent
enough field-of-view with a viewing angle of around 120 degrees, having a 360 degree
camera would be a huge improvement and would guarantee continuous situational
awareness leaving no room for any blind spots to get through whatsoever. This would also
help in attaining higher cost reductions in building the setup as in the current scenario we
would need to attach multiple cameras in order to attain a 360 degree viewing angle. The
camera in the current setup might not work properly at night or in low lit conditions, so
this opens the room for implementing night vision cameras. The database setup could also
be improved by implementing concepts of cloud computing to create the database online,
so in the worst scenario if the camera or the raspberry pi itself sustains some sort of
internal or physical damage the data captures would still be safe online.
CHAPTER 9
CONCLUSION
The Surveillance system implemented using Raspberry Pi makes use of a motion
detection sensor and Pi-cam. This method is widely used because of its features and
capabilities. When a motion is detected the system captures and sends a notification.
This smarter surveillance system makes use of IOT concepts. The concept of Machine
learning is used for facial recognition and image processing. High definition videos are
captured using PI camera. The result of testing the above application illustrates that
the Monitoring system works well, and this can be used as a security mechanism in
any field of work. This system is not only user-friendly but also follows an efficient
approach. The system can be implemented by anyone if a series of steps are followed
and consists of the latest advancements in technologies.
REFERENCES
[1] Pawan Kumar Mishra and G. P. Saroha, “A study on Video Surveillance System for
Object Detection and Tracking”, in IEEE International Conference on Computing for
Sustainable Global Development. IEEE, 2016.
[2] R. V. Prasad Bhookya and Nitesh Gaikwad, “IOT Based Secured Home Automation
Using Raspberry Pi,” International Journal of Ethics in Engineering & Management
Education (IJEEE), March 2017.
[3] Federal Bureau of Investigation’s Uniform Crime Reporting (UCR) Program Archives.
2018, from https://ucr.fbi.gov/crime-in-the-u.s/2018/crime-in-the-u.s.-2018/topic-
pages/burglary.
[4] Ronda Kaysen. Do Security systems make your home safer. 2017, Dec 22
from https://www.nytimes.com/2017/12/22/realestate/do-security-systems-make-
your-home-safer.html.
[5] Burglary Statistics: The Hard Numbers of Home Invasion, 2015 from
https://www.alarms.org/burglary-statistics/.
[6] Kasey Tross, The Beginner’s Guide to Motion Sensors. 2019, Oct 9, from
https://www.safewise.com/resources/motion-sensor-guide/.
[7] Introduction to Open CV, from https://docs.opencv.org/master/d1/dfb/intro.html.
[8] Introduction to Raspberry Pi, from https://www.electronicwings.com/raspberry-
pi/raspberry-pi-introduction.
[9] Introduction to Machine Learning, from https://www.geeksforgeeks.org/getting-
started-machine-learning/