0% found this document useful (0 votes)
7 views

Final Report1

The document discusses the use of machine learning, specifically convolutional neural networks (CNN), for predicting crop diseases to enhance agricultural productivity and sustainability. It highlights the economic impact of plant diseases and the limitations of current manual detection methods, proposing an automated system for early disease detection. The objectives include exploring various detection techniques and implementing a robotized system for monitoring plant health in real field conditions.

Uploaded by

shyamthakare202
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Final Report1

The document discusses the use of machine learning, specifically convolutional neural networks (CNN), for predicting crop diseases to enhance agricultural productivity and sustainability. It highlights the economic impact of plant diseases and the limitations of current manual detection methods, proposing an automated system for early disease detection. The objectives include exploring various detection techniques and implementing a robotized system for monitoring plant health in real field conditions.

Uploaded by

shyamthakare202
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 39

Crop Disease Prediction by using Machine Learning

ABSTRACT
To promote sustainable growth, the Indian cities has a global vision that connects artificial
intelligence, big data, decision-making, information and communication technology, and the
Internet of Things. These processes are related to solving real-life issues. Food is one of the very
basic requirements of human beings. The world population is increasing every day. So, it has
become necessary to grow sufficient amounts of crops to feed such a huge population. But with
time passing by, plants are affected by various kinds of diseases, which cause great harm to
agricultural plant production. Besides that, many country's economies greatly depend on
agricultural productivity and it’s also a need for a country to attain agricultural productivity of
basic agricultural products for the people of that particular country. Detection of plant disease
through some automatic technique is beneficial as it requires a large amount of work of
monitoring in big farms of crops.

Keywords: Feature, CNN, Layer, Filter, Prediction, Pooling, Convolution, RELU.

Dr. Rajendra Gode institute of technology and research, Amravati 1


Crop Disease Prediction by using Machine Learning

CHAPTER 1
INTRODUCTION

1.1Background:
The agriculture industry is one of the most vital sectors for contribution to the national income in
many countries. Throughout the years, lot of agriculture components and processes have become
robotic to ensure faster production and to ensure products are of highest quality standards.
Because of the high demand in the agricultural industry, it is essential that agriculture produce is
cultivated using an systematic process. Diseases and defects found in plants and crops have a
large impact on production in the agriculture industry, and lead to remarkable economic losses.
A loss of an estimated 33 billion dollars every year was the consequence of plant pathogens
found in crops in the United States. Pathogenic species affect plants significantly, initiating
diseases such as chestnut blight fungus and huanglongbing citrus disease.

Insect infestation along with bacterial, fungal, and viral infections are other important
contribution to diseases exists in plants. Changes in climate and temperature are also a few
component that may contribute to the accelerate in diseases found in plants. Once a plant has
been infected, symptoms develop on separate segments of the plant, basically degrading the
growth of the subsequent fruit or vegetable. Apple production is a very large industry remarkably
in China with over 17 million tons of produce every year. Apple infections do not only of course
reduce grade and yield, but can also affect the return bloom of the resulting season. These factors
have radical impact on countries that rely heavily on its agriculture sector as its main program of
income. To overcome these losses and issues of plant diseases, farmers tend to see to chemical
pesticides as a remedy solution. This solution may be powerful in eliminating plant diseases but
has harsh drawbacks. As well as being costly, the largest use of pesticides creates dangerous
levels of toxic residue levels on agriculture products. This leads to burden about wholesomeness
and healthiness of products raised by the public when pesticides are commonly used in the
produce they purchase. This controlled or supervised method of pesticide use is called as
selective pesticide spraying. 2 For the aim to decrease losses existed in defective plants many
techniques have been introduced. Manual techniques, such as hand inspection and naked eye

Dr. Rajendra Gode institute of technology and research, Amravati 2


Crop Disease Prediction by using Machine Learning

observation are somewhat general methods used by farmers. Plant diseases are predicted and
characterized by observation from experts, which can be highly expensive and time consuming
too. As these methods are very tedious it is prone to sorting problems and judgmental errors from
various farmers. Therefore, disease prediction systems were introduced that tackle large number
of the issues faced with labor-intensive techniques

1.2 Problem Statement


Bacterial and fungal viral infections have a serious impact on plant health and introduce diseases
that affect the growth of produce. In addition, the over-reliance on fungicides and pesticides to
remedy this issue is not only costly but has a considerably negative impact on the environment.
So, there is a need to predict and target plant diseases at an early stage to aid farmers in taking
appropriate precautions to help preserve the defective plant. The purpose of proposed system is
to discuss and compare the plant disease detection techniques that feature visible imaging.

1.3 Existing System


 If we want to find what kind of disease is there on the crop then farmers need to take those
leaf samples to the nearby agriculture research center.
 To detect proper disease in crop or plant research centers will take some days or weeks or
sometimes months.
 Once a disease is found farmer will be informed about it and then the farmer needs to find the
proper solution to overcome that disease from plant leaf.
 This process takes a lot of time and human effort and it involves human errors.

1.4 Proposed Approach: -


Our proposed system involves training of leaf images dataset and detection of disease from given
image. To train leaf images dataset we will use convolutional neural network. It is a special type
of neural network widely used to extract unique features from no of images by applying its
various layers.

Dr. Rajendra Gode institute of technology and research, Amravati 3


Crop Disease Prediction by using Machine Learning

1.5 Objectives
5.1 To study and explore the different tools used for plant disease detection techniques
5.2 Categorize and compare the included research into plant disease detection methods.
5.3 Introduce an automated technique for early plant disease detection and monitoring.
5.4 To modify the existing solution more efficiently to solve this problem is more genuine
way
5.5 The expected outcomes of the project include:

1. The implementation of an automatic plant disease severity level system.

2. The design and implementation of an automated robotized system for plant health
monitoring in real field conditions.

Dr. Rajendra Gode institute of technology and research, Amravati 4


Crop Disease Prediction by using Machine Learning

CHAPTER 2
LITERATURE REVIEW

Literature Review
Minu Eliz Pothen et al proposed a method which describes different techniques utilized for rice
leaf disease classification purpose. Bacterial leaf blight, Leaf smut and Brown spot diseased
images are divided using Otsu's method. Here from the segmented area, various features they
separated utilizing “Local Binary Patterns (LBP)” and “Histogram of Oriented Gradients
(HOG)”.Then the features they classified with the assistance of Support Vector Machine (SVM)
and accomplished 94.6% with polynomial Kernel SVM and HOG [1].

The work in [2] presented a study on different image processing and machine learning
techniques used for detection of plant diseases using leaf images. First Color transformation
structure is created, and then device independent color space transformation is applied on that
color transformation structure. Pre-processing methods such as clipping, image smoothing,
image enhancement, and histogram equalization are presented. Segmentation techniques such as
boundary detection and spot detection, K-means clustering, and Otsu’s thresholding are also
briefly described. Key features such as Color, texture, morphology, and edges are also discussed.
Classification based on ANN with the working principle is discussed.

Wenjiang Huang et al developed the new spectral indices for detecting the winter wheat disease.
They consider three different pests (Powdery mildew, yellow rust and aphids) in winter wheat
for their study purpose. The most and the least nearest wavelengths for different diseases were
extracted by using RELIEF-F algorithm. The results of these identified indices for healthy and
infected leaves with powdery mildew, yellow rust and aphids were 86.5%, 85.2%, 91.6% and
93.5% respectively [3].

The work in [4] presented plant disease detection with samples of two plants namely grape and
wheat. Total 185 images including 85 grape leaves and 100 wheat leaves were considered.

Dr. Rajendra Gode institute of technology and research, Amravati 5


Crop Disease Prediction by using Machine Learning

Without changing the image resolution, the images are compressed using nearest neighbor
interpolation method. The median filter is applied here to de-noise the images. K-means
clustering is used for segmentation. For image segmentation, RGB image is converted into CIE
XYZ Color space. After that XYZ color space is converted into l*a*b color space. Color, shape,
and texture features are extracted. Principal component analysis (PCA) is used to reduce the
dimensions of the feature data extracted from images. Due to this reduction in dimensions, the
number of neurons can be reduced so that speed of Backpropagation neural network can
increase.

[5] First important thing in this paper wasvautomatic detection of disease at very early stage to
protect the production of the crop. It has mainly three objectives; first one is to eliminate both the
infected part and the non infected part from each other in the image. Secondly, to tell about the
differentiation between the diseases like leaf rust Cercospora leaf spot and powdery mildew.
Thirdly, to identify diseases before its symptoms started appearing or are getting visible with
naked eye

Dr. Rajendra Gode institute of technology and research, Amravati 6


Crop Disease Prediction by using Machine Learning

CHAPTER 3
ALGORITHM & DISCUSSION

3.1 Convolutional Neural Network


To teach algorithms how to identify objects in images, we generally use a specific type of
Artificial Neural Network which is nothing but a Convolutional Neural Network (CNN). It is a
special type of Neural Network widely used for identifying the image.

The 2D convolution is a fairly simple operation, starting with a kernel, which is simply a small
matrix of weights. This kernel “slides” on the given 2D input values, performing an element-by-
element multiplication with the chunk of the input value it is currently on, and then finally
computing the outcome into a single output pixel. The kernel repeats this process again and again
for every location it slides over, converting a 2D matrix of features into another 2D matrix of
features. The output features are primarily, the weighted sums (with the weights being the values
of the kernel itself) of the input features located brutally in the same location of the output pixel
on the input layer. Whether or not an input feature falls within this roughly same location, gets
determined directly by whether it’s in the area of the kernel that produced the output or not. It
means the size of the kernel directly identifies how many input features get combined in the
production of a new output feature.

CNN have following components


 The Hidden layers/Feature extraction part in this part, the network will perform a series
of convolutions with RELU and pooling operations during which the features are
detected.
 To reduce the computational complexity, a pooling layer or sub sample layer is usually
used immediately after a convolutional layer.
 The Rectified Linear Unit is the most regularly used activation function in AI models.
The function returns 0 if it gets any negative value, but for any positive value it returns
that value x return back.
So it can be written as

Dr. Rajendra Gode institute of technology and research, Amravati 7


Crop Disease Prediction by using Machine Learning

 The Classification part The Fully Connected Layers will serve as a classifier on top of
these extracted features. They will allocate a probability for the object on the image being
what the algorithm forecasts it is.

Fig.3.1.1. Convolutional layer

Fig. 3.1.2 Convolution step1

Dr. Rajendra Gode institute of technology and research, Amravati 8


Crop Disease Prediction by using Machine Learning

Fig. 3.1.3 Convolution step2

Fig. 3.1.4 Convolution step3

Dr. Rajendra Gode institute of technology and research, Amravati 9


Crop Disease Prediction by using Machine Learning

Fig. 3.1.5 Convolution step4

Fig. 3.1.6 Convolution step9

Dr. Rajendra Gode institute of technology and research, Amravati 10


Crop Disease Prediction by using Machine Learning

3.2 CONVOLUTIONAL NEURAL NETWORK

3.2.1 Problem Space:

Image classification is the task of taking an input image and outputting a class (a cat, dog, etc) or
a probability of classes that best describes the image. For humans, this task of recognition is one
of the first skills we learn from the moment we are born and is one that comes naturally and
effortlessly as adults. Without even thinking twice, we’re able to quickly and seamlessly identify
the environment we are in as well as the objects that surround us. When we see an image or just
when we look at the world around us, most of the time we are able to immediately characterize
the scene and give each object a label, all without even consciously noticing. These skills of
being able to quickly recognize patterns, generalize from prior knowledge, and adapt to different
image environments are ones that we do not share with our fellow machines.

Human Vision Computer Vision

3.2.2 Inputs and Outputs of CNN:

When a computer sees an image (takes an image as input), it will see an array of pixel
values. Depending on the resolution and size of the image, it will see a 32 x 32 x 3 array of
numbers (The 3 refers to RGB values). Just to drive home the point, let's say we have a color
image in JPG form and its size is 480 x 480. The representative array will be 480 x 480 x 3. Each
of these numbers is given a value from 0 to 255 which describe the pixel intensity at that point.
These numbers, while meaning less when we perform image classification, are the only inputs

Dr. Rajendra Gode institute of technology and research, Amravati 11


Crop Disease Prediction by using Machine Learning

available to the computer. The idea is that you give the computer this array of numbers and it
will output numbers that describe the probability of the image being a certain class (.80 for
cat, .15 for dog, .05 for bird, etc).

3.2.3 What We Want the Computer to Do:

Now that we know the problem as well as the inputs and outputs, let’s think about
how to approach this. What we want the computer to do is to be able to differentiate between all
the images it’s given and figure out the unique features that make a dog a dog or that make a cat
a cat. This is the process that goes on in our minds subconsciously as well. When we look at a
picture of a dog, we can classify it as such if the picture has identifiable features such as paws or
4 legs. In a similar way, the computer is able perform image classification by looking for low
level features such as edges and curves, and then building up to more abstract concepts through a
series of convolutional layers. This is a general overview of what a CNN does. Let’s get into the
specifics.

3.2.4 Biological Connection:

But first, a little background. When you first heard of the term convolutional neural
networks, you may have thought of something related to neuroscience or biology, and you would
be right. Sort of CNNs do take a biological inspiration from the visual cortex. The visual cortex
has small regions of cells that are sensitive to specific regions of the visual field. This idea was
expanded upon by a fascinating experiment by Hubel and Wiesel in 1962 , where they showed
that some individual neuronal cells in the brain responded (or fired) only in the presence of edges
of a certain orientation. For example, some neurons fired when exposed to vertical edges and
some when shown horizontal or diagonal edges. Hubel and Wiesel found out that all of these
neurons were organized in a columnar architecture and that together, they were able to produce
visual perception. This idea of specialized components inside of a system having specific tasks
(the neuronal cells in the visual cortex looking for specific characteristics) is one that machines
use as well, and is the basis behind CNNs.

3.2.5 Structure:

Dr. Rajendra Gode institute of technology and research, Amravati 12


Crop Disease Prediction by using Machine Learning

Back to the specifics. A more detailed overview of what CNNs do would be


that you take the image, pass it through a series of convolutional, nonlinear, pooling
(downsampling), and fully connected layers, and get an output. As we said earlier, the
output can be a single class or a probability of classes that best describes the image.
Now, the hard part understands what each of these layers do.

3.2.6 First Layer – Math Part

The first layer in a CNN is always a Convolutional Layer. First thing to make sure
you remember is what the input to this conv layer is. Like we mentioned before, the input is a 32
x 32 x 3 array of pixel values. Now, the best way to explain a Conv layer is to imagine a
flashlight that is shining over the top left of the image. Let’s say that the light this flashlight
shines covers a 5 x 5 area. And now, let’s imagine this flashlight sliding across all the areas of
the input image. In machine learning terms, this flashlight is called a filter(or sometimes referred
to as a neuron or a kernel) and the region that it is shining over is called the receptive field.
Now this filter is also an array of numbers (the numbers are called weights or parameters).
A very important note is that the depth of this filter has to be the same as the depth of the input
(this makes sure that the math works out), so the dimensions of this filter are 5 x 5 x 3. Now,
let’s take the first position the filter is in for example. It would be the top left corner. As the
filter is sliding, or convolving, around the input image, it is multiplying the values in the filter
with the original pixel values of the. These multiplications are all summed up. So now you have
a single number. Remember, this number is just representative of when the filter is at the top left
of the image. Now, we repeat this process for every location on the input volume. (Next step
would be moving the filter to the right by 1 unit, then right again by 1, and so on). Every unique
location on the input volume produces a number. After sliding the filter over all the locations,
you will find out that what you’re left with is a 28 x 28 x 1 array of numbers, which we call
an activation map or feature map. The reason you get a 28 x 28 array is that there are 784
different locations that a 5 x 5 filter can fit on a 32 x 32 input image. These 784 numbers are
mapped to a 28 x 28 array.

Dr. Rajendra Gode institute of technology and research, Amravati 13


Crop Disease Prediction by using Machine Learning

Let’s say now we use two 5 x 5 x 3 filters instead of one. Then our output volume would be 28 x
28 x 2. By using more filters, we are able to preserve the spatial dimensions better.
Mathematically, this is what’s going on in a convolutional layer.

3.2.7 First Layer – High Level Perspective

However, let’s talk about what this convolution is actually doing from a high level.
Each of these filters can be thought of as feature identifiers. When we say features, these are
like straight edges, simple colors, and curves. Think about the simplest characteristics that all
images have in common with each other. Let’s say our first filter is 7 x 7 x 3 and is going to be a
curve detector. (In this section, let’s ignore the fact that the filter is 3 units deep and only
consider the top depth slice of the filter and the image, for simplicity.) As a curve detector, the
filter will have a pixel structure in which there will be higher numerical values along the area
that is a shape of a curve (Remember, these filters that we’re talking about as just numbers!).

Dr. Rajendra Gode institute of technology and research, Amravati 14


Crop Disease Prediction by using Machine Learning

Pixel representation of filter visualisation of curve detector filter

Now, let’s go back to visualizing this mathematically. When we have this filter at the top left
corner of the input volume, it is computing multiplications between the filter and pixel values at
that region. Now let’s take an example of an image that we want to classify, and let’s put our
filter at the top left corner.

Original image visualization of the filter on the image

Dr. Rajendra Gode institute of technology and research, Amravati 15


Crop Disease Prediction by using Machine Learning

We have to do is multiply the values in the filter with the original pixel values of the
image.

Basically, in the input image, if there is a shape that generally resembles the curve that this filter
is representing, then all of the multiplications summed together will result in a large value! Now
let’s see what happens when we move our filter.

Visualization of filter on image

The value is much lower! This is because there wasn’t anything in the image section that
responded to the curve detector filter. Remember, the output of this conv layer is an activation
map. So, in the simple case of a one filter convolution (and if that filter is a curve detector), the
activation map will show the areas in which there at mostly likely to be curves in the picture. In

Dr. Rajendra Gode institute of technology and research, Amravati 16


Crop Disease Prediction by using Machine Learning

this example, the top left value of our 26 x 26 x 1 activation map (26 because of the 7x7 filter
instead of 5x5) will be 6600. This high value means that it is likely that there is some sort of
curve in the input volume that caused the filter to activate. The top right value in our activation
map will be 0 because there wasn’t anything in the input volume that caused the filter to activate
(or more simply said, there wasn’t a curve in that region of the original image). Remember, this
is just for one filter. This is just a filter that is going to detect lines that curve outward and to the
right. We can have other filters for lines that curve to the left or for straight edges. The more
filters, the greater the depth of the activation map, and the more information we have about the
input volume. The filter described in this section was simplistic for the main purpose of
describing the math that goes on during a convolution. In the picture below, you’ll see some
examples of actual visualizations of the filters of the first Conv layer of a trained network.
Nonetheless, the main argument remains the same. The filters on the first layer convolve around
the input image and “activate” (or compute high values) when the specific feature it is looking
for is in the input volume.

Visualization of filters

3.2.8 Deeper Network

Now in traditional convolutional neural network architecture, there are other layers
that are interspersed between these Conv layers. In a general sense, they provide nonlinearities
and preservation of dimension that help to improve the robustness of the network and control
over fitting. A classic CNN architecture would look like this.

Dr. Rajendra Gode institute of technology and research, Amravati 17


Crop Disease Prediction by using Machine Learning

What the filters in the first Conv layer are designed to detect? They detect low level features
such as edges and curves. As one would imagine, in order predicting whether an image is a type
of object, we need the network to be able to recognize higher level features such as hands or
paws or ears. So let’s think about what the output of the network is after the first Conv layer. It
would be a 28 x 28 x 3 volume (assuming we use three 5 x 5 x 3 filters). When we go through
another Conv layer, the output of the first Conv layer becomes the input of the 2 nd Conv layer.
Now, this is a little bit harder to visualize. When we were talking about the first layer, the input
was just the original image. However, when we’re talking about the 2 nd Conv layer, the input is
the activation map(s) that result from the first layer. So each layer of the input is basically
describing the locations in the original image for where certain low level features appear. Now
when you apply a set of filters on top of that (pass it through the 2 nd Conv layer), the output will
be activations that represent higher level features. Types of these features could be semicircles
(combination of a curve and straight edge) or squares (combination of several straight edges). As
we go through the network and go through more Conv layers, you get activation maps that
represent more and more complex features. By the end of the network, we may have some filters
that activate when there is handwriting in the image, filters that activate when they see pink
objects, etc. Another interesting thing is that as we go deeper into the network, the filters begin to
have a larger and larger receptive field, which means that they are able to consider information
from a larger area of the original input volume (another way of putting it is that they are more
responsive to a larger region of pixel space).

3.2.9 Convolutional Layer


The 2D convolution is a fairly simple operation, starting with a kernel, which is simply a small
matrix of weights. This kernel “slides” over the 2D input data, performing an element-wise
multiplication with the part of the input it is currently on, and then summing up the results into a
single output pixel. The kernel repeats this process for every location it slides over, converting a
2D matrix of features into yet another 2D matrix of features. The output features are essentially,
the weighted sums (with the weights being the values of the kernel itself) of the input features
located roughly in the same location of the output pixel on the input layer. Whether or not an

Dr. Rajendra Gode institute of technology and research, Amravati 18


Crop Disease Prediction by using Machine Learning

input feature falls within this roughly same location, gets determined directly by whether it’s in
the area of the kernel that produced the output or not. This means the size of the kernel directly
determines how many (or few) input features get combined in the production of a new output
feature.

Fig.3.2.9 Convolutional layer

3.2.10 RELU Layer

The Rectified Linear Unit is the most commonly used activation function in deep learning
models. The function returns 0 if it receives any negative input, but for any positive value it
returns that value x back. After each Convolutional layer, it is convention to apply a nonlinear
layer (or activation layer) immediately afterward. The purpose of this layer is to introduce
nonlinearity to a system that basically has just been computing linear operations during the
Convolutional layers (just element wise multiplications and summations).In the past, nonlinear
functions like tanh and sigmoid were used, but researchers found out that RELU layers work far
better because the network is able to train a lot faster (because of the computational efficiency)
without making a significant difference to the accuracy. It also helps to alleviate the vanishing
gradient problem, which is the issue where the lower layers of the network train very slowly
because the gradient decreases exponentially through the layers. The RELU layer applies the

Dr. Rajendra Gode institute of technology and research, Amravati 19


Crop Disease Prediction by using Machine Learning

function f(x) = max(0, x) to all of the values in the input volume. In basic terms, this layer just
changes all the negative activations to 0.This layer increases the nonlinear properties of the
model and the overall network without affecting the receptive fields of the Conv layer.

Fig 3.2.10 Pictorial Representation of RELU Layer

3.2.11 Pooling Layer

To reduce the computational complexity, a pooling layer or sub sample layer is usually used
immediately after a convolutional layer. After some RELU layers, programmers may choose to
apply a pooling layer. It is also referred to as a down sampling layer. In this category, there are
also several layer options, with max pooling being the most popular. This basically takes a filter
(normally of size 2x2) and a stride of the same length. It then applies it to the input volume and
outputs the maximum number in every sub region that the filter convolves around.

Fig. 3.2.11 Pooling Layer

Dr. Rajendra Gode institute of technology and research, Amravati 20


Crop Disease Prediction by using Machine Learning

Other options for pooling layers are average pooling and L2-norm pooling. The intuitive
reasoning behind this layer is that once we know that a specific feature is in the original input
volume (there will be a high activation value), its exact location is not as important as its relative
location to the other features. As you can imagine, this layer drastically reduces the spatial
dimension (the length and the width change but not the depth) of the input volume. This serves
two main purposes. The first is that the amount of parameters or weights is reduced by 75%, thus
lessening the computation cost. The second is that it will control overfitting. This term refers to
when a model is so tuned to the training examples that it is not able to generalize well for the
validation and test sets.

3.2.12 Fully Connected Layer

Now that we can detect these high level features, the icing on the cake is attaching a fully
connected layer to the end of the network. This layer basically takes an input volume (whatever
the output is of the Conv or RELU or pool layer preceding it) and outputs an N dimensional
vector where N is the number of classes that the program has to choose from. For example, if
you wanted a digit classification program, N would be 10 since there are 10 digits. Each number
in this N dimensional vector represents the probability of a certain class. For example, if the
resulting vector for a digit classification program is [0 .1 .1 .75 0 0 0 0 0 .05], then this represents
a 10% probability that the image is a 1, a 10% probability that the image is a 2, a 75%
probability that the image is a 3, and a 5% probability that the image is a 9 (Side note: There are
other ways that you can represent the output). The way this fully connected layer works is that it
looks at the output of the previous layer (which as we remember should represent the activation
maps of high level features) and determines which features most correlate to a particular class.
For example, if the program is predicting that some image is a dog, it will have high values in the
activation maps that represent high level features like a paw or 4 legs, etc. Similarly, if the
program is predicting that some image is a bird, it will have high values in the activation maps
that represent high level features like wings or a beak, etc. Basically, a FC layer looks at what
high level features most strongly correlate to a particular class and has particular weights so that
when you compute the products between the weights and the previous layer, you get the correct
probabilities for the different classes.

Dr. Rajendra Gode institute of technology and research, Amravati 21


Crop Disease Prediction by using Machine Learning

Fig:3.2.12 Fully Connected Layer

3.2.13 Training
Now, this is the one aspect of neural networks that I purposely haven’t mentioned yet and it is
probably the most important part. Before we get into back propagation, we must first take a step
back and talk about what a neural network needs in order to work. At the moment we all were
born, our minds were fresh. We didn’t know what a cat or dog or bird was. In a similar sort of
way, before the CNN starts, the weights or filter values are randomized. The filters don’t know
to look for edges and curves. The filters in the higher layers don’t know to look for paws and
beaks. As we grew older however, our parents and teachers showed us different pictures and
images and gave us a corresponding label. This idea of being given an image and a label is the
training process that CNNs go through. Before getting too into it, let’s just say that we have a
training set that has thousands of images of dogs, cats, and birds and each of the images has a
label of what animal that picture is. Back to backpropogation.

So back propagation can be separated into 4 distinct sections, the forward pass, the loss function,
the backward pass, and the weight update. During the forward pass, you take a training image
which as we remember is a 32 x 32 x 3 array of numbers and pass it through the whole network.
On our first training example, since all of the weights or filter values were randomly initialized,
the output will probably be something like [.1 .1 .1 .1 .1 .1 .1 .1 .1 .1], basically an output that
doesn’t give preference to any number in particular. The network, with its current weights, isn’t
able to look for those low level features or thus isn’t able to make any reasonable conclusion
about what the classification might be. This goes to the loss function part of back propagations.
Remember that what we are using right now is training data. This data has both an image and a

Dr. Rajendra Gode institute of technology and research, Amravati 22


Crop Disease Prediction by using Machine Learning

label. Let’s say for example that the first training image inputted was a 3. The label for the image
would be [0 0 0 1 0 0 0 0 0 0]. A loss function can be defined in many different ways but a
common one is MSE (mean squared error), which is ½ times (actual - predicted) squared.

Let’s say the variable L is equal to that value. As you can imagine, the loss will be extremely
high for the first couple of training images. Now, let’s just think about this intuitively. We want
to get to a point where the predicted label (output of the ConvNet) is the same as the training
label (This means that our network got its prediction right).In order to get there, we want to
minimize the amount of loss we have. Visualizing this as just an optimization problem in
calculus, we want to find out which inputs (weights in our case) most directly contributed to the
loss (or error) of the network.

The process of forward pass, loss function, backward pass, and parameter update is one training
iteration. The program will repeat this process for a fixed number of iterations for each set of

Dr. Rajendra Gode institute of technology and research, Amravati 23


Crop Disease Prediction by using Machine Learning

training images (commonly called a batch). Once you finish the parameter update on the last
training example, hopefully the network should be trained well enough so that the weights of the
layers are tuned correctly.

Fig. 3.2.13 Architecture of CNN with all layers

Dr. Rajendra Gode institute of technology and research, Amravati 24


Crop Disease Prediction by using Machine Learning

CHAPTER 4
SYSTEM DESIGN & EXECUTION PROCESS

Fig4.1: System Architecture Diagram

Fig 4.2: DFD0

Dr. Rajendra Gode institute of technology and research, Amravati 25


Crop Disease Prediction by using Machine Learning

Fig 4.3: DFD1

Fig4.4: Data Flow Diagram

Dr. Rajendra Gode institute of technology and research, Amravati 26


Crop Disease Prediction by using Machine Learning

Query Image: It is the infected plant leaf image


Model File: We will train dataset means we will apply CNN on dataset images and

SYSTEM WORKING SCENARIO

Step-1: The user will need to first install our application

Step 2: The user will sign up for the proposed application by providing basic details like name,
location, contact number, username, password, etc…

Step 3: Now User will log in to the app by providing the correct username and password

Step-4: To start feature extraction user will submit a query image(infected plant leaf image) to
the proposed application, The user simply needs to browse the query image from his/her device
and submit it to the app

Step-5: The proposed system will read the query image it will extract query image features and
then it will match extracted query image features with trained dataset features. Based on features
matching it will predict the label(disease) and that will be displayed.

Step-6: Now the user will get the solution for that predicted disease like which spray he should
take or fertilizer he should use which will stop the infection of the predicted disease on his crop.

CHAPTER 5

Dr. Rajendra Gode institute of technology and research, Amravati 27


Crop Disease Prediction by using Machine Learning

REQUIREMENT SPECIFICATIONS & DISEASES

5.1 Software/Hardware Requirements: -

LANGUAGE: PYTHON
IDE: IDLE / PYCHARM
OS: WINDOWS 7/8/10/11
DATABASE: SQLITE

Minimum RAM:-512 MB upto Maximum RAM:-8 GB


Minimum Hard Disk:-10 GB upto Maximum Hard Disk:-80 GB
Processor:-Intel Pentium 4 upto Maximum Processor:- Core i7
Minimum GPU:- 1 GB upto Maximum GPU 8 GB
Keyboard: - Standard
Monitor: - 15/17 inch (color)

5.2 Crop Diseases

5.2.1 Tomato Early blight

Early blight is a common tomato disease caused by the fungus Alternaria solani. It can affect
almost all parts of the tomato plants, including the leaves, stems, and fruits. The plants may not

Dr. Rajendra Gode institute of technology and research, Amravati 28


Crop Disease Prediction by using Machine Learning

die, but they will be weakened and will set fewer tomatoes than normal. Early blight generally
attacks older plants, but it can also occur on seedlings.

5.2.2 Tomato Bacterial spot

Bacterial spot causes leaf and fruit spots, which leads to defoliation, sun-scalded fruit, and yield
loss. Due to diversity within the bacterial spot pathogens, the disease can occur at different
temperatures and is a threat to tomato production worldwide.

5.2.3 Tomato Late blight

Late blight is a potentially devastating disease of tomato and potato, infecting leaves, stems and
fruits of tomato plants. The disease spreads quickly in fields and can result in total crop failure if
untreated.

5.2.4 Tomato Target Spot

Dr. Rajendra Gode institute of technology and research, Amravati 29


Crop Disease Prediction by using Machine Learning

Target spot is often a problem on tomatoes. The disease is caused by the fungus
Corynespora cassiicola. Target spot is frequently misdiagnosed as in its early stages as
symptoms are difficult to recognize and can be confused with bacterial spot and early blight.

Dr. Rajendra Gode institute of technology and research, Amravati 30


Crop Disease Prediction by using Machine Learning

CHAPTER 6
CONCLUSION & FUTURE SCOPE

6.1 Conclusion
Our proposed concept focuses on crop Disease Prediction by using a convolutional neural
network. The main issue is to identify particular crop diseases just by looking at crop leaves
manually which is not possible. But by using CNN it will work very great.
In recent years there have been important changes in machine learning techniques. Searching
more features and extracting them from query images is a very complicated term but because of
CNN it becomes a little bit easier and so we are using CNN for more accurate results.
Convolutional neural network is an important breakthrough technique, which includes a family
of machine learning algorithms.

6.2 Future Scope

We have created the proposed application by taking near about 6000 image datasets for training
the AI model. In this dataset, we have taken 4 diseases and healthy image categories. This
means a total of 9 categories have been taken for classification. As we have taken only 4 diseases
the model we have trained can only predict the disease that belongs to any of these 4 categories.
But suppose in the future if anyone wants to classify a disease other than our dataset then one
should train the model by adding that particular disease into the provided dataset folder. To get
more accuracy one can increase the dataset size in the future.

Proposed System Screenshots

Dr. Rajendra Gode institute of technology and research, Amravati 31


Crop Disease Prediction by using Machine Learning

Fig: Home Page

Fig: Signup Page

Dr. Rajendra Gode institute of technology and research, Amravati 32


Crop Disease Prediction by using Machine Learning

Fig: Login Page

Fig: User Dashboard Page

Dr. Rajendra Gode institute of technology and research, Amravati 33


Crop Disease Prediction by using Machine Learning

Fig: About Us Page

Fig: Farming Guide Page

Dr. Rajendra Gode institute of technology and research, Amravati 34


Crop Disease Prediction by using Machine Learning

Fig.: Temperature Requirement Info

Fig.: Land Soil Requirement for Tomato Cultivation Info

Dr. Rajendra Gode institute of technology and research, Amravati 35


Crop Disease Prediction by using Machine Learning

Fig.: Seed Choice Info

Fig.: Tomato seed trnasplantation Info

Dr. Rajendra Gode institute of technology and research, Amravati 36


Crop Disease Prediction by using Machine Learning

Fig.: Nursery Preparation Info

Fig.: Fertilizers Requirement Info

Dr. Rajendra Gode institute of technology and research, Amravati 37


Crop Disease Prediction by using Machine Learning

Fig.: Manuring Tomato cultivation Process Info

Dr. Rajendra Gode institute of technology and research, Amravati 38


Crop Disease Prediction by using Machine Learning

REFERENCES
[1] Minu Eliz Pothen, Dr.Maya L Pai, “Detection of Rice Leaf Diseases Using Image Processing”,
Fourth International Conference on Computing Methodologies and Communication (ICCMC) IEEE
– 2020

[2] S.D.Khirade and A.B.Patil , 2015, February. Plant Disease Detection Using Image Processing. In
International Conference on Computing Communication Control and Automation (ICCUBEA), 2015 (pp.
768- 771). IEEE.

[3] Wenjiang Huang, Qingsong Guan, Juhua Luo, Jingcheng Zhang, Jinling Zhao, Dong Liang,
Linsheng Huang, and Dongyan Zhang, “New Optimized Spectral Indices for Identifying and
Monitoring Winter Wheat Diseases”, IEEE journal of selected topics in applied earth observation and
remote sensing,Vol. 7, No. 6, June 2014

[4] H. Wang, G. Li, Z. Ma, and X. Li. "Image recognition of plant diseases based on backpropagation
networks." In 5th International Congress on, Image and Signal Processing (CISP), 2012pp. 894-900.
IEEE, 2012.

[5] H. Al-Hiary, S. Bani-Ahmad, M. Reyalat, M. Braik and Z. ALRahamneh, “Fast and Accurate
Detection and Classification of Plant Diseases”, IJCA, 2011, 17(1), 31- 38, IEEE-2010.

[6] Taohidul Islam , Manish Sah , Sudipto Baral , Rudra RoyChoudhury ,“A faster technique on rice
disease Detection using image processing of Affected area in agro-field”, 978-1-5386-1974-
2/18/$31.00 ©2018 IEEE

[7] Varsha P. Gaikwad , Dr. Vijaya Musande , “Wheat Disease Detection Using Image Processing”,
978-1-5090-4264-7/17/$31.00 ©2017 IEEE

[8] Jagadeesh D. Pujari, Rajesh Yakkundimath, Abdulmunaf S.Byadgi, “Identification and


classification of fungal disease affected on agriculture/horticulture crops using image processing
techniques”, 978-1-4799-3975-6/14/$31.00 ©2014 IEEE

[9] Monika Jhuria, Ashwani Kum, Rushikesh Borse, “Image Processing for smart farming: detection
of disease and fruit grading”, 978-1-4673-6101-9/13/$31.00 ©2013 IEEE

[10] Ashwini C, Anusha B, Divyashree B R, Impana V, Nisarga S P, “Plant Disease Detection using
Image Processing”, ISSN: 2278-0181 NCCDS – ©2020 IJERT

[11] Simranjeet Kaur, Geetanjali Babbar, Navneet Sandhu, Dr. Gagan Jindal , “Various plant diseases
detection using image processing methods”, ISSN: 2455-2631 © June 2019 IJSDR

Dr. Rajendra Gode institute of technology and research, Amravati 39

You might also like