machine learning for disease detection using...
TRANSCRIPT
MACHINE LEARNING FOR DISEASE DETECTION USING RASPBERRY PI
WITH TENSORFLOW IN VEGETABLE FARMS
BY
KHOO WAH JIAN
A REPORT
SUBMITTED TO
Universiti Tunku Abdul Rahman
in partial fulfillment of the requirements
for the degree of
BACHELOR OF INFORMATION TECHNOLOGY (HONS)
COMMUNICATIONS AND NETWORKING
Faculty of Information and Communication Technology
(Kampar Campus)
MAY 2018
UNIVERSITI TUNKU ABDUL RAHMAN
MACHINE LEARNING FOR DISEASE DETECTION USING RASPBERRY PI
WITH TENSORFLOW IN VEGETABLE FARMS
BY
KHOO WAH JIAN
A REPORT
SUBMITTED TO
Universiti Tunku Abdul Rahman
in partial fulfillment of the requirements
for the degree of
BACHELOR OF INFORMATION TECHNOLOGY (HONS)
COMMUNICATIONS AND NETWORKING
Faculty of Information and Communication Technology
(Kampar Campus)
MAY 2018
ii BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
DECLARATION OF ORIGINALITY
I declare that this report entitled “MACHINE LEARNING FOR DISEASE DETECTION
USING RASPBERRY PI WITH TENSORFLOW IN VEGETABLE FARMS” is my own
work except as cited in the references. The report has not been accepted for any degree and is
not being submitted concurrently in candidature for any degree or other award.
Signature : _________________________
Name : _________________________
Date : _________________________
iii BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
ACKNOWLEDGEMENTS
I would like to thank my supervisor, Dr. Goh Hock Guan for his support and guidance
in this project. Without his guidance, I would never been able to come this far. His
willingness to offer assistance and guidance is generously appreciated.
Next, I would also like to thank my project teammate Choong Jian How for his
invaluable of knowledge and constructive feedbacks towards the project and I appreciate it a
lot.
Finally, I would like to thank my parents and family members for encouragement and
moral support. This project would not have been possible without them.
iv BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
ABSTRACT
Plant disease has being one of the major factors that is preventing the farmers from
earning maximum profit from their harvest. This problem can be reduces if the farmers
monitor their crops closely start from the planting stage until harvesting stage. This method
could be working for small farm but if the farm is large, it could be a quite tedious task to be
completed.
The proposed system will provide a much better and convenient way for the farmers to
monitor their plants. This system provides a disease classification feature which will be
trained using a Machine learning technique called Transfer learning and it will deployed to a
Raspberry Pi connected with a camera. After the classification, it will return the classification
result and it will be forwarded into a cloud database. Then, a mobile application will retrieve
the data from the database. If there is any positive disease-presence result, it will send a
notification to the farmer that there is a plant in their farm got infected.
v BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
TABLE OF CONTENTS
TITLE i
DECLARATION OF ORIGINALITY ii
ACKNOWLEDGEMENT iii
ABSTRACT iv
TABLE OF CONTENTS v
LIST OF FIGURES viii
LIST OF TABLES xi
LIST OF ABBREVIATION xiii
CHAPTER 1: INTRODUCTION 1
1.1 Problem Statement and Motivation 1
1.2 Project Objective 2
1.3 Project Scope 2
1.4 Impact, Significance and Contribution 3
1.5 Organization of the Report 4
CHAPTER 2: LITERATURE REVIEW 6
2.1 Review of the Technologies 6
2.1.1 Hardware Platforms 6
2.1.2 Summary of the Technologies Review 11
2.2 Review of Existing Systems/Applications 12
2.2.1 Plant Disease Detection using Raspberry Pi by K-means
Clustering Algorithm
12
2.2.2 Plant Diseases Detection using Image Processing Techniques 13
2.2.3 Deep Learning for Image-Based Cassava Disease Detection 14
2.2.4 Summary of the Existing Systems 15
2.3 Concluding Remark 16
CHAPTER 3: SYSTEM METHODOLOGY 17
3.1 System Development Models 17
3.1.1 Waterfall Model 17
3.1.2 V-Shaped Model 18
vi BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
3.1.3 Spiral Model 18
3.1.4 Prototype Model 19
3.1.5 Selected Model 20
3.2 System Requirement 20
3.2.1 Hardware 21
3.2.2 Software 24
3.3 Functional Requirement 25
3.3.1 Retrain 25
3.3.2 Image Capture 26
3.3.3 Label Image 26
3.3.4 Data View 26
3.3.5 Camera Stream 27
3.4 Expected Challenges 27
3.5 Project Milestone 28
3.6 Estimated Cost 30
3.7 Concluding Remark 31
CHAPTER 4: SYSTEM DESIGN 32
4.1 System Architecture 32
4.2 Functional Modules in the System 33
4.2.1 Retrain Module 33
4.2.2 Image Capture Module 34
4.2.3 Label Image Module 35
4.2.4 Data View Module 36
4.2.5 Camera Stream Module 37
4.3 System Flow 38
4.4 Database Design 39
4.5 GUI Design 40
4.6 Concluding Remark 42
CHAPTER 5: SYSTEM IMPLEMENTATION 43
5.1 Hardware Setup 43
5.1.1 Personal Laptop 43
vii BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
5.1.2 Raspberry Pi 3 43
5.1.3 Status Indicator Setup 44
5.1.4 Camera Setup 45
5.2 Software Setup 46
5.2.1 Ubuntu 16.04 Installation 46
5.2.2 Android Studio Installation 47
5.2.3 Tensorflow Installation 47
5.2.4 UV4L Installation 49
5.3 Setting and Configuration 49
5.4 System Operation 50
5.5 Concluding Remark 53
CHAPTER 6: SYSTEM EVALUATION AND DISCUSSION 54
6.1 System Testing and Performance Metrics 54
6.2 System Testing and Result 55
6.2.1 Condition 1 (Without any hindrance on the camera) 55
6.2.2 Condition 2 (Hindrance on the camera) 65
6.3 Project Challenges 75
6.4 Objectives Evaluation 76
6.5 Concluding Remark 77
CHAPTER 7: CONCLUSION AND RECOMMENDATION 78
7.1 Conclusion 78
7.2 Recommendation 79
REFERENCES 80
APPENDIX 1 – BI WEEKLY REPORT
APPENDIX 2 – TURNITIN ORIGINALITY REPORT
POSTER
viii BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
LIST OF FIGURES
Figure Number Title Page
Figure 2.1.1-F1 Jetson TK1 (Embedded Linux Wiki, Jetson TK1) 6
Figure 2.1.1-F2 Jetson TK1 full specifications (Embedded Linux Wiki, Jetson
TK1)
7
Figure 2.1.1-F3 Raspberry Pi board series (Network World from IDG) 8
Figure 2.1.1-F4 Raspberry Pi 3 Model B’s specifications (Raspberry Pi
Foundation, Raspberry Pi 3 Model B)
9
Figure 2.1.1-F5 Odroid-C2 (Odroid, Odroid-C2) 9
Figure 2.1.1-F6 Odroid-C2’s block diagram (Odroid, Odroid-C2) 10
Figure 2.1.1-F7 Odroid-C2’s specifications (Odroid, Odroid-C2) 10
Figure 2.2.1 Block diagram of the overall system (Plant Disease Detection
using Raspberry PI By K-means Clustering Algorithm, 2017, p
93)
12
Figure 2.2.2 General block diagram of Agrobot (Plant Diseases Detection
using Image Processing Techniques, 2016)
13
Figure 2.2.3 Overall accuracy for transfer learning using three machine
learning methods (Deep Learning for Image-Based Cassava
Disease Detection, 2017, p4)
15
Figure 3.1.1 Waterfall Model (Personal website – Software Engineering &
Architecture Practices, 2012)
17
Figure 3.1.2 V-Shaped Model (Personal website – Software Engineering &
Architecture Practices, 2012)
18
Figure 3.1.3 Spiral Model (Personal website – Software Engineering &
Architecture Practices, 2012)
19
Figure 3.1.4 Prototype Model (ISTQB Exam Certification, 2018) 20
Figure 3.2.1-F1 Raspberry Pi 3 Model B (Raspberry Pi Foundation) 21
ix BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 3.2.1-F2 Raspberry Pi NoIR Camera V2 (element14) 22
Figure 3.2.1-F3 Kingston 16GB microSD card (Lazada) 22
Figure 3.2.1-F4 2.5A, 5.1V Micro USD B Power Supply (element14) 23
Figure 3.2.1-F5 5mm LEDs (guitarpedalparts) 23
Figure 3.2.2 Raspbian OS logo (Raspbian, 2012) 24
Figure 4.1 Full system architecture 32
Figure 4.2.1-F1 Tensorboard training summary about accuracy and cross entropy 33
Figure 4.2.1-F2 Tensorboard histograms about retraining layer weights, biases,
activations, etc
34
Figure 4.2.2 Flowchart for image capture module 34
Figure 4.2.3 Flowchart for label image module 35
Figure 4.2.4 Flowchart for data view module 36
Figure 4.2.5 Flowchart for camera stream module 37
Figure 4.3 Full flowchart of system flow 38
Figure 4.4-F1 Example of result of the classification that needed to be store in
database
39
Figure 4.4-F2 Example of data being stored in Firebase Database 39
Figure 4.5-F1 GUI design for the main page 40
Figure 4.5-F2 GUI design for data view 41
Figure 4.5-F3 GUI design for video stream 41
Figure 4.5-F4 GUI design for disease control method 42
Figure 5.1.2 Raspberry Pi 3 GPIO Header (element14, 2015) 44
Figure 5.1.3 Actual setup of the status indicator setup 45
Figure 5.1.4 Actual setup with the Raspberry Pi Camera 46
Figure 5.4-F1 Green LED lights up when the system starts to execute 50
x BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 5.4-F2 Red LED lights up when the system stopped due to error 51
Figure 5.4-F3 Application shows the data retrieved from the database 52
Figure 5.4-F4 Application shows the video streaming service is running 52
Figure 5.4-F5 Application shows the notification feature 53
xi BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
LIST OF TABLES
Table Number Title Page
Table 1.5 Organization of the report 4
Table 2.1.2 Summary of the Technologies review 11
Table 2.2.2 Summary of methods (Plant Diseases Detection using Image
Processing Techniques, 2016)
14
Table 2.2.4 Summary of the Existing Systems 15
Table 3.4-T1 Gantt chart showing the project milestones (FYP 1) 28
Table 3.4-T2 Gantt chart showing the project milestones (FYP 2) 29
Table 3.5 Estimated cost 30
Table 5.1.2 Table of pins and port being used and their function 43
Table 5.1.3 Table of LED colors, status and status description 44
Table 6.1 Table shows a clearer picture of the whole system testing 54
Table 6.2.1-T1 Result of testing on condition 1 (Healthy condition: Cabbage) 55
Table 6.2.1-T2 Result of testing on condition 1 (Healthy condition: Sweet
Pepper)
56
Table 6.2.1-T3 Result of testing on condition 1 (Healthy condition: Tomato) 57
Table 6.2.1-T4 Result of testing on condition 1 (Unhealthy condition: Bacterial
Soft Rot)
58
Table 6.2.1-T5 Result of testing on condition 1 (Unhealthy condition: Black Rot) 59
Table 6.2.1-T6 Result of testing on condition 1 (Unhealthy condition:
Anthracnose)
60
Table 6.2.1-T7 Result of testing on condition 1 (Unhealthy condition: Blossom
End Rot)
62
Table 6.2.1-T8 Result of testing on condition 1 (Unhealthy condition: Bacterial 63
xii BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Spot)
Table 6.2.1-T9 Result of testing on condition 1 (Unhealthy condition: Late
Blight)
64
Table 6.2.2-T1 Result of testing on condition 2 (Healthy condition: Cabbage) 65
Table 6.2.2-T2 Result of testing on condition 2 (Healthy condition: Sweet
pepper)
66
Table 6.2.2-T3 Result of testing on condition 2 (Healthy condition: Tomato) 67
Table 6.2.2-T4 Result of testing on condition 2 (Unhealthy condition: Bacterial
Soft Rot)
68
Table 6.2.2-T5 Result of testing on condition 2 (Unhealthy condition: Black Rot) 70
Table 6.2.2-T6 Result of testing on condition 2 (Unhealthy condition:
Anthracnose)
71
Table 6.2.2-T7 Result of testing on condition 2 (Unhealthy condition: Blossom
End Rot)
72
Table 6.2.2-T8 Result of testing on condition 2 (Unhealthy condition: Bacterial
Spot)
73
Table 6.2.2-T9 Result of testing on condition 2 (Unhealthy condition: Late
Blight)
74
xiii BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
LIST OF ABBREVIATIONS
Abbreviation Meaning
GDP Gross Domestic Product
NoIR No Infrared
ARM Advanced RISC Machines
SBC Single Computer Board
LTS Long Term Support
OS Operating System
CPU Central Processing Unit
GPU Graphic Processing Unit
RAM Random Access Memory
SMS Short Message Service
K-NN K-Nearest Neighbors
DC Direct Current
SIFT Scale-Invariant Feature Transform
SVM Support Vector Machine
PCA Principal Component Analysis
BPNN Back Propagation Neural Network
SDLC Software Development Life Cycle
USB Universal Serial Bus
IDE Integrated Development Environment
GUI Graphical User Interface
LED Light Emitting Diode
API Application Programming Interface
URL Uniform Resource Locator
IP Internet Protocol
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 1: Introduction
1 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
CHAPTER 1: INTRODUCTION
1.1 Problem Statement and Motivation
Agriculture plays an important role in our day to day life. It provides food which is the
basic need of all human beings. Other than that, agriculture also generates our country‟s
economy. Based on an article from FFTC Agricultural Policy Platform, agriculture remains an
important sector of Malaysia‟s economy. In 2013, it contributed about 7.2% to the Malaysia‟s
GDP and also provided employment for 10.9% of the total employment in Malaysia (Rozhan
Abu Dardak 2015). Although agriculture is able contribute to our country‟s economy, there
are various problem preventing the farmers from gaining maximum profit from their crops
due to plant disease which can affect crops in their farm. Based on Asia One, the article states
that the income of some 200 farmers is in jeopardy after a disease ravaged their banana
plantations (R Sekaran 2015). In the past, many farmers relied on their direct eye observation,
waited until the plant disease symptoms appear due to uncertainly etc. These methods were
inaccurate and not reliable. If this problem cannot be resolve, not only farmers will lose their
income but our country also will suffer due to our country need to import more food from
foreign countries. Based on The Star Online, the article mentioned that Malaysia is currently
importing more food than it is producing and exporting, which puts us at the mercy of foreign
countries (Hariati Azizan 2016). Hence, a more reliable solution has to be implemented to
overcome this problem.
In this project, a disease detection system using machine learning will be developed.
This system will help the farmer to monitoring their crops where they can reduce the risk of
losing their harvest from the diseases. Using a camera to capture the image of crops everyday
and perform classification study on the images to determine whether the crops are healthy or
infected. With this system, farmers not only can monitoring their crops but they also can take
early precaution to prevent the plant disease from spreading as the system not only implement
with a camera but also with functionalities like notify the farmer when infect plants were
found and suggest a correct solution to take to prevent the disease. Farmer also can reduce
their workload with this system as they can monitor their farm automatically. This method is
much more less time consuming.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 1: Introduction
2 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
1.2 Project Objective
Objectives:
Design a disease detection system using machine learning technique for the
farmer to reduce the risk of losing their harvest from diseases.
High percentage for their harvest loss is due to plant diseases. This system works by
capturing the image of plants, if the images match one of the diseases on the pre-
trained and deployed artificial neural network on the system, it will alert the farmers to
take precaution measure.
To let farmers take early and correct precaution through the deployed disease
detection system by suggesting correct solution to take.
Sometimes even if the farmers able to discover there are infected plants, there is still
possibility that they are using incorrect method to kill off the disease. This can cause
them a big loss because chemical solution that required is a lot and expensive. By
using this system, farmer can not only correct precaution but also take early precaution
as this system included with a notification system to alert the farmers when there is
disease detected.
To develop and deploy an artificial neural network that is able to perform disease
classification on vegetable plants.
The artificial neural network developed for this system is used to classify that whether
the plant is in healthy state or unhealthy state. If the plant is unhealthy, then it will be
classified into which categories of disease that available in the artificial neural
network.
1.3 Project Scope
At the end of the project, the image classifier will be trained using a machine learning
technique which is called Transfer learning. Based on an article from Machine Learning
Mastery, Transfer learning is a machine learning technique where a model trained on one task
is re-purposed on a second related task (Brownlee 2017). Besides that, there are few
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 1: Introduction
3 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
approaches for Transfer learning which the most common one is develop model approach,
pre-trained model approach, etc. Transfer learning with image data is being applied in this
project. It is a transfer learning method with pre-trained model approach. After trained the
classifier, the re-trained image classifier prototype will be deployed to the microcomputer
Raspberry Pi with a camera connected into it. The whole system will be powered up with a
5V, 1A power supply. The Pi NoIR Camera V2 will be used to capture image of the vegetable
plants and the Raspberry Pi will be responsible for classify the captured image using the re-
trained image classifier. After the classification, it will return the result and it also will be
forwarded to the Firebase database. Finally, a mobile application will be used to retrieve the
data from the database and if there is any positive disease-presence result found, it will send
notification to the farmer that there are plants got infected.
1.4 Impact, Significance and Contribution
In this project, the disease detection system provides user a much more convenient
way to monitoring their vegetable plants.
As the traditional agriculture method, farmers are required to monitoring their plants
manually. This method might be working fine with small sized-farm but if in a large sized-
farm, this method will be not convenient for the farmers because the farmers has to inspect the
plants one by one before can proceed to the next area. This will be consuming a lot of time
and a tedious task to be done and sometimes the farmers might miss some area of the farms. If
there is disease happening in the missed area of the farms, it might spread to the other area of
the farms too. By the time the farmers discovered, it might be too late and this can cause a lot
of income loss to the farmers. Even it is discovered by the farmers, there is disease happening.
There might be a chance where the farmer could use wrong cure method and this can cause
them a big loss as the chemical solution that required is a lot and it is expensive.
So in the proposed system, it can provide a much better and convenient way to reduce
the problems that the farmers having when monitoring their plants. By having this system, the
farm can be monitoring automatically without any missed area and able to notify the farmers
immediately if any diseases are found and suggesting the correct solution to take.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 1: Introduction
4 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
1.5 Organization of the Report
Chapters Description
Chapter 1: Introduction Introduction to the problem statement, motivation,
project objectives and project scope were defined and
explained.
The main contribution of this project also explained.
Chapter 2: Literature Review Different technologies that could use for this project
were reviewed and justification was made for the
chosen technology.
Three existing systems that similar to this project
where reviewed and were summarized into a table.
Chapter 3: System
Methodology
Four different system development models were
chosen and one of the development models was
selected. The selected model was justified why it was
selected.
The hardware, software and functional requirement
were identified and explained.
Expected project challenges were identified and
explained.
Project milestone for FYP 1 and estimated cost were
shown in Gantt chart form and table form
respectively.
Chapter 4: System Design Illustration of the system architecture was shown.
Functional modules were identified and system flow
was provided.
The design of database was shown.
The design of GUI was shown.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 1: Introduction
5 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Chapter 5: System
Implementation
Hardware setup was explained.
Software setup was explained
Setting and configuration were provided and
explained
System operation was shown
Chapter 6: System Evaluation
and Discussion
System testing and performance metrics were
explained
System testing and result were shown and explained
Project challenges was identified and explained
Objective evaluation was explained
Chapter 7: Conclusion Discuss the outcome of the project
Project recommendation suggested
Table 1.5: Organization of the report
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 2: Literature Review
6 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
CHAPTER 2: LITERATURE REVIEW
2.1 Review of the Technologies
There are variety of existing technologies can be used to implement this Plant Disease
Detection System. Each of the technologies has their pros and cons and hence each should be
evaluated carefully which is most suitable for this project. The technologies that will be
discussed are hardware platforms.
2.1.1 Hardware Platform
The first embedded hardware platform that is suitable for this project is NVIDIA
Jetson TK1. This embedded hardware board is designed and developed by NVIDIA, one the
top leading manufacturer of graphics card today.
Figure 2.1.1-F1: Jetson TK1 (Embedded Linux Wiki, Jetson TK1)
This embedded board is really powerful where it comes with a quad-core 2.3Ghz
ARM Cortex-A15 CPU and the revolutionary Tegra K1 GPU. It is also equipped with a fan
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 2: Literature Review
7 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
for operation that is under heavy workloads. Next, this embedded board is running a Linux
distribution operating system which is Linux4Tegra OS. The Linux4Tegra OS is basically an
Ubuntu 14.04 OS with custom pre-configured drivers such as bootloader, kernel, OpenGL,
X.Org, Multimedia, etc. Other than that, this board not only includes some PC-oriented
features such as SATA, mini-PCIE but also have similar features as other embedded hardware
board such as Raspberry Pi. Lastly, this embedded hardware board is fairly pricey which cost
above RM1000 based on Lazada website (Lazada n.d.).
The following are the hardware features of Jetson TK1 (Embedded Linux Wiki n.d.):-
Figure 2.1.1-F2: Jetson TK1 full specifications (Embedded Linux Wiki, Jetson TK1)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 2: Literature Review
8 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
The second embedded hardware board that is suitable for this project and which will
be discussed is Raspberry Pi. This embedded board was initially created by Eben Upton, the
creator of Raspberry Pi who has a goal to create a low-cost device that could improve
programming skills and hardware understanding at the pre-university level (Opensource.com
n.d.). It is only as big as a credit-card sized that can be plugs into a monitor and it uses a
standard keyboard and mouse just a regular computer desktop.
Figure 2.1.1-F3: Raspberry Pi board series (Network World from IDG)
Although it is slower compared with regular computer, but it is still equipped with a
complete Linux distribution operating system that can provide all the expected abilities that
implies, at low-power consumption. The price for this board is affordable where it cost less
than RM200 based on element14 website (element14 n.d.).
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 2: Literature Review
9 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
The following are the Raspberry Pi latest generation which is Raspberry Pi 3 Model
B‟s specifications (Raspberry Pi Foundation n.d.):-
Figure 2.1.1-F4: Raspberry Pi 3 Model B’s specifications (Raspberry Pi Foundation,
Raspberry Pi 3 Model B)
Finally, the last embedded hardware will be discuss is Odroid-C2. It is an embedded
hardware board equipped with a 64-bit quad-core single board computer (SBC) which is one
of the most cost-effective 64-bit development boards available. This board is small and
compact just like Raspberry Pi but it has much better specifications compared with the
Raspberry Pi board.
Figure 2.1.1-F5: Odroid-C2 (Odroid, Odroid-C2)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 2: Literature Review
10 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 2.1.1-F6: Odroid-C2’s block diagram (Odroid, Odroid-C2)
It also same like all other embedded hardware boards which is running Linux
distribution operating system, Ubuntu 16.04 OS and other than that, it also capable running
Android 6.0 Marshmallow based on kernel 3.14LTS. The price for this board is also fairly
affordable where it cost around RM300 based on Odroid official website (Odroid n.d.).
The following are the Odroid-C2‟s specifications (Odroid n.d.):-
Figure 2.1.1-F7: Odroid-C2’s specifications (Odroid, Odroid-C2)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 2: Literature Review
11 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
2.1.2 Summary of the Technologies Review
Jetson TK1 Raspberry Pi Odroid-C2
CPU NVIDIA "4-Plus-1"
2.32GHz ARM quad-core
Cortex-A15 CPU with
Cortex-A15 battery-saving
shadow-core
Quad Core 1.2GHz
Broadcom BCM2837
64bit CPU
Amlogic ARM®
Cortex®-
A53(ARMv8)
1.5Ghz quad core
CPUs
GPU NVIDIA Kepler "GK20a"
GPU with 192 SM3.2
CUDA cores (up to 326
GFLOPS)
Broadcom
VideoCore IV
Mali™-450 GPU (3
Pixel-processors + 2
Vertex shader
processors)
RAM 2GB 1GB 2GB
OS Supported Linux
(Linux4Tegra)
Linux
(Raspbian)
Linux
(Ubuntu
16.04)
Android
(Android 6.0
Marshmallow
based on
kernel
3.14LTS)
Price Above RM1000 Less RM200 Under RM300
Table 2.1.2: Summary of the Technologies review
Different hardware has their pros and cons. Based on the table above, we can see that
the best performance hardware is Jetson TK1 but the selections are limited to the price and
project scale. The prototype of the project only will be demonstrated rather than need to be
deployed on the real farm. Hence, it does not require a very powerful embedded board which
normally is expensive. Although, Raspberry Pi is much slower in performance compared the
other two embedded boards and due to the scale of the project, Raspberry Pi is more than
capable enough to handle the tasks and it is the cheapest among the three boards as we are
restricted by the cost budget.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 2: Literature Review
12 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
2.2 Review of the Existing Systems/Applications
2.2.1 Plant Disease Detection using Raspberry PI by K-means Clustering Algorithm
There are similar projects that have been done in the past. Priyanka G. Shinde et.al
(2017) conducted a project to build a plant disease detection device using Raspberry Pi by K-
means Clustering Algorithm. The project model is using Raspberry Pi attached with a camera
that used to capture an image of crops and a monitor that used to display the detected disease
name and also the pesticide name and with another feature that can send message via sms or
email to notified farmer about the status of the plant (Figure 2.1).
Figure 2.2.1: Block diagram of the overall system (Plant Disease Detection using Raspberry
PI By K-means Clustering Algorithm, 2017, p 93)
In their project, the k clustering method applied together with k-NN which is also
known as k-nearest neighbors method to classify the capture images. K clustering method was
one of the classification steps that were used for image segmentation. Finally, the
segmentation will pass through the k-NN classifier for recognition and return the result to the
user. Even though, the k-NN classifier is one of the most common and easy to implement
machine learning method. It does come with few limitations such as high computation cost in
a large dataset and the requirement for storage of data.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 2: Literature Review
13 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
2.2.2 Plant Diseases Detection using Image Processing Techniques
Shivani K. Tichkule & Dhanashri. H. Gawali (2016) conducted a project to build an
agricultural robot that used in plan disease detection using image processing technique. They
modeled a controller/processor as the heart of the system. The controller/processor is powered
up with a power supply or battery and it is attached with a webcam to capture the image of
crops. It also attached with a L293D motor driver and two DC motor (wheel) (Figure 2.2).
The motor driver and DC motor (wheel) is allowed the Agrobot to move around in the farm to
capture image of the crop. In this system, they also applied image processing technique and
machine learning methods to classify the plant diseases. They achieved a positive result by
using this method (Figure 2.3). The strength of their system is they installed DC motor
(wheel) into the system. This allowed the device capture images from various angle instead of
single angle. Next, their system also used different type of algorithms for different type of
plants to increase the accuracy of the result.
Figure 2.2.2: General block diagram of Agrobot (Plant Diseases Detection using Image
Processing Techniques, 2016)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 2: Literature Review
14 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Crops Algorithm/classifier/methods Accuracy
Soyabean leaves SIFT algorithm and SVM
classifier
Correctly recognize plant
species and accuracy is as
high as 93.79%
Cotton leaves PCA/KNN Overall accuracy 95%
Wheat leaves PCA & Morphological
features
96.7% for wheat powdery
mildew, 86.6% stripe rust
Grape leaf BPNN & K-means Efficient leaf disease color
extraction and for
Anthracnose 76.6%
Table 2.2.2: Summary of methods (Plant Diseases Detection using Image Processing
Techniques, 2016)
2.2.3 Deep Learning for Image-Based Cassava Disease Detection
Amanda Ramcharan et al (2017) proposed a project to develop a deep learning for
Cassava disease. The project model is using mobile application to do the classification of
plant images. In their project, they used a machine learning technique called transfer learning.
This is a machine learning method where a model that is trained on a large image dataset is
retrained to classify new classes. This method is much faster compared to traditional
convolutional neural network where extracting features is computationally intensive and
requires expert knowledge for robust performance. Transfer learning requires low
computational requirement and performance which is good for mobile applications.
The results they achieve in their project are accurate. They are using three different
machine learning methods to train the image classifier (Figure 2.2.3). Transfer learning
method is on the left and using pre-trained model, Inception. Based on the result, the overall
accuracy for transfer learning in classifying is better than k-NN training method and
comparable with SVM training method provided that transfer learning requires much lesser
computational requirement.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 2: Literature Review
15 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 2.2.3: Overall accuracy for transfer learning using three machine learning methods
(Deep Learning for Image-Based Cassava Disease Detection, 2017, p4)
2.2.4 Summary of the Existing Systems
Existing System Advantages Disadvantages Critical Comments
Plant Disease
Detection Using
Raspberry PI by K-
means Clustering
Algorithm
Fast
computation
speed for small
dataset.
Easy to
implement.
Able to
suggest correct
pesticide to
use.
Dataset need to
be stored.
Computation
cost will be high
if dataset is
large.
K-NN approach
requires storage of
dataset which can be a
problem for embedded
devices as it has
limited storage space
and high computation
cost if the dataset is
large as it has limited
computation capacity.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 2: Literature Review
16 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Plant Diseases
Detection using Image
Processing Techniques
Able to take
image of plants
from various
angles.
Usage of
different
algorithms for
different
plants.
Lack of
flexibility
because of
particular
algorithm is only
for certain plant.
This project approach
requires a lot of studies
of different algorithms
which can be difficult
for a novice machine
learner.
Deep Learning for
Image-Based Cassava
Disease Detection
Shorter
training time.
Low
computational
requirement
which can be
deployed into
embedded
devices.
Requires large
and relevant
dataset to train
the classifier.
Transfer learning
approach is very
suitable for this project
as does not require
high computational
requirement and expert
in robust performance.
Table 2.2.4: Summary of the Existing Systems
2.3 Concluding Remarks
Few of the hardware platforms and existing plant disease detection systems were
discussed and studied. Every hardware and systems had their pros and cons. After a detail of
discussion and studies, this will be playing an important role for us to choose our hardware
platform and method approach that is most suitable to be applied in this project.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
17 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
CHAPTER 3: SYSTEM METHODOLOGY
3.1 System Development Models
System Development Model which can be refers as SDLC. It is a framework defining
tasks performed at each step in the software development process. It also consists of a detailed
plan of how to develop, maintain and replace specific software. There are few common SDLC
models such as waterfall model, v-shaped model, spiral model and prototype model will be
evaluated.
3.1.1 Waterfall Model
Waterfall Model is a development model that will be proceeds in sequence manner.
The project moves methodically from one phase to next phase without overlapping. Thus,
each phase is finished before the next phase begins. This model also does not define the
process to go back to the previous phase to handle changes in requirement. This model is most
suitable for projects that have their requirements clear and well-defined.
Figure 3.1.1: Waterfall Model (Personal website – Software Engineering & Architecture
Practices, 2012)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
18 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
3.1.2 V-Shaped Model
V-shaped model is an extension of the waterfall model but instead of going down
sequentially, the process steps are going upwards after implementation and coding phase.
When this unique approach is completed, it will form the V shape.
Figure 3.1.2: V-Shaped Model (Personal website – Software Engineering & Architecture
Practices, 2012)
The difference between V-shaped model and Waterfall mode is that there is the early
testing phase in V-shaped model. The early testing phase is a stage where verification and
validation will be done to reduce errors and increase the chance of success over the waterfall
model. This model is most suitable for small projects that have their requirements clearly
defined and known.
3.1.3 Spiral Model
Spiral model combines both elements of design and prototyping-in-stages. In an effort
to combine advantages of top-down and bottom-up concepts, spiral model combines the
feature of the prototyping model and the waterfall model to achieve that. Spiral model re-uses
many of the same phases in the waterfall model and it is separated by planning stages. It has
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
19 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
risk assessment, prototyping and simulation. Due to the combination of two models in it, this
model is most suitable for those large, expensive and complicated projects.
Figure 3.1.3: Spiral Model (Personal website – Software Engineering & Architecture
Practices, 2012)
3.1.4 Prototype Model
Prototype model is a model that performs the analysis phase, design phase and
implementation phase concurrently. With user feedbacks, all these phases are performed
repeatedly until the final system is completed. By using this model, the client can get an
“actual feel” of the system much earlier instead of they have to wait for the final system to be
completed. This allow any misunderstanding of requirements, additional features and possible
errors to be detected much earlier, before the actually system is finalized. This model is most
suitable for projects whose requirements cannot be known in detail ahead of time.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
20 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 3.1.4: Prototype Model (ISTQB Exam Certification, 2018)
3.1.5 Selected Model
After some evaluations and comparisons between waterfall model, v-shaped model,
spiral model and prototype model. The prototype model was selected for this project. This is
due several reasons such as project scale, system requirements and able to get prototype
system ready early. As this project is not a very large scale project, hence the prototype model
is suitable. Besides, this model also allows any changes or modification to be made which can
reduces the chance of failure. Due to system is for those farmers, they might not know their
requirements clearly. By using prototype model, any changes or addition of requirement can
be done easily. Finally, as this system is for those farmers, it is important to have system
prototype to be ready early to get user feedback to make changes or improvement.
3.2 System Requirement
This project will be employing a Raspberry Pi 3 Model B connected with a Raspberry
Pi NoIR Camera V2 which allows the Raspberry Pi to capture the image of plants and 2 LEDs
to indicate the current status of the system. The software components include Ubuntu OS,
Raspian OS, Firebase Database, Tensorflow, Android Studio and UV4L video streaming
driver software.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
21 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
3.2.1 Hardware
Raspberry Pi 3 Model B
The Raspberry Pi 3 is the heart of the entire system. It has moderate specifications for
an embedded device to run machine learning process but it is reasonable in pricing and easy
to get. It also has a complete Linux distribution which is specifically for Raspberry Pi which
is an embedded device powered by an ARM processor.
Figure 3.2.1-F1: Raspberry Pi 3 Model B (Raspberry Pi Foundation)
Raspberry Pi NoIR Camera V2
This camera module has a Sony IMX219 8-megapixel sensor. It also does not employ
an infrared filter which gives us the ability to see in the dark with infrared lighting but by
daylight the pictures will look decidedly curious. It also comes with a little square of blue gel
film which can be used to monitor the health of green plants but we do not use this feature in
this project.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
22 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 3.2.1-F2: Raspberry Pi NoIR Camera V2 (element14)
Kingston 16GB MicroSD Card
This microSD card is used as the storage for both operating system and program files
for Raspberry Pi 3 as it has a slot for microSD card. 16GB storage is more than enough to
store the operating system, the captured image and the re-trained image classifier.
Figure 3.2.1-F3: Kingston 16GB microSD card (Lazada)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
23 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
2.5A, 5.1V Micro USB B Power Supply
The prototype of this project is just for demonstration purpose only and do not require
to be deployed in a real farm. Hence, a power supply is being used rather than portable
rechargeable power supply such as power bank.
Figure 3.2.1-F4: 2.5A, 5.1V Micro USD B Power Supply (element14)
5mm LEDs
This electronic component is used in the system to indicate the current status of the
system. As the actual setup of the system does not have the display for user to view. The
LEDs serve as an indicator to user that whether the system is running, crashing or idling.
Figure 3.2.1-F5: 5mm LEDs (guitarpedalparts)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
24 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Personal Computer (Laptop)
This equipment is used in developing and training dataset for the image classifier
which will be deployed later into the Raspberry Pi. As the embedded device is limited in
resources, all the heavy resource work will be carried out using laptop.
3.2.2 Software
Ubuntu 16.04.4 LTS
Ubuntu operating system is a free Linux Distribution for desktop, server and cloud.
This operating system will installed in the laptop and the developing and training for the
image classifier will be done on Linux environment.
Raspbian Operating System
Figure 3.2.2: Raspbian OS logo (Raspbian, 2012)
Raspbian OS is a free Linux Distribution based on Debian optimized for the Raspberry
Pi hardware. Raspbian started back in 2012 when the first generation Raspberry Pi was
released, a version of Debian for devices with the ARM processor. Later, the software was
optimized specifically for Raspberry Pi and a new distribution was released which was known
as Raspbian.
Python Language
Python language is an interpreted, object-oriented, high-level programming with
dynamic semantics. Python is widely in embedded systems due for its writability, error
reduction and readability.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
25 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Firebase (Database)
A Firebase database will be created for the system where this database will be hosted
on cloud. Firebase database is a real-time database that is cloud-hosted which was developed
by Google.
Tensorflow
Tensorflow is an open source software library for numerical computation using data
flow graphs. This library provides a lot APIs that are mainly designed for artificial neural
network models. Transfer learning using pre-trained models will be used in this project.
Android Studio
The implementation of the GUI is an android mobile application. Hence, Android
Studio is being used in this project. It is an IDE use to develop android application by Google.
UV4L Video Streaming Driver Software
A video streaming feature will be implemented for the mobile application as an
optional feature for the user to video stream from the mobile application via Raspberry Pi
camera. Hence, video streaming server for Raspberry Pi is needed to accomplish that. UV4L
is a modular collection of Video4Linux2-compliant, cross-platform, user space drivers for real
or virtual video input and output devices and over the years it also includes a generic purpose
streaming server plug-in which is especially made for IoT devices.
3.3 Functional Requirement
3.3.1 Retrain
Containing all the python scripts, pre-trained model and dataset will be required to
train the image classifier.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
26 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
In this project, the image classifier needs to be trained. Due to the limited resources on
the Raspberry Pi, the training process will be taking place using a laptop as it has much more
powerful CPU, GPU and more RAM. The image classifier will be trained using Tensorflow
which is an open source software library developed by Google. Transfer learning technique
will be applied in the training process because this technique reduces the complexity and time
requires for training.
3.3.2 Image Capture
Define the functionalities of the camera that will be connects to the Raspberry Pi, the
LEDs and auto reboot. Python script are studied and implemented. The pi camera is used to
capture image of plants to let the system able to do evaluation to classify the plant current
condition. The pi camera is also being programmed to be able capture image every 6 hours
automatically. The LEDs are used to indicate the current status of the system and if the
current status indicates that the system is crashed. It will be auto rebooted after some time.
3.3.3 Label Image
Define the functionalities of the pre-trained image classifier such as where are the
image path, load the image and many more. After that the image classifier will evaluate the
captured image. After the evaluation, the classifier will display the result and it will be pushed
to the cloud database for data storage. If the system is crashed during this process, it will be
auto rebooted after some time.
3.3.4 Data View
Define the functionalities of the data viewing in the mobile application such as
database URL, comparing classification date with current date and compare the classification
of state condition. After the classification result is pushed to the cloud database, the date of
classification result will be compared with the current date. This is to make sure that only the
latest data will be displayed to user and not the old results. Other than that, the state condition
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
27 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
will also be compared. If the state condition result is unhealthy, a notification alert will be
send to the user. If the user clicks on the notification, control methods will be displayed.
3.3.5 Camera Stream
Define the functionalities of video streaming in the mobile application such as obtain
IP address, connect to the camera and disconnect from the camera. This is an optional feature
in the mobile application where allows user to video stream from the mobile application via
the Pi camera which is attached on the Raspberry Pi. IP address must be obtained before the
video stream could be running and this will be done in automatically by this function itself.
All the user need to do is to press connect if they wish to start the video streaming and press
disconnect to end the streaming.
3.4 Expected Challenge
One of the challenges to be expected in this project will be the required image dataset.
To train a high accuracy neural network, large quantity and suitable image dataset is required.
In this project, we are required to gather images about vegetable plants. In a normal situation,
an unhealthy plant is rarely happen in farm. Thus, it makes the gathering of unhealthy
vegetable plant images difficult.
Another challenge to be expected in this project will be limited resources. This due to
our system will be deployed into Raspberry Pi which has a very limited resources compared
to a laptop or desktop. Hence, careful planning for deployment is needed to prevent not
enough resources in the Raspberry Pi.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
28 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
3.5 Project Milestone
Task Project Week
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Data Collection
Define project
objective and scope
Analysis for literature
review
Define technologies
involved
Determine system
development model
Determine system
and functional
requirements
Outline system
architecture
Outline system flow
Train image classifier
and implement to
Raspberry Pi
Presentation
Documentation
Table 3.4-T1: Gantt chart showing the project milestones (FYP 1)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
29 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Task Project Week
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Begin creating
database
Begin development of
GUI
Add different plant
image dataset
Finalizing the
development and
implementation of
database and GUI
Finalizing the
functional
requirement, system
architecture and
system flow
Finalizing system for
presentation
System testing and
performance
Presentation
Documentation
Table 3.4-T2: Gantt chart showing the project milestones (FYP 2)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
30 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
3.6 Estimated Cost
Items For Final Year Project
Development
For Commercialisation
Raspberry Pi 3 Model B RM162.75 RM162.75
Raspberry Pi NoIR Camera
V2
RM116.25 RM116.25
Kingston 16GB MicroSD
Card
RM24.99 RM24.99
2.5A, 5,1V Micro USB B
Power Supply
RM63.99 RM63.99
LED 5mm RM1.80 RM1.80
Laptop RM0 --
Ubuntu OS RM0 --
Raspbian OS RM0 --
Firebase (Database) RM0 Vary
Tensorflow RM0 --
Android Studio RM0 --
UV4L RM0 RM0
RM369.78 RM369.78
Table 3.5: Estimated cost
Based on the table above, there will be no spending needed as the required items are
mostly personal belonging of mine. As for commercialization, the Raspberry Pi 3 Model B,
Raspberry Pi NoIR Camera V2, Kingston 16GB MicroSD card and power supply adapter will
cost RM162.75, RM116.25, RM24.99 and RM63.99 respectively. As for the database, it
comes with different subscription plan for user to choose. Hence the final price the database
plan is depend on the user how much data that they want to store. The provided plans are free,
RM96.56 a month and pay as you go. The price was refer based on their official website.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 3: System Methodology
31 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
3.7 Concluding Remarks
Different system development model were evaluated and prototype model was
selected for the development of this project. The system requirement and functional
requirement was identified to ensure the project is on correct path. Expected challenge of this
project was identified. Project milestone was also illustrated in Gantt chart format to show the
estimation time taken to complete the project. Finally, the cost for development and
commercialization was shown and explained.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 4: System Design
32 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
CHAPTER 4: SYSTEM DESIGN
4.1 System Architecture
Figure 4.1: Full system architecture
System architecture is a conceptual model that defines a system. It allows the reader to
understand and clear of how the system actually works.
Based on figure 4.1, it shows that how different component works together to make
the whole system working. The Raspberry Pi will be the heart of the system which will be
controlling the Pi camera and the trained image classifier. The Pi camera will capture the
image and it will store in a specific file inside the Raspberry Pi storage. Then, the re-trained
image classifier will begin classify the image. It will return the result and it will be pushed to
Firebase cloud. Finally, the user can retrieve the data from firebase via an android mobile
application. The android mobile application only will display the latest classification data and
send notification alert if the result is classify as unhealthy.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 4: System Design
33 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
4.2 Functional Modules in the system
4.2.1 Retrain Module
As this module is not a part of the system, it will not be discuss completed. This
module is responsible for training the image classifier that will be deployed into the
Raspberry Pi. In order to train the classifier, there should be a module which has all the
required files such as the training scripts, pre-trained model which will be used to reduce the
training time and image dataset which will be use for training. This module also provides a
function called Tensorboard which display training summary to allow easier to understand,
debug and optimize. Basic functions such as parameter tuning, changing different pre-trained
models will be available in this module.
Figure 4.2.1-F1: Tensorboard training summary about accuracy and cross entropy
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 4: System Design
34 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 4.2.1-F2: Tensorboard histograms about retraining layer weights, biases, activations,
etc
4.2.2 Image Capture Module
Figure 4.2.2: Flowchart for image capture module
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 4: System Design
35 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
In this module, all the setting for the camera, timer and LEDs function will be written
in python code and implemented. This module is responsible for tuning the pi camera setting,
controlling the timer for image capture, saving the image in specific file, indicating the status
of the system and auto rebooting the system where there is error occurs.
4.2.3 Label Image Module
Figure 4.2.3: Flowchart for label image module
This module is responsible for classifying the capture images. Firstly, this module will
be locating the path of captured image being stored and load the image. Next, the image
classifier model will be called in this module to classify the image. After classification, this
module also responsible for displaying the classification result and push the classification
result into cloud database. If any of the process has error, the system will be auto rebooted.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 4: System Design
36 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
4.2.4 Data View Module
Figure 4.2.4: Flowchart for data view module
This module is responsible for retrieving classification data from the database and
display to user. First this module will be retrieving all the classification data from database
and each of the classification result date will be compared with the current date. Only the
latest data will be displayed. Next, the classification state result also will be compared to
determine that whether the classification result is healthy or unhealthy. If the result is
unhealthy, a notification alert will be send to the user.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 4: System Design
37 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
4.2.5 Camera Stream Module
Figure 4.2.5: Flowchart for camera stream module
This module is an optional feature and it is responsible for the video streaming feature
in the mobile application. First this module will be obtaining the IP address from the
classification result in the database. Only the latest IP address will be obtained. Next, the IP
address will be inserted into the streaming URL and this must be completed before the user
start the video streaming feature. Once this is done, user can press connect and the Pi camera
will be start video streaming. Lastly, user also can disconnect from the video streaming by
disconnecting it.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 4: System Design
38 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
4.3 System Flow
The full system flow of this project will be represented in a flow chart form. As the
project is completed, the process from Raspberry Pi power on till cloud database could be
done automatically. From the flow chart, it emulates a situation where the plant disease
detection system will be capturing every 6 hours and then the trained image classifier will
begin classify the captured image, return the classification result and push the result to cloud
database. After the classification result is stored in the cloud database, user can retrieve the
data via an android mobile application developed for this project. The application will
compare the classification result date with the current date and display the latest result.
Finally, the result also will be compared to determine whether it is healthy or unhealthy. If the
result is unhealthy, a notification alert will be send to user.
Figure 4.3: Full flowchart of system flow
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 4: System Design
39 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
4.4 Database Design
The database design for this project is a cloud-based database (Firebase). The reason
for using this kind of database design is because of the limited resources on the Raspberry Pi
and the provided API for android mobile application. The purpose of the database is to store
the result of the classification which will be used on the mobile application. The developed
mobile application will retrieve the data of classification from the database and it will notify
the user if there is any positive disease-presence result.
Figure 4.4-F1: Example of result of the classification that needed to be store in database
Figure 4.4-F2: Example of data being stored in Firebase Database
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 4: System Design
40 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
4.5 GUI Design
The GUI implementation for this project is an android mobile application which will
be retrieving the classification result from the Firebase database. By comparing the date in the
classification result with the current date, the application is able to display the latest
classification data for the user. Other than that, the classification state result also will be
compared to determine that whether the result is healthy or unhealthy. If it is unhealthy, a
notification alert will be send to the user. Besides that, the user also can click the on
notification alert on the application. This will display control methods for the respective plant
diseases. This feature is to allow the user take correct precaution method to get rid the plant
disease from spreading in their farm. Finally, this application also provided with an optional
feature where the user can video stream from the application via Raspberry Pi camera. This
could be useful if the user is receiving a notification from this application and the user wish to
view the condition of the plant immediately.
Figure 4.5-F1: GUI design for the main page
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 4: System Design
41 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 4.5-F2: GUI design for data view
Figure 4.5-F3: GUI design for video stream
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 4: System Design
42 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 4.5-F4: GUI design for disease control method
4.6 Concluding Remarks
The full system design was shown and explained in this chapter. First, full system
architecture was illustrated using a diagram and explained to let the user know how the
system works. Besides that, all functional modules were also identified and explained what
each of the modules do in the system. Next, the full system flow of the system was illustrated
and explained. Finally, the database design and GUI design were discussed and what it is
going to do in this project.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 5: System Implementation
43 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
CHAPTER 5: SYSTEM IMPLEMENTATION
5.1 Hardware Setup
5.1.1 Personal Laptop
In this project, a personal laptop is used for training the image classifier and
developing the android mobile application. Due to the limitation of resources in the Raspberry
Pi, the training of the image classifier is conducted using laptop and later deployed into the
Raspberry Pi. As this project is not using any third-party software for data retrieving and
viewing, a laptop is used to develop an android mobile application for this purpose. Other
than that, the mobile application is also capable of sending notification to user if there is any
disease-positive result obtained and camera streaming in the application via Pi Camera on the
Raspberry Pi.
5.1.2 Raspberry Pi 3
There are two hardware implementations for the Raspberry Pi. First implementation is
the status indicator setup which uses 3 pins out of the 40 GPIO pins provided in the Raspberry
Pi. Next, the implementation for the camera setup which uses the CSI camera port that
provided by the Raspberry Pi also. The table below shows the hardware design for the
Raspberry Pi used in this project. Besides that, a figure of the 40 GPIO pins is also shown.
Pin/Port Function
Ground Connect to ground
GPIO 17 Control the output of green LED
GPIO 27 Control the output of red LED
CSI Camera Port Control the camera
Table 5.1.2: Table of pins and port being used and their function
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 5: System Implementation
44 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 5.1.2: Raspberry Pi 3 GPIO Header (element14, 2015)
5.1.3 Status Indicator Setup
In this project, total of two different colors LEDs (2 pins) are needed. These LEDs are
indicating the status of the system. Each color LED is representing different status of the
system as in the full system there is no display for the user to view the status of the system.
This allows the user to be aware that what the system is currently doing.
LED color Status Status Description
Green The LED is on. The system software is running.
Red The LED is on. The software stopped due to error and waiting for
reboot.
Table 5.1.3: Table of LED colors, status and status description
Table 5.1.3 shows the different colors LEDs and their status description. If green LED
is on, it indicates that the system software is currently running. Next if the red LED is on, it
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 5: System Implementation
45 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
shows that the software stopped due to error and waiting for rebooting. Finally if there is no
LEDs are lighting up, it indicates the system is idle.
Figure 5.1.3: Actual setup of the status indicator setup
The actual implementation of the LEDs is shown in Figure 5.1.3 above. Each LED is
connected with different GPIO pins at one end and same ground pin in another end.
5.1.4 Camera Setup
There is a camera setup in this project and any brand of webcams would work if
provided that there are appropriate drivers could be found online and installed on the
Raspberry Pi. In this case, Raspberry Pi NoIR Camera V2 is used in this project as this
camera is a personal belonging of mine and the compatibility with Raspberry Pi. In the
embedded device itself, there is a CSI camera port for connecting this Raspberry Pi Camera.
The setup for this camera is rather easy. Once the camera is connected to the camera
port and the camera interface is activated, the camera is ready to be use. Figure 5.1.4 below
shows the actual setup with the Raspberry Pi Camera connected.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 5: System Implementation
46 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 5.1.4: Actual setup with the Raspberry Pi Camera
5.2 Software Setup
5.2.1 Ubuntu 16.04 Installation
Ubuntu OS need to be installed in the laptop for the training of image classifier. The
Linux platform is chosen over the Windows platform due to compatibility with the
Tensorflow library during the time when the project was conducted. To make things easier,
dual boot (Windows 10 and Ubuntu 16.04) method is used. This method helps us to save a lot
of time from backup the important files from our previous OS and it also allows us to boot
either into Windows or Linux. The following link provides a complete guide on how we can
setup our computer into dual-booting: (https://www.tecmint.com/install-ubuntu-16-04-
alongside-with-windows-10-or-8-in-dual-boot/)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 5: System Implementation
47 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
5.2.3 Android Studio Installation
Due to this project is not using third-party application for data retrieving and viewing,
notification services and video streaming, an android mobile application is developed. To
develop android application, we need to install Android Studio which is the official IDE for
android development. To install Android Studio, go to Android Studio official website and
download the latest version. Make sure the system requirement is fulfill and proceed to install.
5.2.3 Tensorflow Installation
Before we can start train and deploy the artificial neural network, we need to
download and install the Tensorflow library. The installation of Tensorflow for laptop is
rather long and the guide is easy to find online. The Tensorflow version that we used in this
project is an older version which Tensorflow 1.4. The available installation guide for Ubuntu
OS can be found in: (https://www.tensorflow.org/versions/r1.4/install/install_linux). There are
total of 4 mechanisms we can install the Tensorflow:
virtualenv
“native” pip
Docker
Anaconda
In this project, we are installing the Tensorflow with “native” pip. After the
installation is completed, we can begin train the artificial neural network.
Next will be the installation of Tensorflow for the Raspberry Pi. When this project is
conducted, there is no any official installation guide or support for the Raspberry Pi. We are
using an installation guide provided by other developers. These are the following instruction
for installation of Tensorflow in Raspberry Pi:
1. First, make sure Raspberry Pi is running at least Raspbian 8.0 (Jessie).
2. Open terminal and type in sudo apt-get update.
3. After that, install python 2.7 by typing sudo apt-get install python-pip python-dev.
4. Next, download the wheel file from this repository:
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 5: System Implementation
48 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
wget https://github.com/samjabrahams/tensorflow-on-raspberry-
pi/releases/download/v1.0.1/tensorflow-1.0.1-cp27-none-linux_armv7l.whl.
After the file is downloaded, install the file by typing sudo pip install tensorflow-
1.0.1-cp27-none-linux_armv7l.whl. For your information, the installation for
Tensorflow might take some time and please wait patiently.
5. We also need to reinstall the mock library to keep it from throwing and error when we
import Tensorflow. First, we will type in sudo pip uninstall mock to uninstall the mock
library. After it is done, type in sudo pip install mock to install back the mock library.
6. Finally, we can run a simple program to verify that the Tensorflow is installed
correctly.
python
import tensorflow as tf
hello = tf.constant (“Hello, Testing here!”)
sess = tf.Session()
print (sess.run (hello))
It should display “Hello, Testing here!” on the terminal if Tensorflow is working
correctly.
Note: The installation of Tensorflow for Raspberry Pi provided from the instruction above
only for python 2.7. If you wish to install for python 3.3+, please view this link for
information: (https://www.instructables.com/id/Google-Tensorflow-on-Rapsberry-Pi/). By the
time of this project is completed, Tensorflow is officially supporting Raspberry Pi and you
wish to use their official installation guide. This following provides further information for
that: (https://www.tensorflow.org/install/install_raspbian).
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 5: System Implementation
49 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
5.2.4 UV4L Installation
UV4L is a software driver for video streaming service in Raspberry Pi. This driver
software is installed to allow the mobile application able to stream video via the Raspberry Pi
Camera. The following link provided a full detail guide for the installation of this driver for
Raspberry Pi: (https://www.linux-projects.org/uv4l/installation/). After the installation is
done, video streaming service will be able to run.
5.3 Setting and Configuration
The CD contains two folders which is called Classifier and Mobile app. These folders
contain all the necessary source codes to program the system as well as a mobile application
for data retrieving and viewing, notification service and video streaming. To set up the whole
system for demonstration, these are the following instructions:
1. First, copy the folder named „Classifier‟ from the CD into the Raspberry Pi.
2. Check the image path for the capture_image.py and label_image.py. After that, script
path for the run.sh and start.sh by opening each of them with the provided text editor
software in Raspberry Pi. Make sure all the paths are correct before proceed to next
step.
3. Open a file called setup.txt in the classifier folder. In this file contains 2 command
lines that allow the system run automatically. Open the terminal and type in sudo
crontab –e and copy the following command file and paste it at the bottom of the file.
Press ctrl+x and Y to save the file. The system should be able to run automatically
after the Raspberry Pi is rebooted.
4. Before rebooting and run the system, we need to install Firebase library. Please type in
this following command line into the terminal:
sudo apt-get update
sudo pip install requests == 1.1.0
sudo pip install python-firebase
5. After Firebase library is installed. Proceed to the Mobile app folder which contains of
the mobile application source codes and an apk file. Copy the apk file into your
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 5: System Implementation
50 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
mobile phone and make sure the option for unknown sources is turned on from Setting
-> Privacy -> Unknown sources. Install the apk file into your mobile phone.
6. Finally, reboot the Raspberry Pi and wait for the system to execute.
5.4 System Operation
Once the configuration for the Raspberry Pi and the mobile device from section 5.3 is
been setup. The system should be able to execute automatically and when the system is
executing, the green LED should be lighted up as shown in Figure 5.4-F1. The green LED is
indicating that the system software is currently running. If the system encounters any error,
the green LED will be turned off and then the red LED will be lighted up as shown in Figure
5.4-F2. The red LED is indicating that the system software is stopped due to error and after
some time, the system will be auto reboot.
Figure 5.4-F1: Green LED lights up when the system starts to execute
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 5: System Implementation
51 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 5.4-F2: Red LED lights up when the system stopped due to error
After the system done executing once, open the mobile application and click on data.
User should be able to view the classification result. User also can click on camera to use
video streaming service. The notification will appear if the classification result is matched the
plant diseases in the image classifier model. Finally if the user clicks on the notification, the
application will display the control method for the respective plant diseases which is shown in
section 4.5.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 5: System Implementation
52 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 5.4-F3: Application shows the data retrieved from the database
Figure 5.4-F4: Application shows the video streaming service is running
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 5: System Implementation
53 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Figure 5.4-F5: Application shows the notification feature
5.5 Concluding Remark
All the necessary hardware setup and software setup were explained in detail. By
following the instructions in the setting and configuration, the system and the mobile
application should be able to run without any problem. All the required software is included
in the CD. Finally, system operation was shown and explained to show how the system is
working.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
54 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
CHAPTER 6: SYSTEM EVALUATION AND DISCUSSION
6.1 System Testing and Performance Metrics
A series of testing carried out in order to ensure the accuracy of the image
classification. In the system, there are total 3 types of vegetable plants which are in healthy
condition and 2 types of plant diseases for each vegetable plant which consider as unhealthy
condition. To ensure this, each vegetable plant condition will be tested with 20 trails under 2
conditions. The first condition is that the system testing will be carried out without any
hindrance for the camera which means each captured image that obtained from the camera is
in good condition. For second condition, the system testing will be carried out with hindrance
to the camera such as bad lighting. This is to show that whether the system is able to ensure
the accuracy of image classification to remain high despite in such environment condition. In
total there will be 18 sets of system testing in this project and same test images will be used
for both environmental conditions. The acceptance requirement for this system test is that the
number of correct classification results must be more than the number of wrong classification
results.
Condition 1: Without any hindrance on the
camera
Healthy condition: Cabbage, Sweet pepper,
Tomato
Unhealthy condition: Bacterial soft rot
(Cabbage), Black rot (Cabbage), Anthracnose
(Sweet pepper), Blossom end rot (Sweet pepper),
Bacterial spot (Tomato), Late blight (Tomato)
Condition 2: Hindrance on the camera (Bad
lighting)
Healthy condition: Cabbage, Sweet pepper,
Tomato
Unhealthy condition: Bacterial soft rot
(Cabbage), Black rot (Cabbage), Anthracnose
(Sweet pepper), Blossom end rot (Sweet pepper),
Bacterial spot (Tomato), Late blight (Tomato)
Table 6.1: Table shows a clearer picture of the whole system testing
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
55 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
6.2 Testing Setup and Result
The table below indicates the number of correct results of image classification for each
vegetable plants condition under 2 different environmental.
6.2.1 Condition 1 (Without any hindrance on the camera)
Healthy condition: Cabbage
Number of trails Classification Result Correct/Wrong
1 Healthy Cabbage Correct
2 Healthy Cabbage Correct
3 Healthy Cabbage Correct
4 Black Rot Wrong
5 Healthy Cabbage Correct
6 Black Rot Wrong
7 Healthy Cabbage Correct
8 Healthy Cabbage Correct
9 Healthy Cabbage Correct
10 Healthy Cabbage Correct
11 Black Rot Wrong
12 Healthy Cabbage Correct
13 Healthy Cabbage Correct
14 Healthy Cabbage Correct
15 Healthy Cabbage Correct
16 Healthy Cabbage Correct
17 Healthy Cabbage Correct
18 Healthy Cabbage Correct
19 Healthy Cabbage Correct
20 Healthy Cabbage Correct
Table 6.2.1-T1: Result of testing on condition 1 (Healthy condition: Cabbage)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
56 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Number of trails: 20
Number of correct classification result: 17
Number of wrong classification result: 3
Correct rate: 17/20*100% = 85%
Wrong rate: 3/20*100% = 15%
Based on the statistic above, the outcome of healthy cabbage in condition 1 is
considered as high accurate as it only failed 3 times out of 20 trials. In other words, the wrong
rate is 15% out of 100% and the correct rate is 85% out of 100%. This happens because of the
captured image is in good quality and the gathering of sample images for healthy cabbage are
available easily.
Healthy condition: Sweet Pepper
Number of trails Classification Result Correct/Wrong
1 Healthy Sweet Pepper Correct
2 Healthy Sweet Pepper Correct
3 Healthy Sweet Pepper Correct
4 Healthy Sweet Pepper Correct
5 Healthy Sweet Pepper Correct
6 Healthy Sweet Pepper Correct
7 Healthy Sweet Pepper Correct
8 Healthy Sweet Pepper Correct
9 Healthy Sweet Pepper Correct
10 Healthy Sweet Pepper Correct
11 Healthy Sweet Pepper Correct
12 Healthy Sweet Pepper Correct
13 Healthy Sweet Pepper Correct
14 Healthy Sweet Pepper Correct
15 Healthy Sweet Pepper Correct
16 Healthy Tomato Wrong
17 Healthy Sweet Pepper Correct
18 Healthy Sweet Pepper Correct
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
57 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
19 Healthy Sweet Pepper Correct
20 Healthy Sweet Pepper Correct
Table 6.2.1-T2: Result of testing on condition 1 (Healthy condition: Sweet Pepper)
Number of trails: 20
Number of correct classification result: 19
Number of wrong classification result: 1
Correct rate: 19/20*100% = 95%
Wrong rate: 1/20*100% = 5%
Based on the statistic above, the outcome of healthy sweet pepper in condition 1 is
considered as high accurate as it only failed 1 times out of 20 trials. In other words, the wrong
rate is 5% out of 100% and the correct rate is 95% out of 100%. This happens because of the
captured image is in good quality and the gathering of sample images for healthy sweet
pepper are available easily.
Healthy condition: Tomato
Number of trails Classification Result Correct/Wrong
1 Healthy Tomato Correct
2 Healthy Tomato Correct
3 Healthy Tomato Correct
4 Healthy Tomato Correct
5 Healthy Tomato Correct
6 Healthy Tomato Correct
7 Healthy Tomato Correct
8 Healthy Tomato Correct
9 Healthy Tomato Correct
10 Healthy Tomato Correct
11 Healthy Tomato Correct
12 Healthy Tomato Correct
13 Healthy Tomato Correct
141 Healthy Tomato Correct
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
58 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
5 Healthy Tomato Correct
16 Healthy Tomato Correct
17 Healthy Tomato Correct
18 Healthy Tomato Correct
19 Healthy Tomato Correct
20 Healthy Tomato Correct
Table 6.2.1-T3: Result of testing on condition 1 (Healthy condition: Tomato)
Number of trails: 20
Number of correct classification result: 20
Number of wrong classification result: 0
Correct rate: 20/20*100% = 100%
Wrong rate: 0/20*100% = 0%
Based on the statistic above, the outcome of healthy tomato in condition 1 is
considered as high accurate as it only failed 0 times out of 20 trials. In other words, the wrong
rate is 0% out of 100% and the correct rate is 100% out of 100%. This happens because of the
captured image is in good quality and the gathering of sample images for healthy tomato are
available easily.
Unhealthy condition: Bacterial Soft Rot (Cabbage)
Number of trails Classification Result Correct/Wrong
1 Not Vegetable Wrong
2 Bacterial Soft Rot Correct
3 Bacterial Soft Rot Correct
4 Bacterial Soft Rot Correct
5 Bacterial Soft Rot Correct
6 Bacterial Soft Rot Correct
7 Bacterial Soft Rot Correct
8 Bacterial Soft Rot Correct
9 Bacterial Soft Rot Correct
10 Bacterial Soft Rot Correct
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
59 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
11 Bacterial Soft Rot Correct
12 Bacterial Soft Rot Correct
13 Bacterial Soft Rot Correct
14 Bacterial Soft Rot Correct
15 Bacterial Soft Rot Correct
16 Bacterial Soft Rot Correct
17 Bacterial Soft Rot Correct
18 Bacterial Soft Rot Correct
19 Bacterial Soft Rot Correct
20 Black Rot Wrong
Table 6.2.1-T4: Result of testing on condition 1 (Unhealthy condition: Bacterial Soft Rot)
Number of trails: 20
Number of correct classification result: 18
Number of wrong classification result: 2
Correct rate: 18/20*100% = 90%
Wrong rate: 2/20*100% = 10%
Based on the statistic above, the outcome of bacterial soft rot for cabbage in condition
1 is considered as high accurate as it only failed 2 times out of 20 trials. In other words, the
wrong rate is 10% out of 100% and the correct rate is 90% out of 100%. This happens
because of the captured image is in good quality and the distinct disease symptoms compared
with other diseases.
Unhealthy condition: Black Rot (Cabbage)
Number of trails Classification Result Correct/Wrong
1 Black Rot Correct
2 Black Rot Correct
3 Black Rot Correct
4 Black Rot Correct
5 Black Rot Correct
6 Bacterial Soft Rot Wrong
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
60 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
7 Bacterial Soft Rot Wrong
8 Black Rot Correct
9 Black Rot Correct
10 Black Rot Correct
11 Black Rot Correct
12 Bacterial Soft Rot Wrong
13 Black Rot Correct
14 Healthy Cabbage Wrong
15 Black Rot Correct
16 Not Vegetable Wrong
17 Black Rot Correct
18 Black Rot Correct
19 Black Rot Correct
20 Black Rot Correct
Table 6.2.1-T5: Result of testing on condition 1 (Unhealthy condition: Black Rot)
Number of trails: 20
Number of correct classification result: 15
Number of wrong classification result: 5
Correct rate: 15/20*100% = 75%
Wrong rate: 5/20*100% = 25%
Based on the statistic above, the outcome of black rot for cabbage in condition 1 is
considered as accurate as it only failed 5 times out of 20 trials. In other words, the wrong rate
is 25% out of 100% and the correct rate is 75% out of 100%. This happens because of the
captured image is in good quality and the similarity of disease symptoms compared with other
diseases.
Unhealthy condition: Anthracnose (Sweet Pepper)
Number of trails Classification Result Correct/Wrong
1 Anthracnose Correct
2 Healthy Sweet Pepper Wrong
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
61 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
3 Anthracnose Correct
4 Anthracnose Correct
5 Anthracnose Correct
6 Anthracnose Correct
7 Anthracnose Correct
8 Blossom End Rot Wrong
9 Anthracnose Correct
10 Anthracnose Correct
11 Anthracnose Correct
12 Anthracnose Correct
13 Anthracnose Correct
14 Anthracnose Correct
15 Anthracnose Correct
16 Anthracnose Correct
17 Anthracnose Correct
18 Anthracnose Correct
19 Blossom End Rot Wrong
20 Anthracnose Correct
Table 6.2.1-T6: Result of testing on condition 1 (Unhealthy condition: Anthracnose)
Number of trails: 20
Number of correct classification result: 17
Number of wrong classification result: 3
Correct rate: 17/20*100% = 85%
Wrong rate: 3/20*100 = 15%
Based on the statistic above, the outcome of anthracnose for sweet pepper in condition
1 is considered as high accurate as it only failed 3 times out of 20 trials. In other words, the
wrong rate is 15% out of 100% and the correct rate is 85% out of 100%. This happens
because of the captured image is in good quality and the distinct disease symptoms compared
with other diseases.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
62 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Unhealthy condition: Blossom End Rot (Sweet Pepper)
Number of trails Classification Result Correct/Wrong
1 Blossom End Rot Correct
2 Blossom End Rot Correct
3 Anthracnose Wrong
4 Blossom End Rot Correct
5 Blossom End Rot Correct
6 Blossom End Rot Correct
7 Blossom End Rot Correct
8 Blossom End Rot Correct
9 Healthy Sweet Pepper Wrong
10 Blossom End Rot Correct
11 Blossom End Rot Correct
12 Blossom End Rot Correct
13 Blossom End Rot Correct
14 Blossom End Rot Correct
15 Blossom End Rot Correct
16 Anthracnose Wrong
17 Bacterial Spot Wrong
18 Late Blight Wrong
19 Blossom End Rot Correct
20 Blossom End Rot Correct
Table 6.2.1-T7: Result of testing on condition 1 (Unhealthy condition: Blossom End Rot)
Number of trails: 20
Number of correct classification result: 15
Number of wrong classification result: 5
Correct rate: 15/20*100% = 75%
Wrong rate: 5/20*100% = 25%
Based on the statistic above, the outcome of blossom end rot for sweet pepper in
condition 1 is considered as accurate as it only failed 5 times out of 20 trials. In other words,
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
63 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
the wrong rate is 25% out of 100% and the correct rate is 75% out of 100%. This happens
because of the captured image is in good quality and the similarity of disease symptoms
compared with other diseases.
Unhealthy condition: Bacterial Spot (Tomato)
Number of trails Classification Result Correct/Wrong
1 Bacterial Spot Correct
2 Bacterial Spot Correct
3 Bacterial Spot Correct
4 Bacterial Spot Correct
5 Bacterial Spot Correct
6 Bacterial Spot Correct
7 Bacterial Spot Correct
8 Bacterial Spot Correct
9 Healthy Tomato Wrong
10 Bacterial Spot Correct
11 Healthy Tomato Wrong
12 Bacterial Spot Correct
13 Bacterial Spot Correct
14 Bacterial Spot Correct
15 Bacterial Spot Correct
16 Bacterial Spot Correct
17 Bacterial Spot Correct
18 Healthy Tomato Wrong
19 Bacterial Spot Correct
20 Bacterial Spot Correct
Table 6.2.1-T8: Result of testing on condition 1 (Unhealthy condition: Bacterial Spot)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
64 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Number of trails: 20
Number of correct classification result: 17
Number of wrong classification result: 3
Correct rate: 17/20*100% = 85%
Wrong rate: 3/20*100% = 15
Based on the statistic above, the outcome of bacterial spot for tomato in condition 1 is
considered as high accurate as it only failed 3 times out of 20 trials. In other words, the wrong
rate is 15% out of 100% and the correct rate is 85% out of 100%. This happens because of the
captured image is in good quality and the distinct disease symptoms compared with other
diseases.
Unhealthy condition: Late Blight (Tomato)
Number of trails Classification Result Correct/Wrong
1 Bacterial Spot Wrong
2 Late Blight Correct
3 Late Blight Correct
4 Healthy Sweet Pepper Wrong
5 Healthy Tomato Wrong
6 Healthy Tomato Wrong
7 Late Blight Correct
8 Late Blight Correct
9 Late Blight Correct
10 Late Blight Correct
11 Bacterial Spot Wrong
12 Late Blight Correct
13 Healthy Tomato Wrong
14 Late Blight Correct
15 Healthy Tomato Wrong
16 Late Blight Correct
17 Late Blight Correct
18 Healthy Tomato Wrong
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
65 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
19 Bacterial Soft Rot Wrong
20 Late Blight Correct
Table 6.2.1-T9: Result of testing on condition 1 (Unhealthy condition: Late Blight)
Number of trails: 20
Number of correct classification result: 11
Number of wrong classification result: 9
Correct rate: 11/20*100% = 55%
Wrong rate: 9/20*100% = 45%
Based on the statistic above, the outcome of late blight for tomato in condition 1 is
considered as low accurate as it only failed 9 times out of 20 trials. In other words, the wrong
rate is 45% out of 100% and the correct rate is 55% out of 100%. This happens because lack
of sufficient sample image dataset and the similarity of disease symptoms compared with
other diseases despite with the good quality of captured image.
6.2.2 Condition 2 (Hindrance on the camera)
Healthy condition: Cabbage
Number of trails Classification Result Correct/Wrong
1 Healthy Cabbage Correct
2 Black Rot Wrong
3 Black Rot Wrong
4 Black Rot Wrong
5 Healthy Cabbage Correct
6 Bacterial Soft Rot Wrong
7 Healthy Cabbage Correct
8 Black Rot Wrong
9 Healthy Cabbage Correct
10 Bacterial Soft Rot Wrong
11 Black Rot Wrong
12 Black Rot Wrong
13 Black Rot Wrong
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
66 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
14 Bacterial Soft Rot Wrong
15 Black Rot Wrong
16 Not Vegetable Wrong
17 Healthy Cabbage Correct
18 Bacterial Soft Rot Wrong
19 Black Rot Wrong
20 Healthy Cabbage Correct
Table 6.2.2-T1: Result of testing on condition 2 (Healthy condition: Cabbage)
Number of trails: 20
Number of correct classification result: 6
Number of wrong classification result: 14
Correct rate: 6/10*100% = 30%
Wrong rate: 14/10*100% = 70%
Based on the statistic above, the outcome of healthy cabbage in condition 2 is
considered as not accurate as it only failed 14 times out of 20 trials. In other words, the wrong
rate is 70% out of 100% and the correct rate is 30% out of 100%. This happens because of
bad lighting effect which affects the image quality.
Healthy condition: Sweet pepper
Number of trails Classification Result Correct/Wrong
1 Healthy Sweet Pepper Correct
2 Not Vegetable Wrong
3 Not Vegetable Wrong
4 Healthy Sweet Pepper Correct
5 Healthy Sweet Pepper Correct
6 Not Vegetable Wrong
7 Healthy Sweet Pepper Correct
8 Healthy Sweet Pepper Correct
9 Healthy Sweet Pepper Correct
10 Healthy Sweet Pepper Correct
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
67 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
11 Not Vegetable Wrong
12 Not Vegetable Wrong
13 Healthy Sweet Pepper Correct
14 Not Vegetable Wrong
15 Healthy Sweet Pepper Correct
16 Healthy Sweet Pepper Correct
17 Healthy Sweet Pepper Correct
18 Not Vegetable Wrong
19 Healthy Sweet Pepper Correct
20 Not Vegetable Wrong
Table 6.2.2-T2: Result of testing on condition 2 (Healthy condition: Sweet pepper)
Number of trails: 20
Number of correct classification result: 12
Number of wrong classification result: 8
Correct rate: 12/20*100% = 60%
Wrong rate: 8/20*100% = 40%
Based on the statistic above, the outcome of healthy sweet pepper in condition 2 is
considered as accurate as it only failed 8 times out of 20 trials. In other words, the wrong rate
is 40% out of 100% and the correct rate is 70% out of 100%. This happens because of distinct
appearance of the sweet pepper where it slightly overcomes the bad lighting effect that affects
the captured image.
Healthy condition: Tomato
Number of trails Classification Result Correct/Wrong
1 Healthy Tomato Correct
2 Not Vegetable Wrong
3 Healthy Tomato Correct
4 Not Vegetable Wrong
5 Healthy Tomato Correct
6 Healthy Sweet Pepper Wrong
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
68 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
7 Healthy Sweet Pepper Wrong
8 Healthy Tomato Correct
9 Healthy Tomato Correct
10 Healthy Tomato Correct
11 Not Vegetable Wrong
12 Healthy Sweet Pepper Wrong
13 Healthy Tomato Correct
14 Healthy Tomato Correct
15 Healthy Tomato Correct
16 Healthy Tomato Correct
17 Healthy Tomato Correct
18 Not Vegetable Wrong
19 Healthy Tomato Correct
20 Healthy Tomato Correct
Table 6.2.2-T3: Result of testing on condition 2 (Healthy condition: Tomato)
Number of trails: 20
Number of correct classification result: 13
Number of wrong classification result: 7
Correct rate: 13/20*100% = 65%
Wrong rate: 7/20*100% = 35%
Based on the statistic above, the outcome of healthy tomato in condition 2 is
considered as accurate as it only failed 7 times out of 20 trials. In other words, the wrong rate
is 35% out of 100% and the correct rate is 65% out of 100%. This happens because of distinct
appearance of the tomato where it slightly overcomes the bad lighting effect that affects the
captured image.
Unhealthy condition: Bacterial Soft Rot (Cabbage)
Number of trails Classification Result Correct/Wrong
1 Not Vegetable Wrong
2 Not Vegetable Wrong
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
69 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
3 Not Vegetable Wrong
4 Not Vegetable Wrong
5 Black Rot Wrong
6 Bacterial Soft Rot Correct
7 Bacterial Soft Rot Correct
8 Bacterial Soft Rot Correct
9 Not Vegetable Wrong
10 Bacterial Soft Rot Correct
11 Not Vegetable Wrong
12 Not Vegetable Wrong
13 Bacterial Soft Rot Correct
14 Not Vegetable Wrong
15 Bacterial Soft Rot Correct
16 Bacterial Soft Rot Correct
17 Bacterial Soft Rot Correct
18 Not Vegetable Wrong
19 Not Vegetable Wrong
20 Bacterial Soft Rot Correct
Table 6.2.2-T4: Result of testing on condition 2 (Unhealthy condition: Bacterial Soft Rot)
Number of trails: 20
Number of correct classification result: 9
Number of wrong classification result: 11
Correct rate: 9/20*100% = 45%
Wrong rate: 11/20*100% = 55%
Based on the statistic above, the outcome of bacterial soft rot for cabbage in condition
2 is considered as not accurate as it only failed 11 times out of 20 trials. In other words, the
wrong rate is 55% out of 100% and the correct rate is 45% out of 100%. This happens
because of bad lighting effect which affects the image quality.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
70 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Unhealthy Condition: Black Rot (Cabbage)
Number of trails Classification Result Correct/Wrong
1 Not Vegetable Wrong
2 Black Rot Correct
3 Black Rot Correct
4 Bacterial Soft Rot Wrong
5 Black Rot Correct
6 Not Cabbage Wrong
7 Anthracnose Wrong
8 Bacterial Soft Rot Wrong
9 Not Vegetable Wrong
10 Black Rot Correct
11 Black Rot Correct
12 Bacterial Soft Rot Wrong
13 Bacterial Soft Rot Wrong
14 Not Vegetable Wrong
15 Not Vegetable Wrong
16 Anthracnose Wrong
17 Not Vegetable Wrong
18 Not Vegetable Wrong
19 Bacterial Soft Rot Wrong
20 Black Rot Correct
Table 6.2.2-T5: Result of testing on condition 2 (Unhealthy condition: Black Rot)
Number of trails: 20
Number of correct classification result: 6
Number of wrong classification result: 14
Correct rate: 6/20*100% = 30%
Wrong rate: 14/20*100% = 70%
Based on the statistic above, the outcome of black rot for cabbage in condition 2 is
considered as not accurate as it only failed 14 times out of 20 trials. In other words, the wrong
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
71 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
rate is 70% out of 100% and the correct rate is 30% out of 100%. This happens because of
bad lighting effect which affects the image quality.
Unhealthy condition: Anthracnose (Sweet Pepper)
Number of trails Classification Result Correct/Wrong
1 Not Vegetable Wrong
2 Not Vegetable Wrong
3 Anthracnose Correct
4 Not Vegetable Wrong
5 Not Vegetable Wrong
6 Anthracnose Correct
7 Not Vegetable Wrong
8 Anthracnose Correct
9 Not Vegetable Wrong
10 Anthracnose Correct
11 Not Vegetable Wrong
12 Healthy Sweet Pepper Wrong
13 Anthracnose Correct
14 Anthracnose Correct
15 Not Vegetable Wrong
16 Not Vegetable Wrong
17 Not Vegetable Wrong
18 Anthracnose Correct
19 Anthracnose Correct
20 Anthracnose Correct
Table 6.2.2-T6: Result of testing on condition 2 (Unhealthy condition: Anthracnose)
Number of trails: 20
Number of correct classification result: 9
Number of wrong classification result: 11
Correct rate: 10/20*100% = 45%
Wrong rate: 11/20*100% = 55%
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
72 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Based on the statistic above, the outcome of anthracnose for sweet pepper in condition
2 is considered as average accurate as it only failed 11 times out of 20 trials. In other words,
the wrong rate is 55% out of 100% and the correct rate is 45% out of 100%. This happens
because of bad lighting effect which affects the image quality.
Unhealthy condition: Blossom End Rot (Sweet Pepper)
Number of trails Classification Result Correct/Wrong
1 Healthy Sweet pepper Wrong
2 Blossom End Rot Correct
3 Blossom End Rot Correct
4 Healthy Sweet Pepper Wrong
5 Healthy Sweet Pepper Wrong
6 Not Vegetable Wrong
7 Not Vegetable Wrong
8 Blossom End Rot Correct
9 Blossom End Rot Correct
10 Healthy Sweet Pepper Wrong
11 Not Vegetable Wrong
12 Not Vegetable Wrong
13 Not vegetable Wrong
14 Blossom End Rot Correct
15 Not Vegetable Wrong
16 Anthracnose Wrong
17 Blossom End Rot Correct
18 Anthracnose Wrong
19 Not Vegetable Wrong
20 Blossom End Rot Correct
Table 6.2.2-T7: Result of testing on condition 2 (Unhealthy condition: Blossom End Rot)
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
73 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Number of trails: 20
Number of correct classification result: 7
Number of wrong classification result: 13
Correct rate: 7/20*100% = 35%
Wrong rate: 13/20*100% = 65%
Based on the statistic above, the outcome of blossom end rot for sweet pepper in
condition 2 is considered as not accurate as it only failed 13 times out of 20 trials. In other
words, the wrong rate is 65% out of 100% and the correct rate is 35% out of 100%. This
happens because of bad lighting effect which affects the image quality.
Unhealthy condition: Bacterial Spot (Tomato)
Number of trails Classification Result Correct/Wrong
1 Not vegetable Wrong
2 Not vegetable Wrong
3 Bacterial Spot Correct
4 Not Vegetable Wrong
5 Bacterial Spot Correct
6 Bacterial Spot Correct
7 Bacterial Spot Correct
8 Bacterial Spot Correct
9 Not vegetable Wrong
10 Not vegetable Wrong
11 Not vegetable Wrong
12 Not vegetable Wrong
13 Bacterial Spot Correct
14 Bacterial Spot Correct
15 Bacterial Spot Correct
16 Bacterial Spot Correct
17 Healthy Tomato Wrong
18 Bacterial Spot Correct
19 Not vegetable Wrong
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
74 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
20 Bacterial Spot Correct
Table 6.2.2-T8: Result of testing on condition 2 (Unhealthy condition: Bacterial Spot)
Number of trails: 20
Number of correct classification result: 11
Number of wrong classification result: 9
Correct rate: 11/20*100% = 55%
Wrong rate: 9/20*100% = 45%
Based on the statistic above, the outcome of bacterial spot for tomato in condition 2 is
considered as accurate as it only failed 9 times out of 20 trials. In other words, the wrong rate
is 45% out of 100% and the correct rate is 55% out of 100%. This happens because of distinct
disease symptoms of bacterial spot for tomato where it slightly overcomes the bad lighting
effect that affects the captured image.
Unhealthy condition: Late Blight (Tomato)
Number of trails Classification Result Correct/Wrong
1 Late Blight Correct
2 Late Blight Correct
3 Bacterial Spot Wrong
4 Healthy Tomato Wrong
5 Healthy Tomato Wrong
6 Healthy Tomato Wrong
7 Late Blight Correct
8 Healthy Tomato Wrong
9 Late Blight Correct
10 Healthy Tomato Wrong
11 Late Blight Correct
12 Black Rot Wrong
13 Healthy Tomato Wrong
14 Healthy Tomato Wrong
15 Healthy Tomato Wrong
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
75 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
16 Late Blight Correct
17 Not Vegetable Wrong
18 Healthy Tomato Wrong
19 Late Blight Correct
20 Late Blight Correct
Table 6.2.2-T9: Result of testing on condition 2 (Unhealthy condition: Late Blight)
Number of trails: 20
Number of correct classification result: 8
Number of wrong classification result: 12
Correct rate: 8/20*100% = 40%
Wrong rate: 12/20*100% = 60%
Based on the statistic above, the outcome of blossom end rot for sweet pepper in
condition 2 is considered as not accurate as it only failed 12 times out of 20 trials. In other
words, the wrong rate is 60% out of 100% and the correct rate is 40% out of 100%. This
happens because of bad lighting effect which affects the image quality.
6.3 Project Challenges
Undoubtedly, this project is more difficult than initial expected. The completion of
this system would be not possible if most of the challenges that faced in this project were not
solved. The following are the challenges in this project:
Suitable dataset – To train a high accuracy artificial neural network, large quantity and
suitable image dataset is required. In a normal situation, unhealthy plant‟s picture is
hard to obtain as this rarely happen in farm. Thus, it makes the gathering of unhealthy
plant images difficult.
Video streaming network – The purpose of this feature is to allow the user able to
view their plants from other locations where the mobile devices are not connecting in
the same network as the system. Unfortunately, both mobile device and the system
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
76 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
have to being in the same network in order to use this video streaming service. This is
because the limited feature of the video streaming software for Raspberry Pi.
Raspberry Pi Camera – The Raspberry Pi Camera is mainly used to capture images
and for video streaming. However, this camera has 2 flaws which are unable to auto
focus and poor image quality when in poor lighting environment. This causes the
accuracy of the artificial network drops when the captured image is in poor quality.
Machine learning – Due to limited and minimal knowledge about machine learning,
the image classifier function requires longer development time to explore and make it
works. A simple and small artificial neural network was trained to classify few
vegetable plants condition.
6.4 Objectives Evaluation
The first objective was to design a disease detection system using machine technique
for the farmer to reduce the risk of losing their harvest from diseases. This was successfully
achieved as the system is running an image classifier which was train using a machine learn
technique called Transfer Learning. It also shows that the image classifier is able to classify
the image into healthy and unhealthy state based on the testing result in section 6.2.
The second objective was to allow the farmers to take early and correct precaution
through the deployed disease system by suggesting correct solution to take. This was also
successfully achieved in the proposed system mobile application. In the application it has a
notification feature that will alert the farmers if there is any disease state result from the
retrieved data in the mobile application. It also provided a solution for the farmers to take
when they received the notification alert via the mobile application.
Finally, the last objective of this project was to develop and deploy an artificial neural
network that is able to perform disease classification on vegetable plants. This has been
accomplished as the system model deployed in the Raspberry Pi was an artificial neural
network developed using a machine learning technique called Transfer Learning. Based on
the testing result in section 6.2, the trained model was able to perform disease classification
on 3 different vegetable plants which is cabbage, sweet pepper and cucumber.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 6: System Evaluation and Discussion
77 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
6.5 Concluding Remark
The system testing was carried out and performance metrics were obtained to prove
the accuracy of the image classifier. From the testing results, it shown that the accuracy of the
image classifier can be worse if the quality of the captured image is not in good condition.
The project challenges were also identified. Finally, it can be said that all the objectives were
achieved. Hence, the final outcome of this project is quite successful.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 7: Conclusion and Recommendation
78 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
CHAPTER 7: CONCLUSION AND RECOMMENDATION
7.1 Conclusion
The intention of this project is to provide a more reliable method for the farmers to
monitor their farm. The purpose that they need to monitor their farm is because plant disease
is one of the major factors that destroying their harvest. Traditionally, they relied on a non-
practical way to monitor their farm which is direct eye observation. If their farm is big-sized
farm, they might miss some spots in their farm by using this method.
So, at the end of this project, a working full prototype disease detection system was
developed. In this system, it will be capturing image every 6 hours interval and the image
classifier is able to classify the image based on healthy state and category unhealthy one into
different type of disease. The full prototype system is implemented on a Raspberry Pi 3
connected with a Raspberry Pi camera. The system is able to run automatically once the
Raspberry Pi is booted up and all the classification result will be stored in a cloud database.
Finally, an android mobile application is also developed for user to view the data which is
stored in the cloud database. The android mobile application also comes with a notification
service to alert the user when the classification result is disease-positive and a video streaming
feature from the mobile application via Raspberry Pi Camera.
Although this project is proven to be difficult but the project objectives are able to
convert into deliverables such as a disease detection system for farmers, allows farmers to
take early and correct precaution through this system and develop and deploy an artificial
neural network to perform disease classification on vegetable plants. Through the system
testing, this project also can be considered relatively reliable. Provided that the image
captured was in good condition.
Nevertheless, the evolution of IoT technologies is growing fast nowadays. The
potential of this project is so helpful that it can improve the agriculture sector into the next
level.
Machine Learning for Disease Detection using Raspberry Pi with Tensorflow in Vegetable Farms
Chapter 7: Conclusion and Recommendation
79 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
7.2 Recommendation
There are still many improvements and enhancements can be done in this project.
Firstly, the image classification model can be further increase its accuracy by adding bad
condition images such as bad lighting, noise and etc into the model training. This is because
when the camera is capturing the image which is in bad condition it can greatly affect the
result of image classifier. By doing this, the image classifier still able classify the image
accurately despite the captured images are in bad condition.
Next, the system could also be leverage by using servo or a drone with the camera
which allows the system to capture the image of the plants in multiple angles instead of one.
In the current system it only allows to capture image in one fixed angle which makes the
system have blind spot. If the disease started to grow in the blind spot of the disease detection
system, it would be problematic to the user. Hence, this recommendation is to prevent this
blind spot issue.
Furthermore, addition sensors such as temperature sensor and humidity sensor could
be added into the system. This allows the system to make future prediction result instead of
only getting current classification result. Temperature and humidity are one of the few
attributes that need to be analyzed whether a plant disease will happen. As different level
temperature and humidity will be suitable for certain disease to grow. This recommendation is
to prevent this from happening.
80 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
REFERENCES
Rozhan Abu Dardak, 2015, ‘Transformation of Agricultural Sector in Malaysia Through
Agricultural Policy’, FFTC Agricultural Policy Platform, 2 February [online]. Available from:
http://ap.fftc.agnet.org/ap_db.php?id=386&print=1 (Accessed 13 November 2017)
R Sekaran, 2015, ‘Malaysian farmers face losses as disease ravages banana plantations in
Penang’, One Asia, 27 March [online]. Available from:
http://www.asiaone.com/malaysia/malaysian-farmers-face-losses-disease-ravages-banana-
plantations-penang (Accesssed 13 November 2017)
Hariati Azizan, 2016, ‘The Grain Plan’, The Star Online, 24 July [online]. Available from:
https://www.thestar.com.my/news/nation/2016/07/24/the-grain-plan-feed-grain-farming-is-
integral-to-the-countrys-agrofood-scheme-in-attaining-food-sove/ (Accessed 13 November
2017)
Priyanka G. Shinde et al (2017). ‘Plant Disease Detection Using Raspberry PI By K-means
Clustering Algorithm’ [online]. Available from:
http://www.irdindia.in/journal_ijeecs/pdf/vol5_iss1/24.pdf (Accessed 15 November 2017)
Shivani K. Tichkule & Dhanashri. H. Gawali 2016, 'Plant diseases detection using image
processing techniques'. Paper presented at the IEEE Green Engineering and Technologies
(IC-GET), 2016 Online International Conference on
Amanda Ramcharan et al (2017). ‘Deep Learning for Image-Based Cassava Disease
Detection’ [online]. Available from:
https://www.frontiersin.org/articles/10.3389/fpls.2017.01852/full (Accessed 3 March 2018)
Machine Learning Mastery. 2017, „A Gentle Introduction to Transfer Learning for Deep
Learning’ [online]. Available from: https://machinelearningmastery.com/transfer-learning-
for-deep-learning/ (Accessed 3 March 2018)
81 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Mohamed Sami. 2012. Personal website – Software Engineering & Architecture Practices. 15
March 2012. „Software Development Life Cycle Models and Methodologies’ [online].
Available from: https://melsatar.blog/2012/03/15/software-development-life-cycle-models-
and-methodologies/ (Accessed 5 March 2018)
Raspberry Pi Foundation, n.d., „What is Raspberry Pi’. Available from:
https://www.raspberrypi.org/help/what-%20is-a-raspberry-pi/ (Accessed 6 March 2018)
Raspberry Pi Foundation, n.d., „ Raspberry Pi 3 Model B’. Available from:
https://www.raspberrypi.org/products/raspberry-pi-3-model-b/ (Accessed 6 March 2018)
Raspberry Pi Foundation, n.d., „Pi NOIR Camera V2’. Available from:
https://www.raspberrypi.org/products/pi-noir-camera-v2/ (Accessed 6 March 2018)
Embedded Linux Wiki, n.d., „Jetson TK1’. Available from:
https://elinux.org/Jetson_TK1#About_Jetson_TK1 (Accessed 7 March 2018)
Odroid, n.d., „Odroid-C2’. Available from:
http://www.hardkernel.com/main/products/prdt_info.php?g_code=G145457216438&tab_idx=
1 (Accessed 7 March 2018)
Raspbian, n.d., „Welcome to Raspbian’. Available from: https://www.raspbian.org/ (Accessed
8 March 2018)
Max‟s Musings. 2016, „Using TensorBoard to Visualize Image Classification Retraining in
TensorFlow’ [online]. Available from: http://maxmelnick.com/2016/07/04/visualizing-
tensorflow-retrain.html (Accessed 9 March 2018)
82 BIT (HONS) COMMUNICATIONS & NETWORKING
Faculty of Information and Communication Technology (Kampar Campus), UTAR
Lazada, n.d., „NVIDIA Jetson TK1 Development Kit’. Available from:
https://www.lazada.com.my/products/nvidia-jetson-tk1-development-kit-i242725459-
s319621835.html?spm=a2o4k.searchlist.list.1.39955f65YPVXdN&search=1 (Accessed 15
March 2018)
Opensource.com, n.d., ‘What is Raspberry Pi’. Available from:
https://opensource.com/resources/raspberry-pi (Accessed 15 March 2018)
Element14, n.d., „ RASPBERRYPI3-MODB-1GB. - Single Board Computer, Raspberry Pi 3
Model B, 1.2GHz CPU, 1GB RAM, WiFi/BLE, 40 GPIO Pins’. Available from:
http://my.element14.com/raspberry-pi/raspberrypi-modb-1gb/raspberry-pi-3-model-
b/dp/2525226 (Accessed 15 March 2018)
Tutorialpoint, n.d., ‘Firebase-Write Data’. Available from:
https://www.tutorialspoint.com/firebase/firebase_write_data.htm (Accessed 15 March 2018)
APPENDIX 1 – BI WEEKLY REPORT
FINAL YEAR PROJECT WEEKLY REPORT Project II
Trimester, Year: Year 3 Semester 3 Study week no.: 2
Student Name & ID: Khoo Wah Jian - 1507159
Supervisor: Dr. Goh Hock Guan
Project Title: Machine Learning for Disease Detection using Raspberry Pi with
Tensorflow in Vegetable Farms
1. WORK DONE
- Discussed more in detail about GUI design for the project.
- Discussed about expanding the image classifier model by training more vegetable plants.
2. WORK TO BE DONE
- Begin the development of GUI.
- Begin research about what vegetable plants to be added into the image classifier model.
3. PROBLEMS ENCOUNTERED
- None.
4. SELF EVALUATION OF THE PROGRESS
- Knowledge about android development and vegetables improved.
_________________________ _________________________
Supervisor‟s signature Student‟s signature
FINAL YEAR PROJECT WEEKLY REPORT Project II
Trimester, Year: Year 3 Semester 3 Study week no.: 4
Student Name & ID: Khoo Wah Jian - 1507159
Supervisor: Dr. Goh Hock Guan
Project Title: Machine Learning for Disease Detection using Raspberry Pi with
Tensorflow in Vegetable Farms
1. WORK DONE
- Discussed and determined the full system architecture, full system flow and functional
requirements.
- System hardware setup is completed
2. WORK TO BE DONE
- Finalized the GUI development.
- Begin to train the new image classifier model.
3. PROBLEMS ENCOUNTERED
- Android application not able to retrieve data from the firebase.
- Camera streaming is not able to start.
4. SELF EVALUATION OF THE PROGRESS
- Knowledge about agriculture improving.
- Work is behind schedule. Need a proper planning so that I do not need to rush for GUI and
database completion.
_________________________ _________________________
Supervisor‟s signature Student‟s signature
FINAL YEAR PROJECT WEEKLY REPORT Project II
Trimester, Year: Year 3 Semester 3 Study week no.: 8
Student Name & ID: Khoo Wah Jian - 1507159
Supervisor: Dr. Goh Hock Guan
Project Title: Machine Learning for Disease Detection using Raspberry Pi with
Tensorflow in Vegetable Farms
1. WORK DONE
- GUI and database is development is completed.
- Successfully trained the new image classifier with more type of vegetable plants.
2. WORK TO BE DONE
- Begin testing the new image classifier.
-Begin to combine the system hardware with my teammate.
-Begin writing the report
3. PROBLEMS ENCOUNTERED
- Having difficulty in developing the video streaming feature.
- Having trouble to obtain image dataset for image classifier training
4. SELF EVALUATION OF THE PROGRESS
- Work was progressing as scheduled.
_________________________ _________________________
Supervisor‟s signature Student‟s signature
FINAL YEAR PROJECT WEEKLY REPORT Project II
Trimester, Year: Year 3 Semester 3 Study week no.: 10
Student Name & ID: Khoo Wah Jian – 1507159
Supervisor: Dr. Goh Hock Guan
Project Title: Machine Learning for Disease Detection using Raspberry Pi with
Tensorflow in Vegetable Farms
1. WORK DONE
- System architecture, system flow and functional requirement were finalized.
- The new image classifier was deployed and tested.
- System hardware combine was completed.
2. WORK TO BE DONE
- Improve the image classifier by tuning different parameter in training process.
- Begin mobile application software combine with my teammate.
- Finalize the draft report.
3. PROBLEMS ENCOUNTERED
- Having difficult writing system testing in report.
- Having difficult combining the source codes for hardware part.
4. SELF EVALUATION OF THE PROGRESS
- System hardware combination is done. Have better understand on overview of the project.
- Work is progressing as scheduled.
_________________________ _________________________
Supervisor‟s signature Student‟s signature
FINAL YEAR PROJECT WEEKLY REPORT Project II
Trimester, Year: Year 3 Semester 3 Study week no.: 12
Student Name & ID: Khoo Wah Jian - 1507159
Supervisor: Dr. Goh Hock Guan
Project Title: Machine Learning for Disease Detection using Raspberry Pi with
Tensorflow in Vegetable Farms
1. WORK DONE
- System hardware and software combine was completed.
- Draft report was completed.
2. WORK TO BE DONE
- Start full system testing.
- Modify the draft report and finalize the final report.
3. PROBLEMS ENCOUNTERED
- None.
4. SELF EVALUATION OF THE PROGRESS
- Have better understand on the full system.
_________________________ _________________________
Supervisor‟s signature Student‟s signature
FINAL YEAR PROJECT WEEKLY REPORT
Project II
Trimester, Year: Year 3 Semester 3 Study week no.: 13
Student Name & ID: Khoo Wah Jian - 1507159
Supervisor: Dr. Goh Hock Guan
Project Title: Machine Learning for Disease Detection using Raspberry Pi with
Tensorflow in Vegetable Farms
1. WORK DONE
- Full system testing was completed.
- Final report was completed.
2. WORK TO BE DONE
- Prepare presentation slides
- Make minor configuration on the system for demonstration.
3. PROBLEMS ENCOUNTERED
- Having Trouble is finalizing the final report.
4. SELF EVALUATION OF THE PROGRESS
- Confident for demonstration of the full functionalities of the system.
_________________________ _________________________
Supervisor‟s signature Student‟s signature
POSTER
APPENDIX 2 – TURNITIN ORIGINALITY REPORT
PLAGIARISM CHECK RESULT
FACULTY OF INFORMATION AND COMMUNICATION TECHNOLOGY
Full Name(s)of Candidate(s)
Khoo Wah Jian
ID Number(s)
1507159
Programme /Course CN
Title of Final Year Project Machine Learning for Disease Detection using Raspberry Pi
with Tensorflow in Vegetable Farms
WITH TENSORFLOW IN VEGETABLE FARMS
Similarity Supervisor’s Comments (Compulsory if parameters of originality exceeds the limits approved by UTAR)
Overall similarity index:___ %
Similarity by source Internet Sources: _______________% Publications: _________ % Student Papers:_________ %
Number of individual sources listed of more than 3%similarity:
Parameters of originality required and limits approved by UTAR are as Follows: (i) Overall similarity index is 20% and below, and
(ii) Matching of individual sources listed mustbelessthan3%each, and (iii)Matching texts in continuous block must not exceed 8 words
Note: Parameters (i ) - (ii) shall exclude quotes, bibliography and text matches which are less than 8 words.
Note Supervisor/Candidate(s) is/are required to provide softcopy off full set of the originality report to
Faculty/Institute Based on the above results, I hereby declare that I am satisfied with the originality of the Final Year
Project Report submitted by my student(s) as named above. ______________________________ ______________________________ Signature of Supervisor
Signature of Co-Supervisor
Name: __________________________
Name: __________________________
Date: ___________________________ Date: ___________________________
Universiti Tunku Abdul Rahman
Form Title :Supervisor’s Comments on Originality Report Generated by Turnitin for Submission of Final Year Project Report (for Undergraduate Programmes) Form Number: FM-IAD-005 Rev No.:0 Effective Date: 01/10/2013 Page No.: 1 of 1
UNIVERSITI TUNKU ABDUL RAHMAN
FACULTY OF INFORMATION & COMMUNICATION
TECHNOLOGY (KAMPAR CAMPUS)
CHECKLIST FOR FYP2 THESIS SUBMISSION
Student Id 1507159
Student Name Khoo Wah Jian
Supervisor Name Dr. Goh Hock Guan
TICK (√) DOCUMENT ITEMS
Your report must include all the items below. Put a tick on the left column after you have
checked your report with respect to the corresponding item.
Front Cover
Signed Report Status Declaration Form
Title Page
Signed form of the Declaration of Originality
Acknowledgement
Abstract
Table of Contents
List of Figures (if applicable)
List of Tables (if applicable)
List of Symbols (if applicable)
List of Abbreviations (if applicable)
Chapters / Content
Bibliography (or References)
All references in bibliography are cited in the thesis, especially in the chapter of literature review
Appendices (if applicable)
Poster
Signed Turnitin Report (Plagiarism Check Result - FormNumber:FM-IAD-005)
*Include this form (checklist) in the thesis (Bind together as the last page) I, the author, have checked and confirmed all the items listed in the table are included in my report. ______________________ (Signature of Student) Date:
Supervisor verification. Report with incorrect
format can get 5 mark (1 grade) reduction. ______________________ (Signature of Supervisor) Date: