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

Theft Identification - Alert Through Motion Detection - Facial Recognition Using IOT - Report

This project report describes a theft identification and alert system using motion detection, facial recognition, and IoT. The system uses a Raspberry Pi connected to a camera to capture images and perform facial detection and recognition using OpenCV. When an unauthorized person is detected, the system will send an alert via GSM module. The goal is to provide a more efficient and cost-effective security solution compared to traditional CCTV systems. The report includes the literature survey, requirements analysis, system design, implementation details, testing procedures, and screenshots of the output. Future work may focus on improving the facial recognition algorithms.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
232 views

Theft Identification - Alert Through Motion Detection - Facial Recognition Using IOT - Report

This project report describes a theft identification and alert system using motion detection, facial recognition, and IoT. The system uses a Raspberry Pi connected to a camera to capture images and perform facial detection and recognition using OpenCV. When an unauthorized person is detected, the system will send an alert via GSM module. The goal is to provide a more efficient and cost-effective security solution compared to traditional CCTV systems. The report includes the literature survey, requirements analysis, system design, implementation details, testing procedures, and screenshots of the output. Future work may focus on improving the facial recognition algorithms.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

PROJECT REPORT

ON

“THEFT IDENTIFICATION & ALERT THROUGH MOTION DETECTION


AND FACIAL RECOGNITION USING IOT“

Submitted in partial fulfillment for the award of the degree of

BACHELOR OF ENGINEERING

IN

COMPUTER SCIENCE AND ENGINEERING

BY

KRISHNA VINEETH P (1NH16CS052)


NASIR HASAN DILAWAR (1NH16CS069)
NITHINDRA D (1NH16CS075)

Under the guidance of

Mr. GAGAN S PURAD


Assistant Professor,
Dept. of CSE, NHCE
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

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.

………………………… ……………………….. ………………………………


Signature of Guide Signature of HOD Signature of Principal
(Mr. Gagan S Purad) (Dr. B. Rajalakshmi) (Dr. Manjunatha)

External Viva

Name of Examiner Signature with date

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 take this opportunity to express my profound gratitude to Dr. Manjunatha, Principal


NHCE, for his constant support and encouragement.

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.

Finally, a note of thanks to the teaching and non-teaching staff of Department of


Computer Science and Engineering, for their cooperation extended to me, and my friends,
who helped me directly or indirectly in the course of the project work.

KRISHNA VINEETH P (1NH16CS052)


NASIR HASAN DILAWAR (1NH16CS069)
NITHINDRA D (1NH16CS075)

II
CONTENTS

CHAPTER NO TITLE PAGE NO


ABSTRACT I
ACKNOWLEDGMENT II
LIST OF FIGURES V
1 INTRODUCTION 1-3
1.1 Problem Definition 2
1.2 Project Features 3
2 LITERATURE SURVEY 4-18
2.1 Machine Learning 6
2.2 Internet of Things 9
2.3 Existing System 11
2.4 Proposed System 11
2.4.1 Open CV 13
2.4.2 Face Detection 15
2.4.3 Face Recognition 16
2.4.4 Haar Cascade Classifier 17
3 REQUIREMENT ANALYSIS 19-26
3.1 Functional Requirements 19
3.2 Non Functional Requirements 20
3.3 Hardware Requirements 21
3.3.1 Raspberry Pi 22
3.3.2 Pi Cam 23
3.3.3 GSM Module 24
3.3.4 Passive Infrared Sensor 25
3.4 Software Requirements 26
4 DESIGN 27-33
4.1 Design Goals 27
4.2 System Architecture 28
4.3 Dataflow Diagram 29
4.4 Sequence Diagram 30
4.5 Flowchart 31
4.6 Use case Diagram 33

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

Dept. of CSE, NHCE Page 1


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

1.1 PROBLEM DEFINITION


Security plays an essential role in every sector, be it banks, restaurants or any IT industry,
all of them need to be kept safe, but it is not possible to keep a track of everything. In this
modern era it is a primary concern for everyone not only in India but globally, for instance,
in UK, a new insurance claim is made every six minutes following a car theft while in USA,
on an average, more than 3500 bank related crimes are reported every year. This is an
indication that the security system currently available like pass through magnetic security
gates and CCTV cameras are not enough to prevent unwanted events and therefore an
upgrade is needed. The project aims at providing a desirable solution by taking advantage
of machine learning and IoT thereby providing a more improved surveillance system that
can identify as well as inform about any kind of theft or unwanted activities occurring in
the vicinity.

Dept. of CSE, NHCE Page 2


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

1.2 PROJECT FEATURES


• Achieve better image processing in CCTV cameras.
• Provide an arrangement to track and alert upon noticing any criminal activity.
• Reduction of expenses usually spent on security equipment and staff.
• Assemble an automated and accurate 24/7 surveillance system to eliminate
the need for visually monitor entry points, perform security checks and view
security cameras.

Dept. of CSE, NHCE Page 3


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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

Dept. of CSE, NHCE Page 4


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

Dept. of CSE, NHCE Page 5


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

2.1 MACHINE LEARNING

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.

Often referred to as predictive analytics, Machine Learning is very much relatable to


computational statistics whose main focus is to generate inferences through predictions
made by computer systems. It is a lot different from traditional programming as in
traditional programming, you are supposed to layout the set of instructions and provide
the input and then verify the output generated while on the other hand the approach
taken by Machine Learning is quite different, here the input (training data) is provided
and the algorithms plan out models to come up with a solution to with higher accuracy.

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

Dept. of CSE, NHCE Page 6


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

Fig 2.1 Supervised Learning

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.

Dept. of CSE, NHCE Page 7


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

Fig 2.2 Unsupervised Learning

Reinforcement Learning: This learning algorithm is somewhat like Supervised Learning,


mostly in terms of receiving the feedback signal. It allows the network to automatically
conclude the ideal behavior in order to maximize its performance. It works in a way such
that the network/machine is opened up to a setting where, through trial and error it trains
constantly trains itself. This way the machine tries to attain the best possible knowledge
from past experience and thence learns to make more precise judgments.

Fig 2.3 Reinforcement Learning

Dept. of CSE, NHCE Page 8


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

2.2 INTERNET OF THINGS

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

Dept. of CSE, NHCE Page 9


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

Dept. of CSE, NHCE Page 10


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

2.3 EXISTING SYSTEM

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.

2.4 PROPOSED SYSTEM

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

Dept. of CSE, NHCE Page 11


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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

Dept. of CSE, NHCE Page 12


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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

Dept. of CSE, NHCE Page 13


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

• Photogrammetry is obtaining accurate measurements from images.


• Image Processing is for Image Manipulation.
• Pattern Recognition is a method for classifying different patterns.

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.

Fig 2.4 Open CV Structure

Main library modules of OpenCV are:


• Core Functionality
• Image Processing
• Calib3d
• Video

Dept. of CSE, NHCE Page 14


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

• Video I/O
• Highgui
• Objdetect
• Features2d

Some of the Applications of Open CV include:


• Gesture recognition
• Augmented Reality
• Mobile Robotics
• Structure from Motion
• Segmentation and Recognition

2.4.2 FACE DETECTION


It is a computer technology technique that is used to identify/Detect faces of humans in
digital Images. It is a special case of Object-Class detection. The main objective of Object-
Class detection is to locate the objects and determine size from an image that may belong
to a class specified. The algorithm is uses frontal human faces for detection. It is an
analogous approach to validate the image of a person. This approach of facial detection
is based on Genetic algorithm and Eigen face technique. It first detects the eyes in grey
level image and once it matches, the genetic algorithm generates and matches other face
regions. It includes a lot of applications, few are: Biometrics, Security, Law enforcement,
and so on.
Face detection methods can be classified based on Features, Appearance, Knowledge and
Template matching.
Detection based on Knowledge– It is related to how Humans knowledge can be used to
detect faces and it depends on set of rules.
Detection based on Features– This is used to locate / detect faces by extracting the facial
structural features.
Template Matching – This makes use of pre-defined and parameterized face templates
to detect faces by the correlation of templates and input images.

Dept. of CSE, NHCE Page 15


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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

2.4.3 FACE RECOGNITION


A Biometric process of uniquely verifying and identifying a person by pattern analysis of
facial contours. This has evolved with a new approach called 3D modelling. This does not
require interaction with another person for identifying. This approach can be used
accurately to identify a person with information of known faces in a database. This is of
non-contact nature type. This is less expensive technique compared to biometric
approach. But this is less effective when there is insufficient lightning and when the facial
expression differs or vary.
A set of steps are followed to verify the identification of a person. They are:
• Detection – Done by scanning a 2D image or a video image retrieved from a live
picture.
• Alignment – Determine pose of a person, size and head position.
• Measurement – Determine the curves on a face in a sub-millimeter scale and
create templates.
• Representation – The template generated in the previous step is converted to a
unique code.
• Matching – A software is used to compare the images with a database to get a
match.

Dept. of CSE, NHCE Page 16


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

• 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.

2.4.4 HAAR CASCADE CLASSIFIER


This is an object detection method which uses Machine learning. The detection method
or the classifier is trained with multiple images to detect the object accurately. Based on
the training provided features are extracted and then the object is identified.
Haar Cascade classifier is trained by imposing the positive images over a number of
negative images. In this classifier there are adjacent blocks (or rectangles) in a detection
window. The pixel intensity of each block is summed up and the difference between the
sums is calculated.

Fig 2.5 Haarcascade Classifier

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

Dept. of CSE, NHCE Page 17


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

Fig 2.6 Haarcascade Classifier Steps

Dept. of CSE, NHCE Page 18


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

CHAPTER 3
REQUIREMENT ANALYSIS

3.1 FUNCTIONAL REQUIREMENTS


A functional requirement defines a system or its component in software engineering. It
describes the functions to be performed by software. A function is nothing more than
inputs, behavior, and outputs. It can be a calculation, manipulation of data, business
process, user interaction, or any other specific functionality that define what a system is
likely to perform.
Functional requirements for software help you capture the system's intended behavior.
This behavior can be expressed as functions, services or tasks, or which system needs to
be performed.
A Functional Condition is a condition that allows the user to perform some kind of
operation when it is met. For example: "The customer should place an order within two
minutes of registration" For the most part, when people talk about business
requirements, they refer to functional requirements that are generally referred to as
"functional requirements have the following characteristics that use simple language that
is not vague.
The official definition of a functional requirement specifies what the system should do "A
requirement specifies a function that a system or component must be able to perform."
Functional requirements specify specific behaviors or functions, such as: "Display a
patient's heart rate, blood pressure and temperature connected to the patient monitor."
Here, the system has to perform the following tasks:
● Register users by taking user-id and name along with pictures taken from the
camera.
● Detect motion by sensing change in temperature within the field of view.
● Alert Pi Camera to start recording upon receiving alerts from PIR sensor.
● Match user images and id with corresponding database entries, if a match is found
then continue else raise classify the person in frame as unknown.
● Send alerts to the owner if an intrusion is observed.

Dept. of CSE, NHCE Page 19


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

3.2 NON FUNCTIONAL REQUIREMENTS


The quality attributes of a software system is defined by a non-functional requirement.
They are a set of standards used to judge a system's specific operation. For example, how
fast is the loading of the website?
To ensure the usability and effectiveness of the entire software system, a non-functional
requirement is essential. Failure to meet non-functional requirements may lead to
systems failing to meet user requirements.
Non-functional requirements enable you to impose restrictions or restrictions on system
design across the different agile backlogs. For example, if the number of simultaneous
users is > 10,000, the site should load in 3 seconds. Non-functional requirements
description is just as critical as a functional requirement.

• 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.

Dept. of CSE, NHCE Page 20


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

• 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 HARDWARE REQUIREMENTS


• Raspberry Pi 3
• Pi Cam
• GSM Module
• PIR Sensor

Dept. of CSE, NHCE Page 21


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

Fig 3.1 Raspberry Pi

Dept. of CSE, NHCE Page 22


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

Fig 3.2 Pi Cam

Dept. of CSE, NHCE Page 23


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

3.3.3 GSM MODULE


Global System for Mobile communication (GSM) is a standard developed by the European
Telecom Standards Institute(ETSI). It was made to describe the protocols for second-age
(2G) cellular networks utilized by cell phones and is currently the default worldwide
standard for versatile interchanges – with over 90% piece of the overall industry, working
in more than 219 nations and domains.

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.

Fig 3.3 GSM Module

Dept. of CSE, NHCE Page 24


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

3.3.4 PASSIVE INFRARED SENSOR


The PIR (Passive Infrared) sensor works on the basic principle of physics which states that
any object with an overall temperature above zero is bound to emit heat in the form of
radiation, but the radiation is at infrared wavelengths and therefore is impossible to
detect by the human eye, for this purpose devices such as these are used in burglar
alarms, automated lighting system etc. Once turned on the PIR sensor catches any sort of
change in the amount of radiation for example, if an object comes in front of the
background at that point in the field of view there is a sudden rise and fall in temperature
as it goes from room temperature to the object’s body temperature and back again to the
room temperature. This change in the incoming radiation signal is converted to output
voltage which in turn triggers the detection. There are two main things that help this HC-
SR501 PIR sensor achieve this is the Pyroelectric crystal which does the work of detecting
the heat from moving bodies and then there is Fresnel lens which sits on top of the crystal
that helps focus the light and control the angle for the field of view.

• Operating temperature from -20° to +80° Celsius


• Can differentiate between human movement and object movement.
• Can cover a distance of 120 degrees and 7 meters.
• Has a low power consumption.

Fig 3.4 PIR Sensor

Dept. of CSE, NHCE Page 25


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

3.4 SOFTWARE REQUIREMENTS


• Operating System: Linux based Raspbian OS
Raspbian is a Debian-based computer operating system for Raspberry Pi. There are
several versions of Raspbian including Raspbian Buster and Raspbian Stretch. Since
2015 it has been officially provided by the Raspberry Pi Foundation as the primary
operating system for the family of Raspberry Pi single-board computers.

• 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.

Dept. of CSE, NHCE Page 26


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.1 DESIGN GOALS


• Security - The data is securely stored in a Computer File System and if there is a
motion detected it is compared with the Data in the system.
• Accuracy and Efficiency - If the detected faces match the database no action
should take place and if it doesn’t match based on the accuracy an Email alert
should be sent immediately
• Availability- The system should perform the respective functionalities at all times.

Dept. of CSE, NHCE Page 27


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

4.2 SYSTEM ARCHITECTURE


The below figure illustrates the system architecture of the system in the discussion. The
below figure illustrates all the important components in the building of the application
and shows the understanding of how the system will be played out and the important
building blocks of the application.

Fig 4.1 System Architecture

Dept. of CSE, NHCE Page 28


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

4.3 DATAFLOW DIAGRAM


A data flow diagram (DFD) maps out the progression of data for any procedure or
framework. It uses characterized images like square shapes, circles and bolts, in addition
to short content names, to show information inputs, yields, stockpiling focuses and the
courses between every goal. Information flowcharts can go from straightforward, even
hand-drawn procedure outlines, to inside and out, staggered DFDs that delve logically
more profound into how the information is taken care of. They can be utilized to
investigate a current framework or model another one. Like all the best graphs and
outlines, a DFD can frequently outwardly "say" things that would be difficult to clarify in
words, and they work for both specialized and nontechnical spectators, from designer to
CEO. That is the reason DFDs remain so mainstream after such a long time.

Fig 4.2 Dataflow Diagram

Dept. of CSE, NHCE Page 29


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

4.4 SEQUENCE DIAGRAM


A sequence diagram shows object interactions arranged in time sequence. It depicts the
objects and classes involved in the scenario and the sequence of messages exchanged
between the objects needed to carry out the functionality of the scenario. Sequence
diagrams are typically associated with use case realizations in the Logical View of the
system under development.

Fig 4.3 Sequence Diagram

Dept. of CSE, NHCE Page 30


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

4.5 FLOWCHART

Fig 4.4 Flowchart – Motion Detection

Dept. of CSE, NHCE Page 31


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

Fig 4.5 Flowchart – User Registration

Dept. of CSE, NHCE Page 32


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

4.6 USE CASE DIAGRAM

Fig 4.6 Use Case Diagram

Dept. of CSE, NHCE Page 33


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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

Dept. of CSE, NHCE Page 34


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

Dept. of CSE, NHCE Page 35


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

Fig 5.1 Hardware Connection

Dept. of CSE, NHCE Page 36


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

6.2 INTEGRATION TESTING


Integration tests are designed to test integrated software components to determine if
they actually run as one program. Testing is event driven and is more concerned with the
basic outcome of screens or fields. Integration tests demonstrate that although the
components were individually satisfaction, as shown by successfully unit testing, the
combination of components is correct and consistent. Integration testing is specifically
aimed at exposing the problems that arise from the combination of components.

Dept. of CSE, NHCE Page 37


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

6.3 VALIDATION TESTING


An engineering validation test (EVT) is performed on first engineering prototypes, to
ensure that the basic unit performs to design goals and specifications. It is important in
identifying design problems, and solving them as early in the design cycle as possible, is
the key to keeping projects on time and within budget. Too often, product design and
performance problems are not detected until late in the product development cycle —
when the product is ready to be shipped. The old adage holds true: It costs a penny to
make a change in engineering, a dime in production and a dollar after a product is in the
field.
Verification is a Quality control process that is used to evaluate whether or not a product,
service, or system complies with regulations, specifications, or conditions imposed at the
start of a development phase. Verification can be in development, scale-up, or
production. This is often an internal process.
Validation is a Quality assurance process of establishing evidence that provides a high
degree of assurance that a product, service, or system accomplishes its intended
requirements. This often involves acceptance of fitness for purpose with end users and
other product stakeholders.

6.4 SYSTEM TESTING


System testing of software or hardware is testing conducted on a complete, integrated
system to evaluate the system's compliance with its specified requirements. System
testing falls within the scope of black box testing, and as such, should require no
knowledge of the inner design of the code or logic.
As a rule, system testing takes, as its input, all of the "integrated" software components
that have successfully passed integration testing and also the software system itself
integrated with any applicable hardware system(s).
System testing is a more limited type of testing; it seeks to detect defects both within the
"inter-assemblages" and also within the system as a whole.
System testing is performed on the entire system in the context of a Functional
Requirement Specification(s) (FRS) and/or a System Requirement Specification (SRS).

Dept. of CSE, NHCE Page 38


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

6.5 TEST CASES

Serial Number TC 01

Module Under Test User Registration

Description When the registration page is loaded,


should enable the camera and capture
Input Application started

Output An image along with user details displayed


Remarks Test Successful.

Serial Number TC 02

Module Under Test Camera , PIR Sensor , GSM Module

Description When a motion is detected , should capture


images and alert user if not found in
database

Input Motion detected and camera starts


capturing and person not in database

Output Alert sent to Owner

Remarks Test Successful.

Dept. of CSE, NHCE Page 39


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

Serial Number TC 03

Module Under Test Camera, PIR Sensor , GSM Module

Description When a motion is detected , should capture


images and alert user if not found in
database
Input Motion detected and camera starts
capturing and person is registered in
database
Output An image along with user details displayed
Remarks Test Successful.

Dept. of CSE, NHCE Page 40


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

CHAPTER 7
SCREENSHOTS

Fig 7.1 Notification for Unauthorized user

Fig 7.2 Unauthorized user

Dept. of CSE, NHCE Page 41


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

Dept. of CSE, NHCE Page 42


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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.

Dept. of CSE, NHCE Page 43


Theft Identification & Alert through Motion Detection & Facial Recognition using IOT

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/

Dept. of CSE, NHCE Page 44

You might also like