• Tidak ada hasil yang ditemukan

With extensive implementation of security systems, it has become vital that these systems to work as predictable. The objective of this project are:

1. To design and develop a security camera that cheaper compared to security systems in the market by using raspberry pi and web camera. [6]

2. To develop a security camera that will reduce the false alarm by using image recognition method to verify any motion object detected by motion sensor. [4]

3. To develop security camera that will give owner notification when any motion detected and verified. This will help owner to any intruder detected in their properties. [7]

4 1.4 Scope

• Developing an embedded system with the implement of image recognition algorithm.

• The design architecture, the structure of the embedded system and the programming skill are included in this project.

• The detection by sensors to detect motions and sense surroundings and the camera will capture the image.

• When the image captured, (image will be store offline) the phase of image recognition works.

• Notification will be send to the owner via telegram, when the image recognition finish. The notification will verify either the image is an animal or human.

1.5 Limitation of work

Even the security camera with image recognition and notification is the precise solution, this project still has its own limits.

The first limitation is this camera is not suitable for large area as the motion detector only can detect an intruder in a certain distant. The image of criminal off the range will not be capture and no notification will be send thus this camera are limited for a small area.

The next drawback is the notification will only be send and received if only the devices and camera are connected to internet. If the internet connection has problem, the notification will not be send by the camera.

Besides, the web camera than be used will produce a low image quality. The image will not be clear especially when the lighting is dim.

5 1.6 Expected result

A product that can function according to the requirement which is a security camera that give notification via telegram when the PIR sensor detect any movement.

The camera can capture picture of the moving object and the image can be verifying by using image recognition method that use Convolutional Neural Network Algorithm.

1.7 Thesis structure

This report contained 4 chapter which is Chapter 1, Introduction. This chapter will discuss about the background of this project, the problem statement, objective and scope that involved in developing this project. Chapter 2 is literature review. It is an assessment of previous study that related to this project, showing that there are gaps that this project will attempt to fill. Chapter 3 is about the methodology used in developing this project. Waterfall model is used to develop this project in a sequential order. Chapter 4 is conclusion. This chapter will state the expected result of the final result, the improvement that need to be done to this project.

6 Chapter 2

LITERATURE REVIEW

2.1 Introduction

Nowadays, most of current security video surveillance systems depend on human observer for detecting any suspicious activities or event in a real time video scene.

However, everybody knows that human capability is limited than machines [8]. Thus, there will be mistake in monitoring simultaneous events in surveillance displays. The suspicious event may not be notice and then the use of security camera will be useless in preventing crime. Hence, there are a lot of research made to improve the existing security system in order to meet the expected result by the users.

2.2 Table of Literature Review

7 Year

Title Author

Objective Methodology Advantage

Disadvantages Comparison with this Project

The goal of this project is to develop a low-cost remote surveillance system using the Raspberry Pi platform.

Additional features such as monitoring the video feed and controlling the angle of the camera for developed and increase the capabilities of the surveillance system.

• Supply power adapter

• Software: Wife and

8 alarm that detects when someone enters the area.

When an intruder is detected, it activates a siren.

9

This research aims to design and implement a home security system with the capability for human detection design was to develop a network that allowed for the transmitting and

10 Table 2.1: Literature Review

Joseph A Bosman, Ipek Ozil, Steven Olivieri, Brandon C.

Steacy

from camera nodes to a base station. and its applications - a review [7]

To present the detection technique that can be used in security camera

Techniques:

 Object detection - Background subtraction - Optical flow

- Spatio-temporal filter

 Object classification - Shape-based method

11 2.3 Summary

There are plenty of reports on making CCTV for security reason. Each of the product had its own benefits and disadvantages. This successful project need to be study to developed a Surveillance camera with image recognition and notification that can meet the expectation of user.

12 Chapter 3

METHODOLOGY

3.1 Introduction

SDLC, or Software Development Lifecycle, is used to plan project activities in a sequential order to achieve the end product. Each phase is associated with subsequent phases where output from one phase of SDLC acts as input to the next phase. The main phases of SDLC are: requirement, design, coding, testing, and maintenance. [11]

3.2 Waterfall Model

There are a few of famous SDLC model such as waterfall, agile, prototype and spiral model. In this project, the model that been used is waterfall. Waterfall is a sequential model that divides software development into pre-defined phases where each phase must be completed before the next phase can begin with no overlap between the phases. 5 steps required in this method is requirement gathering, design, implementation, verification or testing and maintenance.

The end goal is defined early with the Waterfall model and the entire process i s laid out from beginning to end. This makes the project appear clearer and more orga nized on the surface.

13

Figure 3.1: Stage of Waterfall Model

3.2.1 Requirement

In step requirement, the wide information about what this project requires will be gather. A variety of ways used to gather this information, from mind mapping to interactive brainstorming and analysing the existing project. Reviewing the present project in the market can help to understand the system and its current state. By the end of this phase, the project requirements should be clear.

14 3.2.2 Design

Next in design, the system will be design by using the information gathering.

The software and hardware that will be use are listed. No coding takes place but the programming language decided.

Programming language: Java

Software list Hardware List

Open CV Raspberry pi 3

Telegram Pi camera

PyCharm PIR motion sensor

TensorFlow Power Bank – power supply

Raspberry Pi Operating System SD card - temporary database Table 3.1: List of hardware and Software

Figure 3.2: System Block Design for this project Raspberry PI 3

Power bank

SD Card Pi Camera

PIR motion sensor Internet

Telegram

15

Security Camera with Image Recognition and Notification are consist of software and hardware to function.

The software will be used in this project is Telegram, a mobile application. The system will capture image and start image recognition when motion detected. The system will send the owner massage via Telegram to notify him after the image recognition finish.

OpenCV (Open Source Computer Vision Library) are used in this project to code the image recognition algorithm. It is an open source computer vision and machine learning software library. [12]

Hardware that used in this project are Raspberry PI 3, power bank, SD card, Web Camera and PIR motion sensor. Raspberry PI 3 will be responsible to process all the workload. PIR will detect the motion and web camera will capture the image when motion detected. The image will be save offline into the SD Card that will act as a database. The image recognition will start and the result will be send to the owner via Telegram.

3.2.3 Implementation

The third stage is implementation. This phases required information from the previous stage and create a functional product. The programming and physical implementation will take place in this stage.

16 3.2.4 Verification

Stage 4, verification is a phases where the testing begins when implementation done. The testing is crucial to find issues and problem arises. This stage will be a benchmarking in order to continue next phases or return to phase one for re-evaluation.

The project work need to work as the stated by the expectation of the final project. All the hardware will be test to make sure its work. If any problem found, the hardware will be check.

3.2.5 Maintenance

Maintenance is the last but not least phase, the product has been delivered and is being used. If any problems occur, the project need to be fixed and updated may be required.

17 3.3 Framework

Project Environment or System Design

Figure 3.3: Framework of this project

All the hardware such as SD card, Web Camera, PIR motion sensor and power bank will be connected to Raspberry PI 3 in its own place. The notification will be send to user by Telegram via Internet.

18 3.4 Flowchart

Figure 3.4 Flowchart of this project PIR sensor detect motion

start

Motion detected

Capture image

Save into the SD card

Send Notification

stop

NO

YES

Image recognition method

19

Start. PIR sensor will detect motion in a specific range. If the is no motion detect, the system will go back to detect motion. Web Camera will capture the image.

The image will be save offline in SD card. The image recognition algorithms start.

When image recognition finish, the system will send notification to user via Telegram.

The notification will define the object in the image. System Stop.

20 3.5 Sequence Diagram

Figure 3.5: Sequence diagram for this project

user Raspberry PI 3 camera database

Start system

Notify user

PIR sensor

Motion detected

Captured picture

Start image recognition

Compare image

Image Recognition Finish

21

User will start the system with connecting the power bank as a power supply to Raspberry PI 3 that connected with any other hardwares. The PIR sensor will detect any motion that will trigger the web camera to capture image. The image then will be save offline in the database (SD card) and image recognition algorithms will start at Raspberry PI 3. Image will be compare to databased to identify the object in the image. When image recognition finish, user will got notification by Telegram.

3.6 Algorithm for Image Recognition

Image recognition refers to technologies that identify places, logos, people, object, buildings and several other variables in digital images. Recognition may be very simple for human but not for a computer. [13]

CNN refer to Convolutional Neural Network is a Deep Learning Algorithm that can take in an input image, assign importance (learnable weights and biases) to various aspects/objects in the image and be able to differentiate one from the other. In CNN, the pre-processing required is much lower as matched to other classification algorithms. [14]

Figure 3.6: CNN Algorithm

22 3.6.1 Convolution Layer — The Kernel [14]

The convolutional layer or the Kernel is a fundamental building block of CNN.

This is where the majority of the computational heavy lifting occur. Using filters or kernels, the data or image is convolved. Filters are small units that we apply through a sliding window across the data. The depth of the image is the similar as the input, but a filter of depth 4 can also be applied to a colour image with an RGB depth value of 4. For any sliding action, this approach involves taking the element-wise product of filters in the picture and then summing those particular values. A 2d matrix will be the output of a convolution having a 3d filter with colour.

Figure 3.7: Convolutional Layer

Each output value in the feature map does not have to be related to each pixel value in the input image, as you can see in the picture above. It only needs to bind to the area of reception where the filter is being applied. Convolutional (and pooling) layers are generally referred to as "partially connected" layers or described as local connectivity since the output array does not need to map directly to of input value.

23

Notice that as it travels around the image, which is also known as parameter sharing, the weights in the feature detector remain fixed. Some parameters, such as weight values, are modified via the backpropagation and gradient descent phase during preparation. There are, however, three hyperparameters must be set before neural network training begins as it can influence the volume size of the output They include:

1. The number of filter pretentious the depth of the output.

2. Stride, the distance or number of pixels that the kernel travels over the input matrix. A larger stride produces a smaller output while stride values of two or higher are uncommon.

3. Zero-padding is frequently used when the filters do not suitable for the input image.

After each convolution operation, the ReLu (Rectified Linear Unit) is used to increase non-linearity in the CNN by applying the rectifier function. Image are made of multiple object which are not linear to one another.

Eventually, the convolutional layer transforms the image into numerical values, enabling related patterns to be interpreted and extracted by the neural network.

3.6.2 Pooling Layer

Pooling layers, also referred to as downsampling, eliminates dimensionality reduction, minimizing the number of input parameters. The pooling procedure sweeps a filter over the entire input, similar to the convolutional layer, but the difference is that there are no weights in this filter. Inside the receptive field, the kernel applies an

24

aggregation function to the values, populating the output array. Two key ways of pooling exist:

1. Max pooling: It selects the pixel with the highest value to send to the output array as the filter travels over the input. Aside from this, relative to average pooling, this strategy appears to be used more frequently.

2. Average pooling: As the filter travels over the input, it calculates the average value to be sent to the output array within the receptive region.

Figure 3.8: Pooling Layer

3.6.3 Classification Layer

This includes converting the entire pooled feature map matrix into a single column that is then fed for processing to the neural network. To build a model, we combined these features together with the completely linked layers. Finally, to define the output, we have an activation function such as Softmax or Sigmoid. [15]

25 3.7 Proof of Concept (POC)

3.7.1 Introduction

Proof of concept (POC) is an exercise in which work focuses on deciding whether it is possible to transform an idea into a reality. [15] The objective of proof of concept is to evaluate the feasibility of the idea or to test that the idea will function as envisioned.

3.7.2 Proof with existing project

Smart Motion Detection: Security System Using Raspberry PI by Zakaria Rada [9] is the example of function and real project that used notification to alert the owner in his project.

Other than that, Design Smart Home Security System Using Object Recognition and PIR Sensor written by Nico Suranthaa, Wingky R. Wicaksonob [6] show that the object recognition can be implement into security system successfully.

Thus, Security Camera with Image Recognition and Notification can be practically do as there are other projects that used notification and object detection method into their security system project.

26

Figure 3.9: Output expected for this project

Motion detected Camera capture

image

Image recognition engine

Notification to user by telegram Database

27

3.7.3 Installation of software. That will be used in this project.

1. PyCharm for programming language in Python and Raspberry Pi operating system.

Figure 3.10 Installation of PyCharm

Figure 3.11 Installation of Raspberry Pi

28 2. Telegram bot

Figure 3.12 Getting Telegram Bot Token

3.8 Summary

This chapter clarifies the methodology used for Surveillance Camera with Image Recognition and Notification, waterfall methodology. This iterative model is the most suitable methodology for this project as the next step are related to the previous step. The algorithms used in image recognition also stated in this chapter.

This chapter are very precious to the next chapter, Implementation and Design.

29 Chapter 4

IMPLEMENTATION AND RESULT

4.1 Introduction

This chapter will cover the implementation and the result of surveillance camera with image recognition and notification to guarantee that the product is developing

according to the main objective and meet the expectation.

4.2 Implementation of system

The implementation of this project start after the design phase finish. The programming and physical implementation will take place to create a well function product. The hardware first being setup according to the design and then the programming will take place. This surveillance camera with image recognition and notification was developed using python language.

30 4.2.1 Hardware setup

The main piece in this project is raspberry Pi 3 model B+ with the installation of Raspberry Pi operating system or before this being call Raspbian. The operating system has been installed in the SD card and put in the SD card slot in the side of the Raspberry Pi 3. The Raspberry pi also have build-in wireless LAN connectivity which enable this hardware to connect with WIFI. Raspberry Pi Camera v2, a high quality 8 megapixel need to be insert to the camera slot on the raspberry board. The PIR sensor then need to be connected to the bread board and attach to GPIO pin on the raspberry pi. The connection can be done using the jumper wired. To power on the hardware, connect the power bank to the mini USB power input in the raspberry pi 3.

Figure 4.1 Hardware setup based on the design.

31 4.2.2 Programming

To anable all the hardware and send notification via telegram, the

programming took place. This code allow the telegram to start the sensor to detect motion and trigger the camera to snap picture. The picture that will be store in a file and go through the image recognition algorithm. The picture snapped and the name of the object detected will be send to the telegram. In this project, the dataset for image recognition is very simple which is animal and human. Any other object will not be recognize and will be name as unidentifying object.

Figure 4.2 Raspberry Pi desktop

32

Figure 4.3 Code for this Project

4.3 Testing and Result

Figure 4.4 Telegram ‘on’ command to switch on the sensor.

33

The ‘on’ command will enable the sensor to detect any motion, if any motion detected, the camera will start capture picture.

Figure 4.5 Telegram Massage when Animal Detected

Figure 4.6 Telegram Massage when Human Detected

34

Figure 4.7 Telegram Massage when Unidentified Object Detected

Figure 4.8 All image will be save in a file

35

Figure 4.9 imagenew.jpg

Figure 4.10 image1new.jpg

36

All the image capture by the camera will be save in a folder name fyp. To display this folder, connect the raspberry pi 3 to a monitor via the HDMI port. The image captured will be save as image.png and the image after image recognition will be save as imagenew.png. If the image does not contain any human or animal, the image recognition algorithms will not create the new image file.

All the image capture by the camera will be save in a folder name fyp. To display this folder, connect the raspberry pi 3 to a monitor via the HDMI port. The image captured will be save as image.png and the image after image recognition will be save as imagenew.png. If the image does not contain any human or animal, the image recognition algorithms will not create the new image file.

Dokumen terkait