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.
4.4 Summary
In this chapter, all the implementation process of the Surveillance Camera with Image Recognition and Notification were state clearly. The testing process and the result also can be viewed. The phase of implementation and testing, able to show the achievement of this project.
37 Chapter 5
CONCLUSION
5.1 Introduction
This chapter will discuss about the project contribution, project discussion, limitation and recommendation of Surveillance Camera with Image Recognition and
Notification.
5.2 Project Contribution
This project, Surveillance Camera with Image Recognition and Notification developed to improve the existing surveillance camera in the marker with the implementation of image recognition and notification. These two features are very useful in order to help user to be aware of the existing of intruder in their properties.
5.3 Project Discussion
The idea of this project is from the arising issues of the existing security camera that cannot prevent the threat or attack. This implementation of the image recognition and notification into security camera will help to solve this problem. The rapid growth of technology nowadays had made the IOT not anymore an expensive stuff. This project
38
is designed with low cost material but still can compete with overpriced security camera that exist in the market.
This project use a few hardware and software to function perfectly. The main hardware is Raspberry Pi 3 power by Raspberry PI operating system that being install in the SD card and connected with camera, PIR sensor, and power bank and also associated to Telegram via Internet. This project also used Python as the programming language and OpenCV and Tensor Flow to implement the CNN into the Raspberry PI.
Other than that, the methodology that be used to develop Security Camera with Image Recognition and Notification is Waterfall model. The step in each stage are specifically stated and will not overlap with the next or previous steps. The algorithm that be used in image recognition is Convolutional Neural Network, 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.
5.4 Limitation and Recommendation
This project is developed to help user to felt more secure and peace in mind. The image recognition and notification are very helpful to this project. However, this project has its own drawback which is the web camera will not capture the best image especially when the light is dim. The improvement can be done such as use more high resolution or Megapixel camera [18]. Other than that, the coverage for the sensor to detect motion is quite small, 5 meter. This can be improved by using a much more sensitive PIR sensor. Furthermore, the surveillance can be upgrade by adding more features to it such
39
as allow telegram command to record video and off the alarm when human detected near the camera.
5.5 Future work
The high demand of CCTV system for public spaces, business and homes today’s, drive the security companies to develop and adopt more advance features into the CCTV that more suitable and fulfil the requirement need by the users. These advancements such as camera with facial recognition software, door-screening process including biometrical authentication like fingerprints and retina scans will make the security system more secure and cannot be breach. Installing these unique trends into surveillance system will give the new era for security system.
5.6 Summary
As the conclusion, Surveillance Camera with Image Recognition and Notification is the best project to improve the existing security camera. This project will be a successfully function only if when all the step and requirement are followed. The existing project related to this project can be a good guidance in order to proof that this project can physically build.
40
3. Sameerchand Pudaruth, Faugoo Indiwarsingh and Nandrakant Bhugun (2013). A Unified Intrusion Alert System Using Motion Detection and Face Recognition.
2nd International Conference On Machine Learning and Computer Science(imlcs'2013).
4. Suman Pandit, Shakyanand Kamble, Vinit Vasudevan (2015). Home Security Alarm System Using Arduino. Vidyalankar Institute of Technology Wadala (E), Mumbai - 400 037.
5. ] Danny Thakkar, 2015. Problems with Current Security Systems That You Should Know. https://www.bayometric.com/problems-current-security-systems/.
Accessed on 11 November 2020.
6. Nico Suranthaa, Wingky R. Wicaksonob (2018). Design Smart Home Security System Using Object Recognition and PIR Sensor. Procedia Computer Science 135 (2018) 465–472
41
7. Manoranjan Paul, Shah M E Haque & Subrata Chakraborty (2013). Human Detection in Surveillance Videos and Its Applications. EURASIP Journal On Advances in Signal Processing Volume 2013, Article Number: 176 (2013) 8. R F Rahman and I D Sumitra (2020). Realtime Notifications On Visitor Tracking
Systems Using Android and Arduino. IOP Conf. Ser.: Mater. Sci. Eng. 879 012062.
9. Zakaria Rada (2016). Smart Motion Detection: Security System Using Raspberry Pi. Journal Of The Engineering Research Institute Vol. 30. 1.
10. Joseph A Bosman, Ipek Ozil, Steven Olivieri, Brandon C. Steacy (2017). Design Of A Completely Wireless Security Camera System. University Of Limerick Limerick, Ireland
11. https://www.computerworld.com/article/2576450/app-development-system-development-life-cycle.html
12. OpenCV team. (2021, JANUARY) About OpenCV. Retrieved from https://opencv.org/about/. Accessed on 1 January 2021.
13. Tristan Greene. (2016, FEB). A beginner’s guide to AI: Computer vision and image
recognition, p.1. Retrieved from
https://medium.com/datadriveninvestor/introduction-to-how-cnns-work-77e0e4cde99b. Accessed on 11 November 2020.
14. Mingyuan Xin and Yong Wang. (2019, FEBRUARY). Research on image classification model based on deep convolution neural network. Springer Open.
15. Nicola Basta (2020, April) The Differences between Sigmoid and Softmax Activation Functions. Retrieved from https://medium.com/arteos-ai/the-differences-
between-sigmoid-and-softmax-activation-function-42
12adee8cf322#:~:text=Softmax%20is%20used%20for%20multi,in%20the%20Log istic%20Regression%20model. Accessed on 1 January 2021.
16. Tech Target Contributor. (2018, November). Proof of Concept (POC). Retrieved from https://searchcio.techtarget.com/definition/proof-of-concept-POC. Accessed on 1 January 2021.
17. Lisa Johnston. (2020, June). What You Need to Know Before You Buy a Webcam Retrieved from https://www.lifewire.com/before-you-buy-a-webcam-2640480.
Accessed on 12 January 2021.
43 Appendix 1
Gantt chart
Semester 1 2020/2021
1 2 3 4 5 6 7 8 9 10 11 12 13 14 Final Year Project I
Briefing
Workshop - Proof of Concept (POC) Methodology
44 Workshop- Final Year
Project Format Writing Drafting Report of Proposal
Submit Draft of Report to Supervisor
Preparation for Final Presentation and Final Report Submission Final Presentation and Panel’s Evaluation Final Report Submission and Supervisor’s
Evaluation
45
Documentation of the Project Project Meeting with
Final Year Project Format Writing Workshop
Submit Draft Report and Documentation of the Project
Submit Poster and Preparation for Final Presentation
46
Seminar/Final Presentation and Panel’s Evaluation
Final Thesis Submission and Supervisor’s Evaluation