75% found this document useful (4 votes)
8K views

Dayananda Sagar University: "Plant Disease Detection Using ML"

This document describes a major project that aims to develop a machine learning model for plant disease detection. The objectives are to equip farmers with an easy-to-use tool for identifying plant diseases from images in order to help improve crop yields. The methodology involves collecting a dataset of images of healthy and diseased plant leaves, using convolutional neural networks to build a classification model, and creating a graphical user interface for farmers to input images and receive disease predictions. The project implements the model and tests it on sample data, achieving reasonably high accuracy for detecting common plant diseases.

Uploaded by

dashan 720
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
75% found this document useful (4 votes)
8K views

Dayananda Sagar University: "Plant Disease Detection Using ML"

This document describes a major project that aims to develop a machine learning model for plant disease detection. The objectives are to equip farmers with an easy-to-use tool for identifying plant diseases from images in order to help improve crop yields. The methodology involves collecting a dataset of images of healthy and diseased plant leaves, using convolutional neural networks to build a classification model, and creating a graphical user interface for farmers to input images and receive disease predictions. The project implements the model and tests it on sample data, achieving reasonably high accuracy for detecting common plant diseases.

Uploaded by

dashan 720
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

DAYANANDA SAGAR UNIVERSITY

DEPARTMENT OF COMPUTER SCIENCE & ENGI NEERING


SCHOOL OF ENGINEERING
DAYANANDA SAGAR UNIVERSITY
KUDLU GATE
BANGALORE – 560068

MAJOR PROJECT REPORT


ON
“PLANT DISEASE DETECTION USING ML”

SUBMITTED TO THE 8TH SEMESTER


MAJOR PROJECT (16CS481)
COURSE

BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE & ENGINEERING

Submitted by

B G RAHUL KARRTHIK-(ENG17CS0044)
B M MADHURYA-( ENG17CS0046)
BHAVYA M-( ENG17CS0052)
DARSHAN A-(ENG17CS0060)

Under the guidance of


Professor Lavanya B Koppal
DAYANANDA SAGAR UNIVERSITY
School of Engineering, Kudlu Gate, Bangalore-560068

CERTIFICATE

This is to certify that B.G. RAHUL KARRTHIK, B M MADHURYA, BHAVYA


M and DARSHAN A bearing USN ENG17CS0044, ENG17CS0046, ENG17CS0052
and ENG17CS0060 has satisfactorily completed his/her Major Project as prescribed
by the University for the 8th Semester B.Tech. programme in Computer Science &
Engineering for Major Project (16CS481) course during the year 2020-21 at the School
of Engineering, Dayananda Sagar University., Bangalore.

Date:

Signature of the Faculty in Charge

Max Marks Marks Obtained

Signature of the Chairman


Department of Computer Science & Engineering

i
ACKNOWLEDGEMENT
From the very core of our heart, we would like to express our sincere gratitude to Professor
Lavanya B Koppal for her invaluable guidance, support, motivation and patience during the
course of this major project work. We are always indebted to her for his kind support and
constant encouragement.
We extend our sincere thanks to our Chairman Dr. Sanjay Chitnis who continuously helped
throughout the project and without his guidance, this project would have been an uphill task.
It requires lots of efforts in terms of cooperation and support to fulfil various tasks involved
during the project. We are always grateful to our peers and friends who have always
encouraged us and guided us whenever we needed assistance.

B G RAHUL KARRTHIK (ENG17CS0044)

B M MADHURYA (ENG17CS0046)

BHAVYA M (ENG17CS0052)

DARSHAN A (ENG17CS0060)

ii
ABSTRACT
Agriculture is one field which has a high impact on life and economic status of human beings.
Improper management leads to loss in quality of agricultural products. Farmers lack the
knowledge of diseases and hence affecting their crops causing less production. Kisan call
centers are available but do not offer service 24*7 and sometimes communication is bound to
fail. When the farmers are unable to explain disease properly on call, there arises a need to
analysis the image of affected area of disease. Though, images and videos of crops provide
better view and agro-scientists can provide a better solution to resolve the issues related to
healthy crop, the farmers are not yet aware of this. It is to be noted that if the productivity of
the crop is not healthy, it poses a high risk to providing good and healthy nutrition. Due to the
improvement and development in technology where devices are smart enough to recognize and
detect plant diseases. Recognizing illness can prompt faster treatment in order to lessen the
negative impacts on harvest.

iii
TABLE OF CONTENTS

CERTIFICATE ........................................................................................................................................ i
ACKNOWLEDGEMENT ...................................................................................................................... ii
ABSTRACT ........................................................................................................................................... iii
TABLE OF CONTENTS ....................................................................................................................... iv
CHAPTER 1 ........................................................................................................................................... 1
1.1. Introduction .................................................................................................................................. 1
1.2. Objective ...................................................................................................................................... 1
1.3. Problem Statement ....................................................................................................................... 1
CHAPTER 2 ........................................................................................................................................... 2
2. Literature Survey ............................................................................................................................ 2
CHAPTER 3 ........................................................................................................................................... 4
3.2. Methodology ................................................................................................................................ 4
CHAPTER 4 ........................................................................................................................................... 8
4. Implementation ............................................................................................................................... 8
4.1. Requirement Analysis .............................................................................................................. 8
4.1.1. Functional Requirement..................................................................................................... 8
4.1.2. Hardware Requirement ...................................................................................................... 8
4.1.3. Software Requirement ....................................................................................................... 8
4.2. Code Snippets ........................................................................................................................... 8
4.3. Test Cases ............................................................................................................................... 10
CHAPTER 5 ......................................................................................................................................... 11
5.1. Results ........................................................................................................................................ 11
5.2. Conclusion ................................................................................................................................. 15
5.2. Future work ................................................................................................................................ 15
References ............................................................................................................................................. 16

iv
PLANT DISEASE DETECTION USING ML

CHAPTER 1
1.1. Introduction
Agriculture is an important part of our country as about 70% of the population depends on the
farming for their living. Due to loss in the production, many farmers attempt suicides which is
a serious issue. This issue can be controlled to some extent by using new technologies that will
help farmers to improve the harvesting [1].
Plants have become an important source of energy, and play an important role in tackling many
environmental issues such as global warming. There are several diseases that affect plants with
the potential to cause devastating economic, social and ecological losses.
There are several ways to detect plant diseases. Some diseases cannot be detected with naked
eyes, or those appear only when it is too late to act upon them. Traditional methods to identify
and detect plant diseases are tiresome and time-consuming [2]. A common approach in this
case is the use of remote sensing techniques that explore multi and hyper spectral image
captures. The methods that adopt this approach often employ digital image processing tools to
achieve their goals. Image processing technology in the agricultural research has made
significant development.
Deep learning techniques, and in particular Convolutional Neural Networks (CNNs), have led
to significant progress in image processing. Since 2016, many applications for the automatic
identification of crop diseases have been developed. These applications could serve as a basis
for the development of expertise assistance or automatic screening tools. Such tools could
contribute to more sustainable agricultural practices and greater food production security.

1.2. Objective
Detection of plant leaves diseases and pests needs experiences and experts. So, we like to equip
the young generation of inexperienced farmers with a tkinter application that can help them in
their farms to detect the diseases in their plants and provide them with appropriate remedies
according to the disease detected.

1.3. Problem Statement


Create a tkinter application that makes use of CNN to build a model by making use of the
images of the plant leaf, so as to detect the disease and suggest the appropriate remedies to
counteract the disease.
If the leaf is found unhealthy i.e., diseased, our project tells what type of disease that the leaf
is infected with. Our main objective is to classify whether the leaf is having Bacterial spot, Late
Blight, Yellow Curl Leaf virus using machine learning algorithm like Logistic Regression.

1
PLANT DISEASE DETECTION USING ML

CHAPTER 2
2. Literature Survey
1. Smart Farming: Pomegranate Disease Detection Using Image Processing, 2015
A web-based tool has been developed to identify fruit diseases by uploading fruit image to the
system. Feature extraction has been done using parameters such as colour, morphology and
CCV (colour coherence vector). Clustering has been done using the k-means algorithm. SVM
is used for classification as infected or non-infected. This work achieved an accuracy of 82%
to identify pomegranate disease. [3]

2. Leaf Disease Detection and Recommendation of Pesticides using Convolution Neural


Network, 2018
Crop production problems are common in India which severely effect rural farmers, agriculture
sector and the country’s economy as a whole. In Crops leaf plays an important role as it gives
information about the quantity and quality of agriculture yield in advance depending upon the
condition of leaf. In this paper we proposed the system which works on pre-processing, feature
extraction of leaf images from plant village dataset followed by convolution neural network
for classification of disease and recommending Pesticides using Tensor flow technology. The
main two processes that we use in our system is android application with Java Web Services
and Deep Learning. We have use Convolution Neural Network with different layers five, four
& three to train our model and android application as a user interface with JWS for interaction
between these systems. Our results show that the highest accuracy achieved for 5-layer model
with 95.05% for 15 epochs and highest validation accuracy achieved is for 5- layer model with
89.67% for 20 epochs using tensor flow. [4]

3. An Artificial Intelligence and Cloud Based Collaborative Platform for Plant Disease
Identification, Tracking and Forecasting for Farmers, 2018
This paper presents an automated, low cost and easy to use end-to-end solution to one of the
biggest challenges in the agricultural domain for farmers – precise, instant and early diagnosis
of crop diseases and knowledge of disease outbreaks - which would be helpful in quick decision
making for measures to be adopted for disease control. This proposal innovates on known prior
art with the application of deep Convolutional Neural Networks (CNNs) for disease
classification, introduction of social collaborative platform for progressively improved
accuracy, usage of geocoded images for disease density maps and expert interface for analytics.
High performing deep CNN model “Inception” enables real time classification of diseases in
the Cloud platform via a user facing mobile app. [5]

4. CNN based Leaf Disease Identification and Remedy Recommendation System, 2019
This paper focus upon plant disease detection using image processing approach. This work
utilizes an open dataset of 5000 pictures of unhealthy and solid plants, where convolution
system and semi supervised techniques are used to characterize crop species and detect the

2
PLANT DISEASE DETECTION USING ML

sickness status of 4 distinct classes. Convolution neural network is used to detect and classify
plant diseases. The Network is trained using the images taken in the natural environment and
achieved 99.32% classification ability. This shows the ability of CNN to extract important
features in the natural environment which is required for plant disease classification. [6]

5. Plant Leaf Diseases Detection and Classification Using Image Processing and Deep
Learning Techniques, 2020
This paper presents a system that is used to classify and detect plant leaf diseases using deep
learning techniques. The used images were obtained from (Plant Village dataset) website. In
our work, we have taken specific types of plants; include tomatoes, pepper, and potatoes, as
they are the most common types of plants in the world and in Iraq in particular. This Data Set
contains 20636 images of plants and their diseases. In our proposed system, we used the
convolutional neural network (CNN), through which plant leaf diseases are classified, 15
classes were classified, including 12 classes for diseases of different plants that were detected,
such as bacteria, fungi, etc., and 3 classes for healthy leaves. As a result, we obtained excellent
accuracy in training and testing, we have got an accuracy of (98.29%) for training, and
(98.029%) for testing for all data set that were used.[7]

3
PLANT DISEASE DETECTION USING ML

CHAPTER 3
3.2. Methodology
The main aim is to design a system which is efficient and which provide disease name and
pesticides name as fast as possible. For that purpose, we use two phases: 1st is training phase
and 2nd is testing phase. In 1st phase: Image acquisition, Image Pre-processing and CNN based
training. In 2nd phase Image acquisition, Image Pre-processing, Classification and disease
identification and suggest appropriate remedies.

Leaf Disease Detection and


Remedies Recommendation

Fig 3.1: Block Diagram

A. Image Acquisition:
For training, image is taken from a file on the system. For the purpose of testing the images of
the plant leaves are captured as and when required and then transferred to a folder on the system
for analysis.

4
PLANT DISEASE DETECTION USING ML

B. Image Pre-Processing:
Image should be processed before sending to the algorithm for testing and training purpose.
For that purpose, in this project image is scaled or resize into 50 x 50 dimension. As we used
colour image so that we don’t need any colour conversion techniques and that pre-processed
image is directly passed to algorithm for training and testing purpose.

C. Convolutional Neural Network:


Once pre-processing is done, then CNN is used for training purpose and after that we get a
trained model. That CNN method is written with help of tensor flow. By using this model, we
classify the image that the system is getting after pre-processing of testing image. Then we get
particular disease name or status of healthy leaf if there is no disease on that leaf. With the help
of that disease name, we get the remedies which will help the farmer to take action so as to
eradicate or decrease the effect of disease.

Fig 3.2: CNN architecture

1. Input Layer
The input layer contains the input images and their pixel values.

2. Convolution Layer
The main building blocks of CNN is the Convolutional layer. It is the simple use of filters of
several sizes into the input image that results in activation. The repeated use of such input
image with the same filter results in the map in the activation called feature map. This
indicates the strength of the detected features in the input image. Every feature map has
convoluted with the help of numerous input feature graph in Convolutional neural networks.

3. Pooling Layer
A pooling layer often follows a convolutional layer and can be utilized to depreciate the
dimensions of feature maps and parameters of the network. Pooling layers are also invariant in
interpretation, alike to convolutional layers because their calculations take into account
neighbouring pixels. The most widely used approaches are average pooling and max pooling.
In our research, we used a max-pooling layer.

4. Non-Linear Layer
A non-linear transformation is applied to the input by the CNN, the object of which is to classify
the features within per hidden layer. In CNN structure we use Rectified linear units (ReLU).
Rectified linear units are commonly used as nonlinear transformation. This kind of layer

5
PLANT DISEASE DETECTION USING ML

executes a simple operation with a threshold where any input value smaller than zero is set to
zero.

5. Fully Connected Layer


The data arrives at the last layer of the CNN, which is the fully connected node, later much
iteration of the prior layers. In the two neighbouring layers, the neurons are connected directly
to the neurons within the fully connected network as shown in Fig. 3.2.

6. Normalize Layer
In our proposed system we use a batch normalize layer. Batch normalization layer form
normalizes any channel through a mini-batch. This can help to decrease sensitivity to data
variations.

7. Softmax Layer
The network's performance can be difficult to interpret. It is normal to finish the CNN with a
Softmax function in classification issues. After extracting values of 15 classes of plant diseases
in the fully connected step, a Softmax will be made for them, so that the class will be selected
in each process and according to the features that were extracted through the previous layers
that the images of plant diseases went through it. In this layer, the correct class of disease is
determined by applying the Softmax function.

D. Training
Training a network is a procedure of obtaining kernels in convolution layers and weights in
fully connected layers that reduce differences on a training dataset between output predictions
and specified ground truth labels. In our work, we used 87% of the data for training, through
this stage so that the network that has been built learns by extracting features from plant leaf
disease images in order to learn from these features for each image to be distinguished on its
basis

E. Testing
The testing is a dataset utilized to provide an impartial final design fit evaluation on the training
set of data. In this stage, we use the groups that were trained in the previous step that was
trained in CNN, and the features were extracted by learning the network when the data set
passes from plant leaf diseases on this network, we used 13% of the data for testing.

F. Detection for Plant Leaf Diseases and Remedies Prediction


After the previous operations, plant species diseases are detected and classified according to
three types of plant diseases, namely bacterial spots, late blight and yellow curl leaf virus. After
detection and classification is done, the prediction of the remedies is done by the application.

6
PLANT DISEASE DETECTION USING ML

Workflow

Start

Input image

CNN
process

Disease name and


Remedies Prediction

End

Fig 5.2: Flow diagram

7
PLANT DISEASE DETECTION USING ML

CHAPTER 4
4. Implementation

4.1. Requirement Analysis


4.1.1. Functional Requirement

• The system should provide an easy and efficient GUI to use.


• The system should be able to provide clear picture about the status of the leaf.
• If the leaf is found unhealthy i.e., diseased, the system should tell what type of
disease that the leaf is infected with.
• The system should also provide the remedies for the disease on which the plant
is infected.

4.1.2. Hardware Requirement

• Smart Phone
• Laptop or desktop with:
o Intel i5 or equivalent
o 4GB RAM or more.

4.1.3. Software Requirement

• IDE: Jupyter Notebook


• Language: Python
• CNN

4.2. Code Snippets


Pre-Processing:

training_data = []

for img in os.listdir(TRAIN_DIR):

label = label_img(img)

path = os.path.join(TRAIN_DIR,img)

img = cv2.imread(path,cv2.IMREAD_COLOR)

img = cv2.resize(img, (IMG_SIZE,IMG_SIZE))

training_data.append([np.array(img),np.array(label)])

shuffle(training_data)

8
PLANT DISEASE DETECTION USING ML

Building CNN Layers:

convnet = input_data(shape=[None, IMG_SIZE, IMG_SIZE, 3],


name='input')

convnet = conv_2d(convnet, 32, 3, activation='relu')

convnet = max_pool_2d(convnet, 3)

convnet = conv_2d(convnet, 64, 3, activation='relu')

convnet = max_pool_2d(convnet, 3)

convnet = conv_2d(convnet, 128, 3, activation='relu')

convnet = max_pool_2d(convnet, 3)

convnet = conv_2d(convnet, 32, 3, activation='relu')

convnet = max_pool_2d(convnet, 3)

convnet = conv_2d(convnet, 64, 3, activation='relu')

convnet = max_pool_2d(convnet, 3)

convnet = fully_connected(convnet, 1024, activation='relu')

convnet = dropout(convnet, 0.8)

convnet = fully_connected(convnet, 4, activation='softmax')

convnet = regression(convnet, optimizer='adam',


learning_rate=LR, loss='categorical_crossentropy',
name='targets')

model = tflearn.DNN(convnet, tensorboard_dir='log')

Training the model:


train = train_data[:-500]

test = train_data[-500:]

X = np.array([i[0] for i in train]).reshape(-


1,IMG_SIZE,IMG_SIZE,3)

Y = [i[1] for i in train]

test_x = np.array([i[0] for i in test]).reshape(-


1,IMG_SIZE,IMG_SIZE,3)

9
PLANT DISEASE DETECTION USING ML

test_y = [i[1] for i in test]

model.fit({'input': X}, {'targets': Y}, n_epoch=8,


validation_set=({'input': test_x}, {'targets': test_y}),
snapshot_step=40, show_metric=True, run_id=MODEL_NAME)

model.save(MODEL_NAME)

4.3. Test Cases

Test
Test Input Expected Results Actual Results Remark
Case ID

Should identify the Identified the leaf is


Select an image
image is diseased with infected with bacterial
1 with bacterial Pass
bacterial spot and spot and provided
spot
provide remedies remedies

Should identify the Identified the leaf is


Select an image
image is diseased with infected with yellow
2 with Yellow curl Pass
yellow curl leaf virus curl leaf virus and
leaf virus
and provide remedies provided remedies

Should identify the Identified the leaf is


Select an image
image is diseased with infected with late
3 with Late Blight Pass
light blight and provide blight disease and
disease
remedies provided remedies

Select a healthy Should identify the Identified the image


4 Pass
image image as healthy status as healthy

10
PLANT DISEASE DETECTION USING ML

CHAPTER 5
5.1. Results

Fig 5.1: Backend output (accuracy)

Fig 5.2: Frontend output (tkinter application)

11
PLANT DISEASE DETECTION USING ML

Fig 5.3: Detection of Yellow leaf curl virus

Fig 5.4: Remedies for Yellow leaf curl virus

12
PLANT DISEASE DETECTION USING ML

Fig 5.6: Detection of Bacterial spot

Fig 5.7: Remedies for Bacterial spot

13
PLANT DISEASE DETECTION USING ML

Fig 5.8: Detection of Late blight

Fig 5.9: Remedies for Late blight

14
PLANT DISEASE DETECTION USING ML

Fig 5.10: Detection of healthy leaf

5.2. Conclusion
To prevent losses, small farmers are dependent on a timely and accurate crop disease diagnosis.
In this study, Convolutional Neural Network will be used, and the model will be developed.
The final result will be a plant disease detection desktop application. This service is free, easy
to use. Thus, the user’s needs as defined in this paper have been fulfilled.
A thorough investigation exposes the capabilities and limitations of the model. The achieved
accuracy depends on a number of factors including the stage of disease, disease type,
background data and object composition. Due to this, a set of user guidelines would be required
for commercial use, to ensure the stated accuracy is delivered. As the model will be trained
using a plain background and singular leaf, imitation of these features is best.

5.2. Future work


Overall, we were able to understand how CNNs may be applied to empower small farmers in
their fight against plant disease. In the future, work will be focused on diversifying training
datasets for use in real life situations. Without such developments, the struggle against plant
disease will continue.

15
PLANT DISEASE DETECTION USING ML

References
[1] S. Arivazhagan, R. Newlin Shebiah, S. Ananthi, S. Vishnu Varthini, “Detection of
unhealthy region of plant leaves and classification of plant leaf diseases using texture feature”,
CIGR, 2013, vol.15, no.1, pp.211-217.
[2] Haiguang Wang, Guanlin Li, Zhanhong Ma, Xiaolong Li, “Image Recognition of Plant
Diseases Based on Backpropagation Networks”, 5th International Congress on Image and
Signal Processing (CISP 2012)
[3] Bhange, M., Hingoliwala, H.A., ‘Smart Farming: Pomegranate Disease Detection Using
Image Processing’, Second International Symposium on Computer Vision and the Internet,
Volume 58, pp. 280-288, 2015
[4] Pranali K. Kosamkar, Dr.V.Y.Kulkarni, Krushna Mantri, Shubham Rudrawar, Shubhan
Salmpuria, Nishant Gadekar, ‘Leaf Disease Detection and Recommendation of Pesticides
using Convolution Neural Network’, 2018 Fourth International Conference on Computing
Communication Control and Automation (ICCUBEA)
[5] Kaushik Kunal Singh, ‘An Artificial Intelligence and Cloud Based Collaborative Platform
for Plant Disease Identification, Tracking and Forecasting for Farmers’, 2018 IEEE
International Conference on Cloud Computing in Emerging Markets (CCEM)
[6] Suma V, R Amog Shetty, Rishab F Tated, Sunku Rohan, Triveni S Pujar, ‘CNN based Leaf
Disease Identification and Remedy Recommendation System’, Third International Conference
on Electronics Communication and Aerospace Technology [ICECA 2019]
[7] Marwan Adnan Jasim, Jamal Mustafa AL-Tuwaijari, “Plant Leaf Diseases Detection and
Classification Using Image Processing and Deep Learning Techniques”, 2020 International
Conference on Computer Science and Software Engineering (CSASE), Duhok, Kurdistan
Region - Iraq

16

You might also like