You are on page 1of 50

IMAGE BASED PLANT DISEASE CLASSIFICATION USING DEEP

LEARNING

A PROJECT REPORT

Submitted by

TRIPURAMALLU CHAITANYA

MADDURI VAMSHI VARDHAN REDDY

AKULA UPENDRANATH

Under the Guidance of

Dr. P. ESTHER RANI

in partial fulfillment for the award of the degree

of

BACHELOR OF TECHNOLOGY

in

ELECTRONICS & COMMUNICATION ENGINEERING

DECEMBER 2020
BONAFIDE CERTIFICATE

Certified that this project report entitled “IMAGE BASED PLANT DISEASE CLASSIFI-
CATION USING DEEP LEARNING” is the bonafide work of “TRIPURAMALLU CHAI-
TANYA (17UEEC0493),MADDURI VAMSHI VARDHAN REDDY(17UEEC0265) and
AKULA UPENDRANATH (17UEEC0012)”.

SUPERVISOR HEAD OF THE DEPARTMENT

Dr. P. ESTHER RANI Dr. R. S. VALARMATHI


Professor Professor
Department of ECE Department of ECE

Submitted for Evaluation of project held on:−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

INTERNAL EXAMINER EXTERNAL EXAMINER

ii
ACKNOWLEDGEMENT

We express our deepest gratitude to our respected Founder President and Chancellor COL.
PROF. VEL. Dr. R. RANGARAJAN, Foundress President Dr. SAGUNTHALA RANGARAJAN,
Chairperson Managing Trustee and Vice President.

We would like to express our gratitude towards our vice Chancellor PROF. Dr. S. SALIVAHANAN
for providing us with an environment to complete the work successfully.

We obligated to our beloved Registrar Dr. E. KANNAN, for providing immense support in all our
endeavours.

We thankful to our esteemed Dean Academics Dr. A.T. RAVICHANDRAN, for his kind cooperation
and encouragement.

We extremely thankful and pay our gratitude to our Dean Dr. V. JAYASANKAR for enormous care
and encouragement towards us through out the project.

It is a great pleasure for us to acknowledge the assistance and contributions of our Head of the Depart-
ment Dr. R. S. VALARMATHI for her useful suggestions, which helped us in completing the work,
in time and we thank her for being instrumental in the completion of project with her encouragement
and unwavering support.

We extremely thankful and pay our gratitude to our guide Prof. Dr. P. ESTHER RANI for her
valuable guidance and support on completion of this project. We thank our department faculty, sup-
porting staffs for their help and guidance to complete this project

TRIPURAMALLU CHAITANYA

AKULA UPENDRANATH

M. VAMSHI VARDHAN REDDY

iii
ABSTRACT

Crop diseases are a major threat to food security and their rapid identification remains diffi-
cult in many parts of the world due to the lack of the necessary infrastructure. The advent of machine
and deep learning techniques has paved way for detection of plants affected with disease and also
identify the type of disease. This will be very useful for the farmers to take a decision in combating
the disease and also in achieving good yield which in turn serves to improve our economical growth
as agriculture is the main backbone of our country.
In this project a plant disease detection based on deep learning is proposed. Initially a CNN architec-
ture based on DenseNet is used to train a dataset that is of publicly available, containing images of
healthy leave and that which are affected by various diseases. This DensNet makes use of convolution
layers, dense blocks, transition layers for deep feature extraction and finally uses global average pool-
ing and softmax layer for classification. The proposed work provides a training efficiency 99.1% and
validation accuracy of 97.38%. The performance of the network is also compared in terms of recall,
precision and f1-score for different classes and is found to have an average value of 97.67%, 97.08%
and 97.313% respectively. The project is to be implemented using PYTHON.

iv
TABLE OF CONTENTS

CONTENT PAGE NO.

LIST OF TABLES vii

LIST OF FIGURES viii

LIST OF ABBREVIATIONS ix

1 INTRODUCTION 1
1.1 DEEP LEARNING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 MOTIVATION AND ORGANIZATION OF REPORT . . . . . . . . . . . . . . . . . . 6

2 LITERATURE SURVEY 8
2.1 Using deep transfer learning for image based plant disease identification . . . . . . . . 8
2.2 Identification of rice diseases using deep convolutional neural networks . . . . . . . . . 9
2.3 Rice heading stage automatic observation by multi-classifier cascade based rice spike
detection method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 Factors influencing the use of deep learning for plant disease recognition . . . . . . . . 9
2.5 Leaf image based cucumber disease recognition using sparse representation classification 10
2.6 Fast and accurate detection and classification of plant diseases . . . . . . . . . . . . . 10

3 IMPLEMENTATION USING DENSENET 12


3.1 Data set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.2 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.3 Explanation of layers and parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.4 Internal working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5 Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4 IMPLEMENTATION USING CNN 17


4.1 Explanation of layers and parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Internal working . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3 Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

v
5 SOFTWARE REQUIREMENT 22
5.1 LIBRARIES USED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

6 RESULTS AND DISCUSSIONS 28


6.1 Results for DenseNet model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.2 Results for CNN model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.3 Comparison between two proposed models . . . . . . . . . . . . . . . . . . . . . . . . . 38

7 CONCLUSION 39

8 FUTURE SCOPE 40

REFERENCES 40

vi
LIST OF TABLES

6.1 Estimation of parameters in DenseNet . . . . . . . . . . . . . . . . . . . . . . . . . . . 33


6.2 Estimation of parameters in CNN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

vii
LIST OF FIGURES

1.1 Neuron architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


1.2 ANN architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Working of maxpooling layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.4 CNN architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.1 Sample images of plant diseases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12


3.2 Number of images in each class is shown in the histogram . . . . . . . . . . . . . . . . 13
3.3 The over all flow of plant disease identification . . . . . . . . . . . . . . . . . . . . . . 13
3.4 Working of Dense layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.5 The architecture of proposed DenseNet model . . . . . . . . . . . . . . . . . . . . . . . 15

4.1 Working of flatten layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18


4.2 The architecture of proposed CNN model . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3 Related parameters of proposed CNN model . . . . . . . . . . . . . . . . . . . . . . . . 20

6.1 values of last epoch in densenet model . . . . . . . . . . . . . . . . . . . . . . . . . . . 28


6.2 Top is accuracy and bottom is loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.3 Confusion matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.4 recall score, precision score, F1 score . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.5 prediction made by densenet model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
6.6 predictions made by densenet model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
6.7 predictions made by densenet model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
6.8 parameters at 25th epoch in CNN model . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.9 Top is accuracy and bottom is loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
6.10 values of accuracy and loss after each epoch . . . . . . . . . . . . . . . . . . . . . . . . 36
6.11 Comparison between different learning rates and epochs . . . . . . . . . . . . . . . . . 37
6.12 Comparison between two proposed models . . . . . . . . . . . . . . . . . . . . . . . . . 38

viii
LIST OF ABBREVIATIONS

AN N Artificial Neural Network


DCN N Deep Convolutional Neural Networks
SV M Support Vector Machine
ReLU Rectified Linear Unit
RGB Red Gren Blue
CP U Central Processing Unit
GP U Graphical Processing Unit
TPU Tensor Processing Unit
CU DA Compute Unified Device Architecture
AP I Application Programming Interface
HCI Human Computer Interaction
JSON Java Script Object Notation
SQL Structured Query Language
SGD Stochastic Gradient Descent
RM S Root Mean Square

ix
CHAPTER 1

INTRODUCTION

India is an agricultural country. Today, India ranks second worldwide in farm output. Now
days, a new concept of smart farming has been introduced where the field conditions are controlled
and monitored using the self operating systems. The self recognition of the disease is based on the
identification of the symptoms of disease. So that information about the disease occurrence could be
quickly and accurately provided to the farmers, experts and researchers. This in turn reduces the
monitoring of large field by human being. In disease recognition from image the key is to extract the
characteristic feature of the diseased region. According to the disease the features may vary. The
features that are extracted from the image are color,shape, texture etc.Sometimes for detection of the
disease more features are extracted and these extracted feature would increase the hardware as well
as software cost. This further causes increase in the complexity and the computation time. Hence
it is necessary to reduce the feature data. The occurrence of the disease on the plant may result in
significant loss in both quality as well as the quantity of agricultural product. This can produce the
negative impact on the countries whose economies are primarily dependent on the agriculture. Hence
the detection of the disease in the earlier stages is very important to avoid the loss in terms of quality,
quantity and finance. Usually the methods that are adopted for monitoring and management of plant
leaf disease are manual. One such major approach is naked eye observation. But the requirement
of this method is continuous monitoring of the field by a person having superior knowledge about
the plants and its corresponding diseases. Moreover, appointing such a person would may prove
costly. Another approach is seeking advice from the expert which may add the cost. Also, the expert
must be available in time otherwise it may results in loss. Diagnosis of disease on plant can also be
done in laboratory testing. But this method requires satisfactory laboratory conditions along with
professional knowledge. The pathogen detection methods can provide more accurate results. As the
tests are carried out of field the cost may be high and could be time consuming. In order to overcome
those short coming, this project work proposes the identification of disease in the plants by making
use of deep learning techniques.

1
1.1 DEEP LEARNING

The subset of the machine learning process is called deep learning. It will examine the
computer algorithms for the individual improvement. Deep learning is very powerful because it will
help to make harder things into a easy one. Also, deep learning is very easy. While dealing with
unstructured data, deep learning will become very powerful because it can able to process the large
number of features. It is an Artificial Intelligence(AI) function which helps to imitate the human brain
working. Deep learning method can build results offered by the machine learning. Deep learning will
have certain algorithms known as deep learning algorithms. This algorithms will be get trained to
create patterns. Also, it will check whether a pattern require a fraudulent investigation or not. It
is also known as Deep Neural Network. It is applicable to detect money laundering. For performing
various tasks, deep learning is used in many industries.

ARTIFICIAL NEURAL NETWORKS


The idea of ANNs is based on the belief that working of human brain by making the right connections,
can be imitated using silicon and wires as living neurons and dendrites. The human brain is composed
of 86 billion nerve cells called neurons. They are connected to other thousand cells by Axons. Stimuli
from external environment or inputs from sensory organs are accepted by dendrites. These inputs
create electric impulses, which quickly travel through the neural network. A neuron can then send
the message to other neuron to handle the issue or does not send it forward.
ANNs are composed of multiple nodes, which imitate biological neurons of human brain. The neurons
are connected by links and they interact with each other. The nodes can take input data and perform
simple operations on the data. The result of these operations is passed to other neurons. The output
at each node is called its activation or node value. Each link is associated with weight. ANNs are
capable of learning, which takes place by altering weight values.

2
Figure 1.1: Neuron architecture

3
Figure 1.2: ANN architecture

Overview of DCNN
Convolutional Neural Networks are very similar to ordinary Neural Networks from the previous chap-
ter; they are made up of neurons that have learnable weights and biases. Each neuron receives some
inputs, performs a dot product and optionally follows it with a non-linearity.
DCNNs are feed forward networks in that information flow takes place in one direction only, from
their inputs to their outputs. Just as artificial neural networks (ANN) are biologically inspired, so are
CNNs. The visual cortex in the brain, which consists of alternating layers of simple and complex cells
(Hubel Wiesel, 1959, 1962), motivates their architecture. CNN architectures come in several varia-
tions; however, in general, they consist of convolutional and pooling (or sub-sampling) layers, which
are grouped into modules. Either one or more fully connected layers, as in a standard feed forward
neural network, follow these modules. Modules are often stacked on top of each other to form a deep
model. It illustrates typical CNN architecture for a toy image classification task. An image is input
directly to the network, and this is followed by several stages of convolution and pooling. Thereafter,
representations from these operations feed one or more fully connected layers. Finally, the last fully
connected layer outputs the class label. Despite this being the most popular base architecture found
in the literature, several architecture changes have been proposed in recent years with the objective of
improving image classification accuracy or reducing computation costs. Although for the remainder
of this section, we merely fleetingly introduce standard CNN architecture.
There are five different layers in CNN. They are:
• Input Layer
• convo layer(convolution + activation)
• Pooling layer
• Fully connected layer
• Softmax/logistic layer
• Output layer

4
Input Layer
Input layer in CNN should contain image data. Image data is represented by three dimensional matrix
as we saw earlier. You need to reshape it into a single column. Suppose you have image of dimension
28 x 28 =784, you need to convert it into 784 x 1 before feeding into input. If you have “m” training
examples then dimension of input will be (784, m).
convo Layer
Convo layer is sometimes called feature extractor layer because features of the image are get extracted
within this layer. First of all, a part of image is connected to Convo layer to perform convolution
operation as we saw earlier and calculating the dot product between receptive field(it is a local region
of the input image that has the same size as that of filter) and the filter. Result of the operation is
single integer of the output volume. Then we slide the filter over the next receptive field of the same
input image by a Stride and do the same operation again. We will repeat the same process again and
again until we go through the whole image. The output will be the input for the next layer .Convo
layer also contains ReLU activation to make all negative value to zero.
Pooling Layer
The purpose of the pooling layers is to reduce the spatial resolution of the feature maps and thus
achieve spatial invariance to input distortions and translations. Initially, it was common practice to
use average pooling aggregation layers to propagate the average of all the input values, of a small
neighborhood of an image to the next layer. However, in more recent models, , max pooling aggrega-
tion layers propagate the maximum value within a receptive field to the next layer.

Figure 1.3: Working of maxpooling layer

Fully connected Layer


Fully connected layer involves weights, biases, and neurons. It connects neurons in one layer to neu-
rons in another layer. It is used to classify images between different category by training.

Softmax / Logistic Layer


Softmax or Logistic layer is the last layer of CNN. It resides at the end of FC layer. Logistic is used
for binary classification and softmax is for multi-classification.
Output Layer

5
Output layer contains the label which is in the form of one-hot encoded.
Training
CNNs and ANN in general use learning algorithms to adjust their free parameters in order to attain
the desired network output. The most common algorithm used for this purpose is backpropagation.
Backpropagation computes the gradient of an objective function to determine how to adjust a networks
parameters in order to minimize errors that affect performance. A commonly experienced problem
with training CNNs, and in particular DCNNs, is overfitting, which is poor performance on a held-out
test set after the network is trained on a small or even large training set. This affects the models
ability to generalize on unseen data and is a major challenge for DCNNs that can be assuaged by
regularization.

Figure 1.4: CNN architecture

1.2 MOTIVATION AND ORGANIZATION OF REPORT

The classification of plant disease is necessary in evaluating agricultural produce, increas-


ing market value and meeting quality standards. Identifying and taking further dealings for further
diffusion of the diseases it is also helpful.The process will be too slow, If the identification and cat-
egorization is done through physical techniques, we need the experts help sometimes it will be error
prone and who are less available. The labor’s classify based on color, size etc. if these quality methods
are recorded into automatic system by using appropriate program design language then the effort will
be error free and faster.There are two main characteristics of plant disease detection machine-learning
methods that must be achieved, they are: speed and accuracy. There is need for developing technique
such as automatic plant disease detection and classification using leaf image processing techniques.
This will prove useful technique for farmers and will alert them at the right time before spreading of
the disease over large area. This served as a motivation in carrying out this project.

6
The different chapters are organised s follows: Chapter 1 discusses about the introduction to plant
disease detection and basics of CNN. Chapter 2 gives a brief overview of the literature survey carried
out and the motivation for selecting the proposed techniques. Chapter 3 discusses about proposed
methodology and algorithm of DenseNet method. Chapter 4 deals about the methodology of pro-
posed CNN architecture. Chapter 5 discusses about software requirement to perform proposed model.
In Chapter 6, The results obtained during the project implementation is presented.Chapter 7 and 8
informs advantages and disadvantages of plant disease classification. Chapter 9 gives conclusion and
chapter 10 gives the scope for future improvements.

7
CHAPTER 2

LITERATURE SURVEY

A lot of research has been carried for past two decades to built an effective plant disease
classification system.But only a handful of research is reported in the literature where different kinds
of CNN techniques are used to classify different plant diseases like Alexnet,VGGnet,2-layer,5-layer
CNNs. In this chapter some of the techniques for plant disease classification are presented.

2.1 Using deep transfer learning for image based plant disease identification

Junde et al. proposed a plant diseasing approach based on VGGNet with inception mod-
ule. The proposed approach is composed of two parts: pretrained module for feature extraction and
auxiliary structure that utilizes multiscale feature maps for detection. Generally, the VGGNet comes
under CNN. The conventional VGGNet was enhanced by replacing its last two convolutional layers
with an additional convolutional layer and batch normalization is added on convolutional layer and
swish activation function is used. The convolutional layer is followed by two inception modules, which
are used to extract the multi-scale features of images input from the previous layer, and the fully
connected layers are replaced by a global pooling layer to conduct the dimension reduction of feature
maps. After that, a fully-connected SoftMax layer with a practical number of categories was added
as the top layer of the modified networks. The data set contains 500 rice images 466 maize images
with 1000 crop leaf images like rice stack burn, rice leaf scald, rice leaf smut, rice wheat tip and
bacterial leaf streak, phaeosphaeria spot, maize eyespot, gray leaf spot and Goss’s bacterial wilt etc.
The performance of proposed approach is indicated by accuracy, sensitivity, specificity. The accuracy
in rice disease estimation is reached up to 92 percent. It’s a heavier model and it takes more training
time inspite of having these limitations it can obtain high accuracy. [1]

8
2.2 Identification of rice diseases using deep convolutional neural networks

Yang et al. proposed a novel rice disease identification method based on deep convolutional
neural networks. The gradient descent is employed to train CNNs. The layers in the proposed model
are one input layer, one output layer, three convolutional layers and three stochastic pooling layers.
Softmax regression learning algorithm is applied in order to solve multiclassification problem. The
database created is of 500 natural images of diseased and healthy rice leaves and obtained output
to identify 10 different rice diseases. The recognition accuracy is always above 90. This model also
compared with BP, SVM, PSO and overcome all of them in terms of accuracy rate. Images can be
input directly to model. The proposed method has better training performance, faster convergence
rate as well as a better recognition ability. So many layers and so many neurons must be included
and this is an efficient algorithm but still it is depending on large scale datasets.[2]

2.3 Rice heading stage automatic observation by multi-classifier cascade based rice
spike detection method

Zhiguo et al. proposed a new method of automatic observation of the rice heading stage. A
support vector machine (SVM) with color features as input is employed to distinguish the spike image
patches from the background patches (non-spike). Then, a gradient histogram method is applied to
remove the yellow leaf patches from consideration. Finally, the CNN is utilized to further reduce the
false positive rate. Experiment results demonstrate that the proposed multi-classifier cascade method
can effectively distinguish rice spikes from background in images. In the multi-classifier cascade-based
spike detection method, the first classifier is the SVM with color information as input, as described.
In the learning stage of SVM, the rice spike blocks in size of 101 × 101 were manually cropped from
the original rice images. Afterwards, K-means clustering was applied to the segmentation of those
spike blocks. Commonly, the cluster number can be specified as five to classify spike pixels in each
block into separated classes. Next, 0.2 × 106 spike pixels (positives) and 0.2 × 106 background pixels
(negatives) were collected by us. And then, 0.5 × 105 positives and the same number of negatives
were selected randomly to compose the training samples. Meanwhile, test samples were collected by
the similar method. Training and test samples didn’t overlap. Afterwards, SVM classifier model was
built based on the description in. During the test phase, the recognition rate of the spike pixel by the
SVM classifier reached 93.2 percent.[3]

2.4 Factors influencing the use of deep learning for plant disease recognition

Ferentinos et al. proposed a model ‘convolution neural networks’ in deep learning to identify
the type of disease the plant is effected with through the image recognition. CNNs usually require
a very large number of samples to be trained the database used in this experiment is 50,000 images

9
of 171 diseases affecting 21 plant species. corn diseased were used in the context all of which are
caused by fungi. Thus, in order to increase the size of the database and to test how the CNN would
perform with more localized information, the original samples were divided into smaller images con-
taining individual lesions or localized symptom regions. Transfer learning was applied to a CNN using
different CNNs were trained, the first using the original unprocessed images, the second using whole
images with background manually removed, and the third using the subdivided images. In each case,
80 percent of the samples were used for training and 20 percent for validation. A fourth CNN was
trained with a reduced version of the training dataset containing subdivided images, so it would match
the size of the original training dataset. As a result, the size of the training set was increased 12-fold
and overfitting problems were reduced. The parameters used to train the network were Base Learning
Rate, 0.001; Momentum, 0.9; Mini Batch Size, 16 The final accuracies for each network were obtained
using a 10-fold cross-validation approach. The characteristics of the images that were misclassified by
the CNNs were carefully analyzed, and nine factors were identified as having the most impact on the
results.[4]

2.5 Leaf image based cucumber disease recognition using sparse representation clas-
sification

The algorithm used is K-means clustering algorithm and follows as collect data,convert each
colour image from RGB colour space to L*a*b* colour model, classify the colours in a*b* space using
K-means clustering,label each pixel in the image using the results from K-means clustering, select n
featured vectors from each class as a training set, solve the optimization problem, check whether the
termination condition is satisfied or not, compute the residuals from each category, perform SR based
classification using the decision rule, calculate the recognition precision for each category. The data
set explains that the cucumber leaf images were collected from the agricultural demonstration zone of
Northwest AF University. All leaves were picked by their students. The images were taken in smart
phones, digital cameras at same condition. They selected 60 fro 7 diseases. So, totally 420 leaf images.
Size was normalized to 128X128 and segmented to K-means clustering algorithm. The performance
metrics are energy = 95 percent, Minimum residual ratio = 0.127, average recognition rate = 85.7
percent, maximum recognition rate = 91.25 percent, tuning parameter = 0.01. The results obtained
are they proposed a novel crop disease recognition method based on cucumber leaves. The merits
are model is effective, model is feasible. The demerits are it didn’t explain how to construct the over
complete dictionary of SR effectively.[5]

2.6 Fast and accurate detection and classification of plant diseases

The Algorithm process is RGB image acquisition, Create the color transformation structure,
Convert the color values in RGB to the space specified in the color transformation structure, Apply

10
Kmeans clustering, Masking green-pixels, Remove the masked cells inside the boundaries of the in-
fected clusters, Convert the infected form RGB to HSI Translation, SGDM Matrix Generation for H
and S, Calling the GLCM function to calculate the features, Texture Statistics Computation, Config-
uring Neural Networks for Recognition. The data set is Cropped Plant Doc(C-PD).This data set will
be build by cropping the images.Cropped images contain only leaves.This images are of small–size
and low quality. The total number of leaf images after cropping 2,598 images turns out to be 9,216
i.e. 9,216 bounding boxes.The Performance Metrics are Cost effectiveness 346.49 dollors, Accuracy :
94.67,Recognition Rate : 99.66,Turnaround time : 438.09 seconds, Speedup : 19 percent.The Merits
are The approach is a valuable approach. It can support the accurate detection of leaf diseases. In-
crease the recognition rate. The demerits are The model will not be useful for all plant diseases. The
model will be tested on five plant diseases only (Early scorch, cottony mold, ashen mold, late scorch,
tiny whiteness).[6]

11
CHAPTER 3

IMPLEMENTATION USING DENSENET

In this chapter, the proposed methodology for image based plant disease detection using
DenseNet 121 is presented.

3.1 Data set

About 20,639 crop leaf images were provided by the dataset collected. The data set is
collected from Kaggle. The images were captured under non-uniform illumination intensities and
clutter field background conditions. All the crop images collected in this paper are as the disease
categories, also saved as the JPG format. Among them, the diseases include pepper bell bacterial
spot,potato early blight,potato late blight,tomato target spot,tomato mosaic virus,tomato yellow leaf
curl virus,tomato bacterial spot,tomato early blight,tomato late blight,tomato leaf mold,tomato sep-
toria leaf spot, tomato spider mites two spotted spider mite etc. For the subsequent calculations,
these images are uniformly processed into the RGB model by Photoshop tools firstly, and then the
sizes of images are adjusted to 256 × 256 pixels. Some of the sample images are displayed in the figure
3.1 [7].

Figure 3.1: Sample images of plant diseases

12
Figure 3.2: Number of images in each class is shown in the histogram

3.2 Overview

Figure 3.3: The over all flow of plant disease identification

A general overview of our method for plant disease identification is presented as shown in
fig 3.2. Firstly, the samples of plant disease images are collected and labeled based on the knowledge
of experts in the field. Then, the image-processing techniques including grey transformation, image
filtering, image sharpening and resizing, etc., are performed on the acquired images, and new sam-
ple images are generated to enrich the dataset using the data augmentation methods. For example,
random rotation, flipping, and translation are utilized to enlarge the dataset. After that, the sample
images are input to the proposed method (DenseNet model) for model training. Thus, the trained
model is applied for the class prediction of unseen images, and the results of plant disease identifica-
tion are obtained eventually. The detailed descriptions of these phases are illustrated in subsequent
sections.

13
3.3 Explanation of layers and parameters

Already the main layers are explained in the introduction part itself and now in this section,
some deep layers and parameters are presented:
Batch normalization layer
Batch normalization is proposed as a technique to help coordinate the update of multiple layers in the
model.Batch normalization provides an elegant way of reparametrizing almost any deep network. The
reparametrizing significanty reduces the problem of coordinating updates across many layers. It does
this scaling the output of the layer, specifically by standardizing the activations of each input variable
per mini-batch, such as the activations of a node from the previous layer. Recall that standardization
refers to rescaling data to have a mean of zero and a standard deviation of one, e.g. a standard
Gaussian. Batch Normalisation can have a dramatic effect on optimization performance, especially
for convolutional networks and networks with sigmoidal non linearities.
Dropout
A single model can be used to simulate having a large number of different network architectures by
randomly dropping out nodes during training. This is called dropout and offers a very computationally
cheap and remarkably effective regularization method to reduce overfitting and improve generaliza-
tion error in deep neural networks.Dropout is a regularization method that approximates training a
large number of neural networks with different architectures in parallel. Dropout has the effect of
making the training process noisy, forcing nodes within a layer to probabilistically take on more or
less responsibility for the inputs. It has the effect of reducing the capacity or thinning the network
during training. Dropout is not used after training when making a prediction with the fit network.
Dense layer
Dense layers can be reduced back to linear layers if we use a linear activation. Each non linear acti-
vation function can be decomposed to Taylor series thus producing a polynomial of a degree higher
than 1. By stacking several dense non-linear layers, we can create higher and higher order of polyno-
mials. Dense layers add an interesting non-linearity property, thus they can model any mathematical
function. However, they are still limited in the sense that for the same input vector we get always
the same output vector. They can’t detect repetition in time, or produce different answers on the
same input. The output shape of the Dense layer will be affected by the number of neuron / units
specified in the Dense layer. If the layer has multiple node, get the output data and output shape at
the specified index .

14
Figure 3.4: Working of Dense layer

Optimization
Optimization is that the method of finding the set of parameters W that minimize the loss perform.
To iterate, the loss perform lets United States of America quantify the standard of any specific set of
weights W. The goal of optimisation is to seek out W that minimizes the loss perform. we are going
to currently encourage ANd slowly develop an approach to optimizing the loss perform. For those of
you coming back to the current category with previous expertise, this section may appear odd since
the exactly what somebody is talking about we’ll use (the SVM loss) could be a gibbose downside,
however confine mind that our goal is to eventually optimize Neural Networks wherever we have a
tendency to can’t simply use any of the tools developed within the gibbose optimisation literature.
The activation function used everywhere in the architecture is common ReLU function to remove all
negated values.As the proposed model is DenseNet 121, total number of layers is 121. The over all
accuracy obtained through training is 98.88 percent.

Figure 3.5: The architecture of proposed DenseNet model

15
3.4 Internal working

The model used is DenseNet and the input should preprocess first i.e., resized to image size
of 64.Then the data augmentation should be done in order to increase the amount of training data by
making reasonable modifications in existing data.
The data augmentation parameters are shown as below:
datagen = ImageDataGenerator(
rotation-range = 360,
width-shift-range = 0.2,
height-shift-range = 0.2,
zoom-range = 0.2,
horizantol-flip = True,
vertical-flip = True)
The image features are extracted by convolution and spatial reduction is through global average pool-
ing. The dropout ratio is of 0.5. The content is normalised by batchnormalisation and optimiser is
Adam optimiser.

3.5 Algorithm

The algorithm of proposed densenet model is shown as follows:


Step 1: Collection of a dataset of images.
Step 2: Import all necessary packages.
Step 3: Randomize the order of training set and reset indices.
Step 4: Plot a histogram showing no. of images in each class.
Step 5: Display images for different species.
Step 6: Load the colour image as default flag and resize the image to target size.
Step 7: Normalize the data.
Step 8: Split the dataset into train and validation sets (80-20).
Step 9: Design the model (DenseNet 121).
Step 10: Generate batches of image data by data augmentation. Fit the model on batches with real-
time data augmentation.
Step 11: Count total number of parameters and train the network.
Step 12: plot the training and validation curves for accuracy and loss.
Step 13: Calculate the final loss and accuracy.
Step 14: Calculate several performance measures of model from confusion matrix like precision, recall,
F1 score etc.
Step 15: Predict the disease of leaf image loaded as input to the model.

16
CHAPTER 4

IMPLEMENTATION USING CNN

In this chapter, the proposed methodology for image based plant disease detection using
CNN architecture is presented.
The dataset used to train and test the model is same as densenet model called plant village dataset
[7].
The overall flow followed in this process also same as of densenet model.

4.1 Explanation of layers and parameters

Already the main layers are explained in the introduction part itself and now in this section,
some deep layers and parameters are presented:

Flatten layer
A flatten layer collapses the spatial dimensions of the input into the channel dimension. This layer
supports sequence input only. In between the convolutional layer and the fully connected layer ,there
is a Flatten Layer. Flattening transforms a two-dimensional matrix of features into a vector that can
be fed into a fully connected neural network. Flatten is the function that converts the pooled feature
map to a single column that is passed to the fully connected layer. Dense adds the fully connected
layer to the neural network . Flattening is converting the data into a 1-dimensional array for inputting
it to the next layer. We flatten the output of the convolutional layer to create a single long feature
vector. And it is connected to the final classification model, which is called a fully-connected layer.

17
Figure 4.1: Working of flatten layer

Kernel
It is a filter that is used to extract the features from the images. The kernel is a matrix that moves
over the input data, performs the dot product with the sub-region of input data, and gets the output
as the matrix of dot products.
Strides
It is the number of pixels shifts over the input matrix. For example, when the stride is 1 then we
move the filters to 1 pixel at a time.
Padding
It is the number of pixels added to an image when it is being processed by the kernel.
ReLU activation function
The corrected linear activation perform or ReLU for brief could be a piecewise linear perform that
may output the input directly if it’s positive, otherwise, it’ll output zero. it’s become the default
activation perform for several styles of neural networks as a result of a model that uses it’s easier to
coach and sometimes achieves higher performance.
ReLU perform is its spinoff each ar monotonic. The perform returns zero if it receives any negative
input,except for any positive worth x, it returns that worth back. therefore it provides AN output
that includesa vary from zero to eternity. ReLU is that the most ordinarily used activation perform
in neural networks, particularly in CNNs. Ifyou’re unsure what activation perform to use in your
network, ReLU is sometimes a decent 1st selection.
ReLU is linear (identity) for all positive values, and 0 for all negative values. this suggests that:
It’slow-cost to work out as there’s no sophisticated maths. The model will thus take less time to
coach or run. It converges quicker. one-dimensionality implies that the slope doesn’t upland, or “sat-
urate,” once x gets massive. It doesn’t have the vanishing gradient drawback suffered by alternative
activation functions like sigmoid or tanh. It’s sparsely activated. Since ReLU is zero for all negative in-

18
puts, it’s doubtless for any given unit to not activate in the least. typically this can be often fascinating.

The activation function used everywhere in the architecture is common ReLU function to
remove all negated values.The total number of layers in architecture are 28 namely, 5 convolution
layers,7 activation layers, 6 batch normalization layers, 3 pooling layers, 1 flatten layer, 2 dense layers
and 4 dropout layers. kernels used in this approach are 3X3 everywhere and strides are 1 by default
and for pooling 2.The over all accuracy obtained through training is 87.6 percent.

Figure 4.2: The architecture of proposed CNN model

19
Figure 4.3: Related parameters of proposed CNN model

20
4.2 Internal working

At first the image pre-processing is done including zooming,scaling etc. and finally the image
is resized to 256X256.
1. The reshaped image is provided as input to first convolution layer and it performs convolution with
input image and produces output.
2. The output is given to pooling layer and here the layer used is maxpooling layer.
3. Then output is given as input for corresponding convolution layer for further process and finally
the output from final pooling layer is given for dropout layer.
4. Dropout regularization is done upto 25 percent.
5. The data is flattened and given to dense layers using ReLu activation.
6. Now the final dropout of 50 percent is applied and given to softmax layer for classification.
7. The model is optimized by means of Adam optimization.

4.3 Algorithm

The algorithm of proposed model is shown as follows:


Step 1 : Collection of a data set of images.
Step 2 : Pre-processing of images.
Step3 : Import neccessary packages
Step 4 : Import list dir using os.
Step 5 : Import label binariser from sklearn preprocessing.
Step 6 : Import image data generator using keras.preprocessing.image.
Step 7 : Images are converted into arrays using functions.
Step 8 : Images are fetched from directory.
Step 9 : Get the size of processed images using imagesize.
Step 10 : Transform image labels using SciKit’s learn label binarizer.
Step 11 : Print the classes.
Step 12 : Split the data into train and test.
Step 13 : Observe the model summary.
Step 14 : Count the total number of parameters.
Step 15 : Train the network.
Step 16 : Plot the training and validation curves for accuracy and loss.
Step 17 : Calculate the model accuracy.
Step 18 : Predict the disease of the leaf image.

21
CHAPTER 5

SOFTWARE REQUIREMENT

This project is implemented using Google co-laboratory (colab.research.google.com) for Python


3 notebook. Here in this chapter some of the important features of the software requirement are pre-
sented.
• PYTHON
Python is an ocean of libraries that serve various purposes. Python has a huge collection of libraries.
Python is a beginner’s level programming language because of it simplicity and easiness. From devel-
oping to deploying and maintaining Python wants their developers to be more productive. Portability
is another reason for huge popularity of Python. The simplicity of Python has attracted many devel-
opers to create new libraries for machine learning. Because of the huge collection of libraries Python
is becoming hugely popular among machine learning experts.Python’s programming syntax is simple
to learn and is of high level when we compare it to C, Java, and C++.
• GOOGLE COLAB
Google colab is a product from google Research. Colab allows anybody to write and execute arbitrary
python code through the browser, and is especially well suited to machine learning, data analysis and
education. Google have released Colaboratory: a web IDE for python, to enable Machine Learning
with storage on the cloud — this internal tool had a pretty quiet public release in late 2017, and is
set to make a huge difference in the world of machine learning, artificial intelligence and data science
work. It’s an incredible online browser-based platform that allows us to train our models on machines
for free! Sounds too good to be true, but thanks to google , we can now work with large datasets,
build complex models, and even share our work seamlessly with others.
• HARDWARE INTERFACES
1. Processor : Intel CORE i5 processor with minimum 2.9 GHz speed.
2. RAM : Minimum 4 GB.
3. Hard Disk : Minimum 500 GB

22
5.1 LIBRARIES USED

In this section, some main libraries used are presented.


• TENSOR FLOW
TensorFlow could be a free and ASCII text file computer code library for machine learning. It may
be used across a spread of tasks however features a specific target coaching and logical thinking of
deep neural networks.Tensorflow could be a symbolic mathematics library supported dataflow and
differentiable programming. It is used for each analysis and production at Google.
TensorFlow was developed by the Google Brain team for internal Google use. it had been discharge-
dunder the Apache License .0 in 2015.TensorFlow is Google Brain’s second-generation sys- tem. Ver-
sion 1.0.0 was discharged on February 11, 2017. whereas the reference implementation runs on single
devices, TensorFlow can run on multiple CPUs and GPUs (with facultative CUDA and SYCL exten-
sions for general-purpose computing on graphics process units). TensorFlow is accessible on 64- bit
Linux, macOS, Windows, and mobile computing platforms as well as robot and iOS.
Its versatile design permits for the straightforward preparation of computation across a spread of
platforms (CPUs, GPUs, TPUs), and from desktops to clusters of servers to mobile and edge de-
vices.TensorFlow computations ar expressed as stateful dataflow graphs. The name TensorFlow de-
rives from the operations that such neural networks perform on three-dimensional information arrays,
that ar spoken as tensors. throughout the Google I/O Conference in Gregorian calendar month 2016,
Jeff Dean expressed that one,500 repositories on GitHub mentioned TensorFlow, of that solely five
were from Google.
In may 2016, Google declared its Tensor process unit (TPU), Associate in Nursing application- specific
integrated circuit (ASIC, a hardware chip) engineered specifically for machine learning and tailored
for TensorFlow. A TPU could be a programmable AI accelerator designed to produce high turnout of
low-precision arithmetic (e.g., 8-bit), and adjusted toward exploitation or running models instead of
training them. Google declared they’d been running TPUs within their information centers for more
than a year, Associate in Nursingd had found them to deliver an order of magnitude better- optimized
performance per watt for machine learning.
In may 2017, Google declared the second-generation, in addition because the accessibility of the TPUs
in Google cypher Engine. The second-generation TPUs deliver up to 180 teraflops of performance,
and once organized into clusters of 64 TPUs, offer up to 11.5 petaflops. In may 2018, Google declared
the third-generation TPUs delivering up to 420 teraflops of performance and 128 GB high informa-
tion measure memory (HBM). Cloud TPU v3 Pods supply 100+ petaflops of performance and 32 TB
HBM.In Gregorian calendar month 2018, Google declared that they were creating TPUs obtainable
in beta on the Google Cloud Platform. TensorFlow provides stable Python (for version 3.7 across
all platforms) and C APIs; and while not API backwards compatibility guarantee: C++, Go, Java,
JavaScript and Swift (early release).Third-party packages ar obtainable for C, Haskell, Julia, MAT-
LAB, R, Scala,Rust,OCaml,and Crystal. ”New language support ought to be engineered on high of
the C API. However, [..] not all practicality is available in C however.” Some additional practicality

23
is provided by the Python API.
• NUMPY
Numpy is an acronym of ’Numerical python’. Numpy is considered as one of the most popular ma-
chine learning library in Python. TensorFlow and other libraries uses Numpy internally for performing
multiple operations on Tensors. Array interface is the best and the most important feature of Numpy.
This interface can be utilized for expressing images, sound waves, and other binary raw streams as
an array of real numbers in N-dimensional.For implementing this library for machine learning having
knowledge of Numpy is important for full stack developers.
It will help you to manage multi-dimensional arrays very efficiently. Maybe you won’t do that directly,
but since the concept is a crucial part of data science, many other libraries are built on Numpy. It also
has a few well-implemented methods. without Numpy you won’t be able to use Pandas, Matplotlib,
Scipy or Scikit-Learn.
FEATURES
1. Interactive: Numpy is very interactive and easy to use.
2. Mathematics: Makes complex mathematical implementations very simple.
3. Intuitive: Makes coding real easy and grasping the concepts is easy.
4. Lot of Interaction: Widely used, hence a lot of open source contribution.
• OpenCV
OpenCV (Open Source Computer Vision Library) is an open source computer vision and machine
learning software library. OpenCV was built to provide a common infrastructure for computer vision
applications and to accelerate the use of machine perception in the commercial products. Being a
BSD-licensed product, OpenCV makes it easy for businesses to utilize and modify the code. The
library has more than 2500 optimized algorithms, which includes a comprehensive set of both clas-
sic and state-of-the-art computer vision and machine learning algorithms. These algorithms can be
used to detect and recognize faces, identify objects, classify human actions in videos, track camera
movements, track moving objects, extract 3D models of objects, produce 3D point clouds from stereo
cameras, stitch images together to produce a high resolution image of an entire scene, find similar
images from an image database, remove red eyes from images taken using flash, follow eye movements,
recognize scenery and establish markers to overlay it with augmented reality, etc. OpenCV has more
than 47 thousand people of user community and estimated number of downloads exceeding 14 million.
The library is used extensively in companies, research groups and by governmental bodies.
It has C++, Python, Java and MATLAB interfaces and supports Windows, Linux, Android and Mac
OS. OpenCV leans mostly towards real-time vision applications and takes advantage of MMX and
SSE instructions when available. A full-featured CUDAand OpenCL interfaces are being actively de-
veloped right now. There are over 500 algorithms and about 10 times as many functions that compose
or support those algorithms. OpenCV is written natively in C++ and has a templated interface that
works seamlessly with STL containers.
OpenCV’s application area include:

24
1. 2D and 3D feature toolkits
2. Egomotion estimation
3. Facial recognition system
4. Gesture recognition
5. Human–computer interaction (HCI)
6. Mobile robotics
7. Motion understanding
8. Object identification
9. Segmentation and recognition
10. Stereopsis stereo vision: depth perception from 2 cameras
11. Structure from motion (SFM)
12. Motion tracking
13. Augmented reality
To support some of the above areas, OpenCV includes a statistical machine learning library that
contains :
1. Boosting
2. Decision tree learning
3. Gradient boosting trees
4. Expectation-maximization algorithm
5. k-nearest neighbor algorithm
6. Naive Bayes classifier
7. Artificial neural networks
8. Random forest
9. Random forest
10. Support vector machine (SVM)
11. Deep neural networks (DNN)
• SK LEARN
It is a Python library is associated with NumPy and SciPy. It is considered as one of the best libraries
for working with complex data.There are a lot of changes being made in this library. One modification
is the cross-validation feature, providing the ability to use more than one metric. Lots of training
methods like logistics regression and nearest neighbors have received some little improvements. It
contains a numerous number of algorithms for implementing standard machine learning and data
mining tasks like reducing dimensionality, classification, regression, clustering, and model selection.
FEATURES
1. Cross-validation: There are various methods to check the accuracy of supervised models on unseen
data.
2. Unsupervised learning algorithms: Again there is a large spread of algorithms in the offering –
starting from clustering, factor analysis, principal component analysis to unsupervised neural net-

25
works.
3. Feature extraction: Useful for extracting features from images and text.
KERAS
Keras is considered as one of the coolest machine learning libraries in Python. It provides an easier
mechanism to express neural networks. Keras also provides some of the best utilities for compiling
models, processing data-sets, visualization of graphs, and much more. In the backend, Keras uses
either Theano or TensorFlow internally. Some of the most popular neural networks like CNTK can
also be used. Keras is comparatively slow when we compare it with other machine learning libraries.
Because it creates a computational graph by using back-end infrastructure and then makes use of it
to perform operations. All the models in Keras are portable.
It is especially popular among startups that place deep learning at the core of their products. Keras
contains numerous implementations of commonly used neural network building blocks such as layers,
objectives, activation functions, optimizers and a host of tools to make working with image and text
data easier.
FEATURES
• It runs smoothly on both CPU and GPU.
• Keras supports almost all the models of a neural network – fully connected, convolutional, pooling,
recurrent, embedding, etc. Furthermore, these models can be combined to build more complex mod-
els.
• Keras, being modular in nature, is incredibly expressive, flexible, and apt for innovative research.
• Keras is a completely Python-based framework, which makes it easy to debug and explore.
PANDAS
Pandas is Associate in Nursing ASCII text file Python Library providing superior infor- mation manip-
ulation and analysis tool victimisation its powerful information structures. The name Pandas springs
from the word Panel information – Associate in Nursing political economy from three- dimensional
information. In 2008, developer Wes McKinney started developing pandas once in would like of high
performance, versatile tool for analysis of information.Prior to Pandas, Python was ma- jorly used for
information munging and preparation. It had little contribution towards information analysis. Pandas
resolved this downside. victimisation Pandas, we can accomplish 5 typical steps within the process
and analysis of information, in spite of the origin of data — load, prepare, ma- nipulate, model, and
analyze. Python with Pandas is employed in an exceedingly wide selection of fields together with
educational and business domains together with finance, economics, Statistics, analytics, etc. Pandas
is especially used for information analysis. Pandas permits mercantilism in- formation from varied
file formats such as comma-separated values, JSON, SQL, Microsoft surpass. Pandas permits varied
information manipulation operations like merging, reshaping, selecting, yet as information cleansing,
and data haggle options.The following are the parameters of pandas.
The python alternative to MATLAB
Python in combination with Numpy, Scipy and Matplotlib can be used as a replacement for MATLAB.

26
The combination of NumPy, SciPy and Matplotlib is a free (meaning both ”free” as in ”free beer”
and ”free” as in ”freedom”) alternative to MATLAB. Even though MATLAB has a huge number of
additional toolboxes available, NumPy has the advantage that Python is a more modern and complete
programming language and - as we have said already before - is open source. SciPy adds even more
MATLAB-like functionalities to Python. Python is rounded out in the direction of MATLAB with
the module Matplotlib, which provides MATLAB-like plotting functionality.

27
CHAPTER 6

RESULTS AND DISCUSSIONS

The proposed model is implemented using Python 3 notebook, Keras-GPU library and
OpenCV-python3 library, etc. The deep CNN training and testing are accelerated by GPU, and the
experimental hardware environment includes: Intel® Core™ i5-8250 central processing unit (CPU) at
2.40 GHz with 8-GB memory and AMD Radeon 530 (GDDR 5.0 and 4 GB memory) graphics card,
which is used for the model training and testing.
In this chapter there are two sections in which the results of DenseNET model and a CNN model are
obtained during training and testing process are presented.

6.1 Results for DenseNet model

The training and validation parameters of densenet model of last epoch trained are shown
in figure 6.1. It obtained a training accuracy of 99.11% and validation accuracy of 97.38%. Those are
very efficient and they made the training process succesful by producing effective results.

Figure 6.1: values of last epoch in densenet model

The result of training and validation losses are shown in fig 6.2

28
Figure 6.2: Top is accuracy and bottom is loss

The model is perfectly trained by reaching 99% but the main draw back is training time. The model
is training for 23 to 24 hours and producing very effective results.

29
Fig 6.3 shows confusion matrix which gives the relationship between actual versus the pre-
dicted values. Some more performance measures are shown in table 6.4.

Figure 6.3: Confusion matrix

30
Figure 6.4: recall score, precision score, F1 score

For predicting the leaf image belongs to which type of disease in part of testing the model, The model
is loaded with image of pepper bell bacterial spot and the model has predicted it correctly as shown
in fig 6.6.

31
Figure 6.5: prediction made by densenet model

Some more predictions of model is shown in following figures:

Figure 6.6: predictions made by densenet model

32
Figure 6.7: predictions made by densenet model

Table 6.1: Estimation of parameters in DenseNet

Parameters Values

Total parameters 7,308,963

Trainable parameters 7,222,755

Non-trainable parameters 86,208

Testing Accuracy 97.38%

The list of finalized parameters are:


Epochs: 50
Learning rate: 1*e-3
Batch size: 64
Image size: 256 X 256
Optimization: Adam optimization

33
6.2 Results for CNN model

The training and validation parameters of proposed CNN model of last epoch are shown in
fig 6.9. It obtained an accuracy of 85.72% and validation accuracy of 87.53%.

Figure 6.8: parameters at 25th epoch in CNN model

The results can be analysed more efficiently by following graph 6.10.

34
Figure 6.9: Top is accuracy and bottom is loss

The training information of proposed CNN model is shown in fig 6.11.

35
Figure 6.10: values of accuracy and loss after each epoch

Table 6.2: Estimation of parameters in CNN

Parameters Values

Total parameters 58,102,671

Trainable parameters 58,099,791

Non-trainable parameters 2,880

Testing Accuracy 87.65 percent

36
First the learning rates are varied like e-2,e-3 and e-4. Then the epoch numbers are changed
from 10 to 25 with a difference of 5. Similarly the optimization functions are changed and the best
parameters are taken to train our model.The comparison charts are as follows:

Figure 6.11: Comparison between different learning rates and epochs

The accuracy values for different parameters are as follows:


• For learning rate e-2: Training accuracy:76.42, Testing accuracy:47.72
• For learning rate e-4: Training accuracy:87.46, Testing accuracy:46.36
• For learning rate e-3,
10 epochs: Training accuracy:79.34, Testing accuracy:64.13
15 epochs: Training accuracy:84.62, Testing accuracy:78.00
20 epochs: Training accuracy:84.71, Testing accuracy:77.83
For optimization functions:
Adam optimization: Training accuracy:85.72, Testing accuracy:87.65
SGD optimization: Training accuracy:46.13, Testing accuracy:44.84
RMS prop optimization: Training accuracy:89.82, Testing accuracy:52.62

37
Therefore the list of finalized parameters are:
Epochs: 25
Learning rate: 1e-3
Batch size: 32
Image size: 256 X 256
Optimization: Adam optimization

6.3 Comparison between two proposed models

In this section, The comparison between two proposed models is presented in the form of
graph.

Figure 6.12: Comparison between two proposed models

38
CHAPTER 7

CONCLUSION

Plant diseases are the main harms to the agricultural development of the world, and they
have a disastrous impact on the safety of food production. In severe cases, plant diseases may lead
to no harvest completely. Therefore, the automatic identification of plant diseases is highly desired
in agricultural information. Deep learning techniques, particularly DenseNet and CNNs, have shown
promising performance in addressing most of the challenging problems associated with the classifica-
tion. In this paper,we used a different kinds of CNN architectures and the activation function used is
ReLU in order to perform negation and softmax layer was added as the top layer for the classification.
The former is employed as a basic feature extractor while the latter extracts the high-dimensional
features and is responsible for classification. Proper training up to 50 epochs helped in achieving
better results.

39
CHAPTER 8

FUTURE SCOPE

This algorithm was tested on a paticular dataset which is used for training. By increasing the
number of features and the number of inputs to the neural network the algorithm can be enhanced.
If this technique is developed into a sophisticated interface in the form of a Website or Android
Application it may prove to be great asset to the agricultural sector. In the future this methodology
can be integrated with other yet to be developed methods for disease identification and classification.
The use of other algorithms can be explored to enhance the efficiency of the system in future.

40
REFERENCES

1. Junde, C., Jinxiu, C., Zhang, D., Sun, Y., 2020. Using deep transfer learning for image based
plant disease identification. Computers and electronics in Agriculture 173-105393.
2. Lu, Y., Yi, S., Zeng, N., Liu, Y., Zhang, Y., 2017. Identification of rice diseases using deep
convolutional neural networks. Neurocomputing 267, 378–384.
3. Bai, X., Cao, Z., Zhao, L., Zhang, J., Lv, C., Li, C., Xie, J., 2018. Rice heading stage
automatic observation by multi-classifier cascade based rice spike detection method. Agricul.
Forest Meteorol. 259, 260–270.
4. Barbedo, J.G., 2018. Factors influencing the use of deep learning for plant disease recognition.
Biosyst. Eng. 172, 84–91.
5. Zhang, S., Wu, X., You, Z., Zhang, L., 2017. Leaf image based cucumber disease recognition
using sparse representation classification. Comput. Electron. Agricul. 134.
6. Al- Hiary, H., Bani-Ahmad, S., Reyalat, M., Braik, M., Alrahamneh, Z., 2011. Fast and
accurate detection and classification of plant diseases. Int. J. Comput. Appl. 17 (1), 31–38.
7. Dataset : https://www.kaggle.com/emmarex/plantdisease

41

You might also like