Dayananda Sagar University: "Plant Disease Detection Using ML"
Dayananda Sagar University: "Plant Disease Detection Using ML"
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE & ENGINEERING
Submitted by
B G RAHUL KARRTHIK-(ENG17CS0044)
B M MADHURYA-( ENG17CS0046)
BHAVYA M-( ENG17CS0052)
DARSHAN A-(ENG17CS0060)
CERTIFICATE
Date:
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 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
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]
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.
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.
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.
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.
6
PLANT DISEASE DETECTION USING ML
Workflow
Start
Input image
CNN
process
End
7
PLANT DISEASE DETECTION USING ML
CHAPTER 4
4. Implementation
• Smart Phone
• Laptop or desktop with:
o Intel i5 or equivalent
o 4GB RAM or more.
training_data = []
label = label_img(img)
path = os.path.join(TRAIN_DIR,img)
img = cv2.imread(path,cv2.IMREAD_COLOR)
training_data.append([np.array(img),np.array(label)])
shuffle(training_data)
8
PLANT DISEASE DETECTION USING ML
convnet = max_pool_2d(convnet, 3)
convnet = max_pool_2d(convnet, 3)
convnet = max_pool_2d(convnet, 3)
convnet = max_pool_2d(convnet, 3)
convnet = max_pool_2d(convnet, 3)
test = train_data[-500:]
9
PLANT DISEASE DETECTION USING ML
model.save(MODEL_NAME)
Test
Test Input Expected Results Actual Results Remark
Case ID
10
PLANT DISEASE DETECTION USING ML
CHAPTER 5
5.1. Results
11
PLANT DISEASE DETECTION USING ML
12
PLANT DISEASE DETECTION USING ML
13
PLANT DISEASE DETECTION USING ML
14
PLANT DISEASE DETECTION USING ML
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.
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