This presentation describes a research work in which constitutional neural network is used for fruit’s classification and recognizing their diseases. CNN is the popular , advanced and powerful architecture of Neural Network. The method describe in this presentation perform better than other classification and recognition techniques on various datasets and it is not affected by illumination, translation and occlusion problems.
Unleash Your Potential - Namagunga Girls Coding Club
Classification of Apple diseases through machine learning
1. An Automated System for Early Identification
of Diseases in Apple through Machine
Learning
Muqaddas Bin Tahir
MS(Computer Science)
HITEC University
2. Presentation Outline
Introduction
Motivation
Literature Review
Problem Statement
Objective
Proposed Methodology
Results and Analysis
Comparison
Conclusion and Future work
References
2
Department of Computer Science HITEC University
4. Introduction
Important agricultural crops are threatened by a variety of
plant diseases and pests.
About 42% of the world’s total agriculture crops are
destroyed yearly [8].
In this dissertation a hybrid method is developed to
classify 4 different types of Apple diseases.
Apple leaf is used as a test case
4
5. Introduction
Proposed Method: Dataset Description:
Data Acquisition
Data Normalization
Transfer Learning
Convolution
Feature Extraction
Feature Fusion
Variance Control
Classification
5
Apple Scab
630 Images
Black Rot
621 Images
Apple Cedar
275 Images
Healthy
1645 Images
7. Introduction
7
Approaches used to control different diseases
(1)
Regular survey of Experts
(2)
Spray after passing
certain time limit
(3)
Naked Eye Survey of
Farmer
(4)
Used of Different
Image Processing
Techniques’
(5)
Use of AI and
Machine Leaning
in Agriculture
9. Motivation
Identification of diseases in plants is a critical research problem in the domain of computer vision
and agriculture.
For identification of diseases, mostly farmers rely on their naked eyes. But some diseases are not
easily recognizable through naked eyes.
Mostly farmers are unable to procure expensive systems for plant protection or regular monitoring
of experts.
In last decade, different types of image processing techniques play crucial role in identification of
plant diseases. But majority of techniques are time consuming, complex and lengthy.
So there is a strong motivation for introducing a system which can be quickly and easily trained to
work with different lighting conditions, different angles, and all types of diseases.
In this dissertation, the Apple fruit is used as test case. 50 lac tons is the total production of apples
all over the world of which 13 lac 35 thousand tons are grown in Pakistan. In this dissertation,
different concepts of machine learning are used to quickly and accurately classify diverse apple
diseases.
9
Department of Computer Science HITEC University
11. Literature Review
11
Department of Computer Science HITEC University
SR Authors Main Goals Methodology Issues
1 Yun Zhang
(2017)
--------------
Accuracy
(97.63%)
Identification of
Apple Diseases with
the help of Neural
network.
PCA Jittering
-------------------------------------------------
Convolutional Neural Network
(AlexNet, VGGNet)
--------------------------------------------------
NAG Algorithm
--------------------------------------------------
GoogleNet Inception
Scalability issues
---------------------------------------
Computational Cost is High
----------------------------------------
Expensive (not easily affordable for
Individual persons).
-----------------------------------------
Not applicable for real time environment.
2 Shiv Ram
Dubey
(2017)
--------------
Accuracy
(93%)
Identification of
Apple Diseases with
the help of Neural
network.
K - Mean Clustering
----------------------------------------------
Global Color Histogram
Color coherence vector
Local Binary Pattern
Complete local Binary Pattern
--------------------------------------------------
SVM (support Vector Machine)
Multiclass SVM
Time consuming Process.
-----------------------------------
Not Good for large Databases
------------------------------------
Fusion of more than one feature will improve the output
----------------------------------------------------------------------------
In SVM, it is much difficult to map original data into higher
dimension by using kernel function and their parameters.
-----------------------------------------------------
One biggest gap of SVM is that it correctly works only with
two classes at a time.
12. Literature Review
12
Department of Computer Science HITEC University
SR Authors Main Goals Methodology Issues
3 Srdjan
Sladojevic
(2016)
--------------
Accuracy
(96.3%)
Identification of Apple
Diseases with the help of
Deep Neural network.
Convolution Neural Network
--------------------------------------------------
ReLu
--------------------------------------------------
Softmax
--------------------------------------------------
OpenCV
Time taking process (Slow)
4 Prabira
Kumar Sethy
(2017)
--------------
Accuracy
(97.63%)
Detection of Diseases in Rice
Crop Leaves
K - Mean Clustering
--------------------------------------------------
3 - Mean Clustering
Algorithm does not work if leaf is
defected by two or more diseases
simultaneously.
13. Literature Review
13
Department of Computer Science HITEC University
SR Authors Main Goals Methodology Issues
5 Shiv Ram
Dubey
(2014)
--------------
Accuracy
(95%)
Detection of
Fruit Diseases
K - Mean Clustering
------------------------------------------------------
Global Color Histogram
Color Coherence Vector
Local Binary Pattern
Complete Local Binary Pattern
------------------------------------------------------
SVM (support Vector Machine)
Multiclass SVM
Time taking Process
--------------------------
Without Fusion of features such method seems
impractical.
-----------------------------------------
Color histogram is not so good. Its information does
not cover all the aspects because, sometimes, image
with very different appearance can have similar
histograms.
-------------------------------------------
Binary data is sensitive to noise.
6 Guan Wang
(2017)
--------------
Accuracy
(90.4%)
Identification of
different plant
diseases
Convolution Neural Network
(AlexNet , VGGnet, ResNet)
-----------------------------------------------------
ReLu
------------------------------------------------------
Softmax
In case of Softmax Classifier, much calculation is
required if you have a complex training data with
many labels.
--------------------------------------------
Use of some more versatile sensors like infrared in
image acquisition can enhance the result accuracy.
14. Literature Review14
Department of Computer Science HITEC University
SR Authors Main Goals Methodology Gaps
7 Misigo Ronald,
Miriti Evan
(2016)
--------------
Accuracy (80%)
Classification of Different Apple
Types
Naive Bayes
-----------------------------------------
Otsu algorithm
Naive Bayes can learn individual features easily
but can’t determine the relationship among
features.
8 Savita N. Ghaiwat
et al
(2014)
Review of methodologies use in
detection and classification of
plant leaf diseases.
Artificial Neural Network
-----------------------------------------
Support Vector Machine
-----------------------------------------
Self Organization Maps
-----------------------------------------
Fuzzy Logic
In SVM computational complexity is reduced to
quadratic optimization problem and it’s easy to
control complexity of decision rule and
frequency of error.
----------------------------------------------
In neural network it’s difficult to understand
structure of algorithm and to determine
optimal parameters when training data is
not linearly separable.
15. Literature Review15
Department of Computer Science HITEC University
SR Authors Main Goals Methodology Gaps
9 Mrunalini R.
et al
(2011)
Pattern recognition
for crop diseases
K-means clustering and artificial
intelligence
Artificial neural network and fuzzy
logic with some other soft computing
technique can be used to classify the
crop diseases
10 Sabah Bashir
et al
(2012)
Remote area plant disease
detection using image
processing
Co-occurrence matrix method and K-means
clustering technique for texture segmentation.
Bayes classifier, K-means clustering
and principal component classifier can
be used to classify various plant
diseases
16. Literature Review16
Department of Computer Science HITEC University
SR Authors Main Goals Methodology Gaps
11 Smita
Naikwadi
et al
(2013)
Advances In Image
Processing For
Detection Of Plant
Diseases
Spatial Gray-level
Dependence
Matrices, Color Co-occurrence
texture analysis method
Better detection results can
be obtained with the large
database and advanced feature
of color extraction
12 Di Cui ,
Qin Zhang
(2009)
Detection of soybean rust using
a multispectral Image sensor
Multispectral image sensor, Research need to be carried out to verify
the correlation between DVI and rust
severity.
--------------------------------------------
Comprehensive studies are needed to
verify sensible range and accuracy of this
method in different environments.
18. Problem Statement
Many techniques have been implemented in the domain of agriculture for detection and
classification of fruit diseases. Most of these techniques focus on hand crafted features which
do not yield promising results due to several factors such as change in illumination, translation,
occlusion, rotation etc.
18
Department of Computer Science HITEC University
19. Problem Statement
In this research work, various issues related to detection of diseases are:-
Choice of color spaces.
Selection of distinct features
Selection of useful features.
Weak contrast and boundaries.
Inhomogeneous object region during image segmentation.
Irregular shape during feature extraction.
Similarities between defected and normal apple.
Different symptoms but similar features and similar shape.
Scalability issues (No fixed parameter for scale adjustment of different diseases)
19
Department of Computer Science HITEC University
21. Objective
Develop an efficient methodology using computer vision and machine learning techniques for
detection and classification of apple diseases by incorporating the following :-
Perform pre-processing to improve the visual contrast of disease spots in the input image.
The task is to fine tune an end to end Convolutional neural network for Identification of Diseases that
can perform better than other diseases identification techniques .
Extract Deep CNN features by segmenting mapped RGB images and use SVM for classification.
Carry out simulation results of the proposed system on publically available dataset.
The system thus developed will be less affected by illumination, translation and occlusion problems
and will offer a more general solution.
Perform comparison of the proposed system with the existing methods.
Department of Computer Science HITEC University
21
25. Dataset Detail (Sample Images)
Apple Scab Black Rot Apple Cidar Healthy Images
630 Images 621 Images 275 Images 1645 Images
Total Images 3171
25
Department of Computer Science HITEC University
26. Proposed Method
In the proposed model, four different types of Apple diseases are classified with the
help of Transfer Learning by using Inception-v3 ,a neural network model.
26
Department of Computer Science HITEC University
28. Proposed Model
Transfer Learning
Transfer learning is a machine learning method where a model
developed for a task is reused as the starting point for a model on a
second task.
Main Advantages of TL
Reduce computational resources
Less computational time
Best for small dataset.
Reduce time for Learning
28
Department of Computer Science HITEC University
30. The approach to build from scratch demands
extensive computational resources,
requires substantial training time
lots of training data.
Concept of transfer learning seems the most plausible method.
ImageNet, and its Large Visual Recognition Challenge.
Inception V3 is the model Google Brain Team has built for the same purpose.
which is used further in the proposed technique.
30
Department of Computer Science HITEC University
Proposed Model
Why Transfer Learning
CHALLENGE
Models try to classify a huge collection of
images into 1000 classes, like “Zebra”,
“orange”, and “Dishwasher”.
32. 32
Department of Computer Science HITEC University
The Inception network was an important milestone in the development
of CNN classifiers. The Inception deep convolutional architecture was
introduced as GoogLeNet in (Szegedy et al. 2015a),
Inception Network is most popular CNN Network due to its stacked
convolution layers deeper and deeper, to get better performance.
It uses a lot of tricks to boost performance; both in terms of Speed and
Accuracy.
Inception network has total four types ( Inception V1, V2, V3, V4)
Proposed Model
Inception V3
33. 33
Department of Computer Science HITEC University
Proposed Model
Inception V3
Inception CNN
Network
Inception V1
Introduced by (GoogLeNet 2015),
Inception V2
(Batch Normalization)
Inception V3
(Factorization Ideas)
34. 34
In the proposed method Inception V3 is used.
Inception V3 used in the proposed method has total 316 Layers.
Division of layers and categories used in proposed approach:
Proposed Model
Inception V3 Architecture
Layers Name Number of Layers Layers Name Number of Layers
Image Input Layer 1 Softmax 1
Scaling Layer 1 Classification Output Layer 1
Batch Normalization Layer 95
Convolution Layer 94
ReLu 94
Max Pooling 4
Average Pooling 9
Depth Concatenation Layer 15
Fully Connected Layer 1
36. Experimental Setup
Used a publicly available datasets such as Plant Village.
For Classification different classifiers are tested
Fine Tree , Medium Tree ...
Linear Discriminant Analysis (LDA)
Support vector machine
K-Nearest Neighbour (KNN)
ensemble trees and etc are used.
Eight statistical measures are utilized for performance analysis ,such a
Sensitivity
Precision
Accuracy
False Negative Rate (FNR),
False Positive Rate (FPR)
Area under the Curve (AUC)
36
37. Experimental Setup
Hardware Setup
Processor Core i 5
RAM 6 GB
Graphics Card Nvidia Quadro
Software Setup
37
Software Name/Type Description Version
Operating System Window 7 64 bit
Scripting Language Matlab 2018
Development Environment Matlab 2018
38. Dataset Description (PlantVillage)
Apple Scab Black Rot Apple Cidar Healthy Images
630 Images 621 Images 275 Images 1645 Images
Total Images 3171
38
Department of Computer Science HITEC University
40. Ratios for Training and Testing images
Department of Computer Science HITEC University
40
Apple Scab Black Rot Apple Cedar Healthy
Training
(%)
Testing
(%)
Training
(%)
Testing
(%)
Training
(%)
Testing
(%)
Training
(%)
Testing
(%)
Phase - I 80 20 80 20 80 20 80 20
Phase - II 70 30 70 30 70 30 70 30
Phase - III 50 50 50 50 50 50 50 50
67. Conclusion
From the comparison with existing techniques, it is evident that the proposed
approach is significant in terms of disease classification accuracy.
67
Researcher Year Method Accuracy
1 Yun Zhang 2017 CNN 97.62 %
2 Qin et al 2016 ReliefF method, SVM 94.74 %
3 Mc Donald, Stewart 2014 Automated image analysis 92 %
4 Barbedo 2014 B/W image Segmentation 89 %
5 Rothe et al 2015 Active contour model 85 %
6 Tan et al 2016 CNN 96.08
7 Islam et al 2017 SVM 95 %
8 Shiv Ram Dubey 2014 K-Mean , SVM 95%
9 Lucas G. Nachtigall 2016 CNN 97%
10 Misigo Ronald 2016 Naive Bayes, Otsu algorithm 80%
11 Mostafa Mehdipour Ghazi 2017 CNN, AlexNet, VGGNet, GoogleNet 80%
12 Guan Wang 2017 CNN, VGG16, VGG19, ResNet 90.4%
13 Proposed Work 2019 Transfer Learning, CNN, Inception V3 97.0%
68. Future Work
Dataset used in the proposed method can be extended to all apple diseases.
Other methods can be used for transfer learning.
This work is focused on front view of Apple leaf but can be extended to side
view and back view also.
Fusion of some other advance features will improve the output.
Real Time Detection of Diseases will further help the farmers to protect crops
from diseases in more fast way.
Should be trained on wild images of infected leaves as well.
68
Department of Computer Science HITEC University
69. References
[1] Bin Liu; Yun Zhang; Dong Jian He “Identification of Apple leaf diseases based on Deep Convolutional neural network”.
Symmetry 2018 10(1), 11.
[2] Qin, F.; Liu, D.X.; Sun, B.D.; Ruan, L.; Ma, Z.; Wang, H. “Identification of alfalfa leaf diseases using image recognition
technology”. PLoS ONE 2016, 11, e0168274.
[3] E. L. Stewart and B. A. McDonald, “Measuring quantitative virulence in the wheat pathogen zymoseptoria tritici using high-
throughput automated image analysis” Phytopathology, vol. 104, no. 9, pp. 985–992, 2014.
[4] J. G. A. Barbedo, “An automatic method to detect and measure leaf disease symptoms using digital image processing” Plant
Disease, vol. 98, no. 12, pp. 1709–1716, 2014.
[5] Rothe, P.R.; Kshirsagar, R.V. “Cotton leaf disease identification using pattern recognition techniques”. In Proceedings of the
2015 International Conference on Pervasive Computing, Pune, India, 8–10 January 2015; pp. 1–6.
[6] Tan, W.X.; Zhao, C.J.; Wu, H.R. “CNN intelligent early warning for apple skin lesion image acquired by infrared video
sensors”. High Technol. Lett. 2016, 22, 67–74.
[7] Islam, M.; Dinh, A.; Wahid, K.; Bhowmik, P. “Detection of potato diseases using image segmentation and multiclass support
vector machine”. In Proceedings of the 30th IEEE Canadian Conference on Electrical and Computer Engineering, Windsor, ON,
Canada, 30 April–3 May 2017; pp. 1–4.
[8] http://www.dostpakistan.pk/pakistan-worlds-10th-largest-apple-producer/ :Apple Production in Pakistan
69
Department of Computer Science HITEC University
71. Glossary (Some Basic Terminologies)
Artificial Neural Network
ANN is inspired by the neural structure of the brain of animals. The fundamental processing unit of
a neural network is a single neuron. A biological neuron receives inputs from other neurons,
combines it in some manner, performs an operation on the result, and then produce the outputs
as the result.
Neuron
Neuron is the basic unit of a neural network that gets input values and bias values. Each input
value has an associated weight. When a value arrives at neuron, it gets multiplied by the
associated weight. These weights can be updated during training time.
Connections
Neuron in the same layer or another layer is connected by connections that have always a weight
value associated with it. These weights values represent the relationship between neurons. The
stronger the relationship between neuron is, higher the value of weight is. During the training of
neural network, the values of these weights are adjusted to reduce error.
71
72. Glossary (Some Basic Terminologies)
Layers used in Neural Network
Input Layer
First layer of neural network is called input layer that takes input values and pass these values to
the next layer of neural network. No operation is performed on the input values in this layer and it
doesn’t have any weights and biases associated with it.
Hidden Layer
Input layer usually pass input values to hidden layers which apply the different transformation to
these inputs so that the output layer can use these transformation. There may be one or more
hidden layers in any neural network; however the number of input layer depends upon the
complexity of the problem. Usually some activation is applied on each hidden layer. The output of
final hidden layer is forwarded to the output layer.
Output Layer
The output layer is the final layer of neural network that receive its input from the last hidden layer.
Output layer act as classifier and predict the output class for the task of classification.
72
73. Glossary (Some Basic Terminologies)
Deep Learning
Deep learning is the sub domain of machine learning. The term “deep” is used to describe the
development of many layered neural networks. For training a deep learning model a huge set of
labeled data and a neural network with many layers is required. Usually by increasing the size of
data, the deep learning improves its accuracy.
Deep learning models can achieve very high accuracy, sometimes the accuracy that is better than
human-level.
Activation functions
Activation functions also called transfer function are used to introduce non-linearity to neural
networks. It takes values in form of vector or matrix and squashes the input values in a smaller
range. This range depends on the activation function being used.
73
74. Glossary (Some Basic Terminologies)
Convolution Layer
The convolution layers extract features from raw data. Convolutional layers have parameters
(kernel) that are learned so that these filters are adjusted automatically to extract the most useful
information of feature.
The CNN extract features through an operation called convolution.
74
75. Glossary (Some Basic Terminologies)
Pooling
Pooling layer is also used to shrink the input volume area. Information or data
reduction is done in a way that requirement image may not disturb and reduced data
is received with features present which is required for categorization. Two types of
pooling are mostly used (Max Pooling, Average pooling)
Department of Computer Science HITEC University
75
76. Glossary (Some Basic Terminologies)
ReLu Layer
ReLu layer is also called a Rectified linear unit. At this level, if the value is negative then it is
changed to zero and if its greater than zero then it resumes its weight.
ReLu function can be written in the following form
Convert linear to non-linear.
Department of Computer Science HITEC University
76
77. Glossary (Some Basic Terminologies)
SoftMax
The Softmax function is used in neural network for multi-classification output.The softmax
activation function is used to convert an arbitrary real value to posterior probability
DropOut Layer
Deep neural network usually contains a large number of parameters, multiple hidden layers
and learn the complicated relationship between the inputs and outputs. While training with
few data, it might be possible that many of these complicated relationships will be the result
of noise. This will lead to a problem of over-fitting.
Batch Normalization
Batch Normalization Accelerating Deep Network Training by Reducing Internal Covariate
Shift. Today, Batch Normalization is used in almost all CNN architectures. Batch
Normalization is used to achieve hide learning rate , less dropout.
Department of Computer Science HITEC University
77
78. Glossary (Some Basic Terminologies)
Fully Connected Layer
Fully connected layer is used for classification by using the features obtained from the
convolution and pooling layers. The fully connected layer uses the softmax activation on its
last layer that converts the values into the probabilities.
Department of Computer Science HITEC University
78
79. Glossary (Some Basic Terminologies)
Factorizing Convolution
The aim of factorizing convolution is to reduce the number of connections/ parameters
without decreasing the network efficiency.
Department of Computer Science HITEC University
79