Desease Detection Using DL (Updated)

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 12

Detection of Disease in Plants using Deep learning

Abstract
Agriculture is the backbone of Indian economy with around 70% of the population earning
their livelihood directly or indirectly from this sector. It is a critical sector as it plays major
part in the development of the Indian economy and food security for the vast population of
the country.
Few viruses or pests are spread extensively in the field by contact between diseased and healthy
leaves. These diseases in leaves result in the destruction of crops or part of the plant, resulting in
decreased food production. Also, knowledge about the pest management or control and diseases
are less in various under developed countries. If proper identification and prevention methods are
not followed in early stage of cultivation, it can lead to crop failure and downfall of the economy
in any country.
For accurate advice on plant diseases, finding farm specialists in rural areas is a very
difficult task. This needs continuous monitoring of specialists, but however, in big farms
could be exorbitantly costly and time consuming.
The application uses deep neural network structure that can reliably detect the plant disease
using a single image of plant leaf and further can be used to provide solution to cure the disease.
In most cases disease symptoms are seen on the leaves, fruit and stem. The leaf is considered for
plant disease detection. To detect whether the leaf is diseased or healthy, inception v3 in
Convolutional Neural Network (CNN) algorithm is used for feature extraction and
classification of image dataset. The methodology proposed can make an accurate detection
of the leaf diseases with little computational effort.
Keywords: Convolutional Neural Network (CNN), Leaf Disease Detection, Inception v3

1. INTRODUCTION

Plant diseases pose a significant threat to crop fertility, compromising food security and reducing
farmer yields. Farmers seldom go to the agriculture office to find out what illness they might
have. Farmers normally detect the disease with their naked eyes, which can lead to incorrect
pesticide application and lower crop yield. Pests and diseases severely damage crops or parts of
plants, leading to lower food yield and a shortage of food. Furthermore, one of the main causes of
plant diseases is climatic instability. Physically inspecting plant pathogens is a time-consuming
and exhausting process due to their diverse existence. As a result, there is a need to reduce the
amount of manual labor required for this task while also producing correct predictions and
ensuring that the farmers' lives are as simple as possible. Machine Learning (ML) algorithms,
Artificial Intelligence (AI), and Digital Image Processing (DIP) techniques have all progressed in
recent years. Images captured from multi spectral and hyper spectral cameras show a vast number
of applications now a days[1-4]. In a system to encourage farming, these new inventions must be
integrated with modern practices. These diseases can affect the shape of plants, cause damage to
plants, and have an effect on the color and texture of the leaves and also have an impact on the
fruits and other things. There may be difficulties dealing with plant diseases as a result of the less
skilled or inexperienced farmers. As a result, technological advances should be provided to guide
farmers in identifying diseases in their early stages and provide ways to combat those diseases
[5].Deep learning approaches have become increasingly popular for pattern recognition since they
have proven to be effective at recognizing various illustrations [6-7]. Feature extraction can be
automated using deep learning. Deep Learning decreases error rates and computational time as
related to certain other standard machine learning algorithms, and it achieves a high level of
accuracy in classification problems [8]. The key goal of our research is to use Deep Learning
algorithms to predict plant diseases and provide methods for recovering from them [9-10].
Data preprocessing, building the model, compiling, training, and random test are the five main
phases of the proposed technique. The images used to apply the suggested technique are taken
from the Plant Village dataset, which is freely available online. Inception v3, a minor
modification of the deep learning convolutional neural network (CNN) standard model, was used
to classify the input images. Inception v3 is a convolutional neural network that can aid in image
processing and object recognition. It's a Google-created pre-trained model, in our proposed
model, We will apply our classes and retrain the model. The below is how the article is structured:
In Section II the suggested approach and model, as well as the measures taken to achieve the
required results, are detailed. The findings and interpretation of the proposed approach are
discussed in Section III. Section IV contains the results as well as the scope for prospective
research.
2. METHODOLOGY:

Figure1.represents the thorough design of the methodology using convolution neural network
algorithm [11].The detailed design is explained as follows

Fig.1.Proposed Methodology

Data Link:
Initially, the data is collected from the set of images of all the plant leaves are collected from
plant village dataset and different classes are made. There are about 38 classes of unhealthy and
healthy plant leaves. These are stored in the git-hub repository which is considered for this study.
The dataset is linked to the IDE and the images are mapped with the label i.e total number of
classes to get into the IDE.
Import Libraries:
Some of the important libraries are imported like Conv2D, Dense, Keras, Flatten which help to
build the model.
Building a Convolutional Neural Network (CNN) is from step 3 to 8 as follows:
Transfer learning with tensor flow hub
Fig 2. Inception v3 Architecture[13]
The reuse of a previously trained model on a new problem is known as transfer learning. A
computer uses the information learned from a previous task to enhance generalization about a
new task in transfer learning. TensorFlow Hub is a repository of TensorFlow models that have
already been trained. Initially image classification model is started with a TensorFlow Hub and
then some basic transfer learning is done. Here in the proposed methodology, the already pre
trained model is reuse on the problem and use it for the use-case. In the proposed model,
inception v3[12] is used which is already a pre-trained model trained on ImageNet dataset
provided by Google. Then the classes are added and the model is retrained, so that the model can
learn as much as it can. Fig.2 shows the architecture of inception v3 model made by Google of
the proposed model.
Data Pre-Processing

Data Preprocessing [14] is the method of transforming or encoding data so that it can be easily
parsed by a computer. In other words, the algorithm can now easily interpret the data's features.
In this case the set of images for one class is less i.e. there are about 2000 images for one class
but that is not enough for processing so, Data Augmentation is performed [15]. Data
augmentation helps us to massively increase the diversity of data available for training models
without having to collect new data. An example of this is shown in Fig 3.

Fig.3 Data augmentation[15]

Building the model


After collecting a huge set of data, the model is constructed by adding layers in this process. The
‘add()’ function is used to add layers to the model. The first 2 layers are Conv2D layers. These
are convolution layers that will deal with input images, which are seen as 2-dimensional
matrices.
The layer's activation [16] feature is called activation; it will work well with the deep neural
network. The ReLU, or Rectified Linear Activation, is the activation feature used for the first
layer.
ReLU- The rectified linear activation function, or ReLU, is a linear function that outputs the
input data directly if the value is positive signifying that the images are grayscale. It has become
the default activation function for many types of neural networks because it is easier to train and
thus produces better performance. In Fig.4 the graph shows the activation function of the ReLU
model. In between the Conv2D [17] layers and the dense layer, there is a ‘Flatten’ layer. Flatten
serves as a connection between the convolution and dense layers. The layer form will be used for
the output layer which is 'dense.' Dense is a common layer class for neural networks that is used
in many cases.

Fig.4 Activation ReLU[18]


For the second layer the model uses Softmax Activation-The softmax activation allows the
output equal to one, allowing the output to be interpreted as probabilities. Following that, the
model will make a prediction based on the choice with the highest probability. While building
the model, dropout technique is used.Fig.5 shows the dropout in deep learning, it is a teaching
strategy in which randomly selected neurons are ignored. This means that on the forward pass,
their contribution to downstream neuron activation is temporarily omitted, and any weight
changes are not added to the neuron on the backward pass.

Fig.5 Dropout in deep learning[19]


Compiling the model
After building the model, compiling is done. It requires three parameters in this case: optimizer,
loss, and metrics. The learning rate is regulated by the optimizer. The optimizer used is called
‘adam.' 'Adam[20] is a good optimizer which is used in a variety of situations. Throughout
instruction, the adam optimizer adjusts the learning pace.

Fig.6 Comparison of Learning rate[18]


The learning rate determines how quickly the model's optimal weights are determined. A slower
learning rate as shown in Fig.6may result in more accurate weights (up to a point), but it will
take longer to compute the weights. If the model is given higher learning rate, it will miss a few
steps, reducing the time it takes and, as a result, less accuracy is obtained. As a result, proposed
model makes use of the learning rate. In this case the Initial Learning rate=0.001.For loss feature,
categorical cross entropy is used which is the most popular classification method. Lower score
indicates the model performance is better. The proposed model uses the accuracy metric to see
the accuracy score on the validation package when the model is trained.
Training the model
Training a model involves is learning (determining) good values for all the weights and the bias
from labeled examples. To train, the model's fit() function is used with the following parameters:
training data (train X), aim data (train y), validation data, and the number of epochs. Epochs
determines the number of iterations the model can complete through the dataset. The model will
improve over time as we run more epochs, up to a point. After that, the model can no longer
improve with each epoch. For the proposed model, number of epochs is set to 10.After 10
epochs; model has got to 92.04% accuracy on the validation set. Fig.7 shows the 10 epochs with
loss and accuracy rate
Fig.7. Epochs used in the proposed model is up to 10.
Random test
The model is validated here by taking random data from the test folder that the model hasn't seen
before and comparing the results to the accuracy rate. The outcomes are shown in the results
column. After the testing phase, convert the model into ‘tflite’ that can easily communicate with
the model and build the application in the android studio that can help farmers to easily capture
the image and send it to detect the disease and provide remedies for that particular disease.

3. RESULTS

The classification process is carried out with the help of a CNN-based algorithm and
photographs of diseased and normal plant leaves from the PlantVillage dataset[21]. The dataset
includes different leaves with various diseases such as black rot, apple scab, bacterial spot, early
blight, and late blight, among others. It also includes photos of these leaves in their natural
condition. The extracted features of an infected leaf are used to detect diseases of the apple,
grape, peach, orange, tomato, pepper, potato, cherry, and other fruits and vegetables. The
extracted features are solely used to classify the images. A total of 43000 images were used to
train the model, and the testing collection has a total of 10000 images with 38 classes. The
number of epochs is 10 with a learning rate of 0.001. The accuracy was found to be 92.04
percent. The efficiency of the classification is determined by comparing the estimated type to the
original type. To reduce the processing time, the image is reduced to 432X288 dimensions.
Figure 9 shows the model output containing source and predicted classes along with degree of
confidence in disease detection of input image.
Fig.9 Input images showing Plant diseases identified using CNN (a) Tomato plant diseases,
Tomato mosaic virus, (b) Apple healthy leaf and (c) Apple plant disease, Black rot

The analyzed and the results on the confidence level among the plants chosen for this research,
which shows the health of the plants, are listed below.
Figure9(a):SOURCE:class:/content/Plant-Disease-
Detection/validation/Tomato__Tomato_mosaic_virus,PREDICTED: class:
Tomato__Tomato_mosaic_virus, confidence: 0.801352
Figure 9(b): SOURCE: class:/content/Plant-Disease-
Detection/validation/Apple__healthy,PREDICTED: class: Apple__healthy, confidence:
0.997743
Figure 9(c): SOURCE: class:/content/Plant-Disease-
Detection/validation/Apple__Black_rot,PREDICTED: class: Apple__Black_rot, confidence:
0.99

Once the diseases in plant leaves are identified, some of the preventive measures to be taken in
the early stage, pesticides, fertilizers, weedicides, and other information are also provided to the
farmers in order to prevent contamination to the remaining parts of the plant. An application is
built to identify the diseases and on detection, a proper solution is displayed in the application.
The overall process of uploading an image of the infected plant’s leaf and having the results
predicted will happen over android platform. According to the results it is proved that CNN
classifier [22] has enhanced the plant disease detection process as compared to Machine learning
approaches used [23].
CONCLUSION
Agriculture is one of India's most significant economic sectors. To boost the country's economy,
it's critical to predict crop diseases. In this paper, we suggest a deep learning method for
developing a disease classification classifier. To avoid occlusion, the picture is normally taken
with a clear backdrop. Our results demonstrate that deep learning models, especially CNNs,
outperform previous work in the classification of plant diseases. Furthermore, our experiments
show the value of using a pre-trained model (Inception V3 in our case), particularly when the
number of examples used in training is small, as compared to the large numbers used in disease
classification. When compared to the use of existing machine learning models [24] for different
applications to achieve higher accuracy, creating and training a CNN model from scratch is a
time-consuming task [25,26]. As a result, different models may be used or retrained depending
on the application. This is referred to as transfer learning. The application's solutions are
applicable to all farmers, regardless of the location of the crops.

Future scope
Fig.8 shows a flow diagram of a mobile application. The proposed system can be further
developed into a mobile application that takes input in the form of images of the leaves and
detects disease and provides solutions for the detected disease.

Fig.8 Mobile application flow diagram

REFERENCES
1. A Nandibewoor, R Hegadi, A Novel SMLR -PSO model to Estimate the Chlorophyll content
in the crops using hyper spectral Satellite images" in Cluster Computing,22(1), Springer
publication (SCIE), 2018
2. S Muddebihal,A Nandibewoor, R Hegadi, Estimation of Chlorophyll Content in Crop Using
Multispectral Satellite Imagery, International Journal of Scientific & Technology Research
volume 6, Issue 08, August 2017,ISSN 2277-8616
3. SB Hebbal,A Nandibewoor, R Hegadi, Remote Monitoring of Maize Crop through Satellite
Multispectral Imagery, proceedings of International Conference on Advanced Computing
Technologies and Applications (ICACTA-2015), Elsevier Procedia Computer Science 45
(MAY 2015)
4. PKini, AKonnur, A Nandibewoor, R Hegadi, Spectral Estimation of Nitrogen status in Wheat
crops using Remote Sensing,International Journal of System and Software Engineering,
Volume 6 Issue 1, June 2018 ISSN.: 2321-6107
5. Pushpalatha S Nikkam,A Nandibewoor, ,Aijazahamed Qazi, Leena
Sakri,vijayendraNargund,AishwaryaSajjan,SaloniPorwal,Sujit Bhosale PyalGhorpade
,Comparative Analysis of DIP Techniques to detect Leaf Disease in Tomato Plant,
International conference on Frontiers in Engineering Science and Technology, 2020/12.
6. G. Madhulatha and O. Ramadevi, "Recognition of Plant Diseases using Convolutional
Neural Network," 2020 Fourth International Conference on I-SMAC (IoT in Social, Mobile,
Analytics, and Cloud) (I-SMAC), 2020, pp. 738-743, doi: 10.1109/I-
SMAC49090.2020.9243422.
7. A. Kamilaris and F. X. Prenafeta-Boldu, “Deep learning in agriculture: A survey,” Comput.
Electron. Agric., vol. 147, no. July 2017, pp. 70–90, 2018.
8. Mohanty SP, Hughes DP and Salathe M (2016) Using Deep Learning for Image-Based Plant
Disease Detection. Front. Plant Sci. 7:1419. doi: 10.3389/fpls.2016.01419
9. Ferentinos, Konstantinos. (2018). “Deep learning models for plant disease detection and
diagnosis. Computers and Electronics in Agriculture”. 145. 311-318.
10.1016/j.compag.2018.01.009.
10. Mohammed Brahimi, Kamel Boukhalfa&Abdelouahab Moussaoui (2017) Deep Learning for
Tomato Diseases: Classification and Symptoms Visualization, Applied Artificial
Intelligence, 31:4, 299-315, DOI: 10.1080/08839514.2017.1315516
11. Saad Albawi, Tareq Abed Mohammed., “Understanding of a Convolutional Neural
Network”2017. International Conference on Engineering and Technology (ICET),21-23 Aug.
2017,17615756.
12. Xiaoling Xia, Cui Xu and Bing Nan, "Inception-v3 for flower classification," 2017 2nd
International Conference on Image, Vision and Computing (ICIVC), Chengdu, 2017, pp.
783-787.
13. Saha S. (2018). A CNN sequence to classify handwritten digits [Online image]. Towards
Data Science. https://towardsdatascience.com/a-comprehensiveguide-to-convolutional-
neural-networks-the-eli5-way3bd2b1164a53
14. Gonzalez Zelaya, C. V. (2019). Towards Explaining the Effects of Data Preprocessing on
Machine Learning. 2019 IEEE 35th International Conference on Data Engineering (ICDE).
15. Data Augmentation | How to use Deep Learning when you have Limited Data byArun
Gandhi(2021). Nanonets.
16. https://nanonets.com/blog/data-augmentation-how-to-use-deep-learning-when-you-have-
limited-data-part-2/
17. https://www.researchgate.net/publication/349162145_Plant_Disease_Detection_Using_Conv
olutional_Neural_Network
18. A Gentle Introduction to the Rectified Linear Unit (ReLU) by Jason Brownlee (2019) in
Deep Learning Performance. Machine learning mastery.
https://machinelearningmastery.com/rectified-linear-activation-function-for-deep-learning-
neural-networks/
19. Dropout in (Deep) Machine learning by Amar Budhiraja(2016). Medium.
https://medium.com/@amarbudhiraja/https-medium-com-amarbudhiraja-learning-less-to-
learn-better-dropout-in-deep-machine-learning-74334da4bfc5
20. Kingma, Diederik& Ba, Jimmy. (2014). Adam: A Method for Stochastic Optimization.
International Conference on Learning Representations.
21. D. P. Hughes and M. Salathe, "An Open Access Repository of Images on Plant Health to
Enable the Development of Mobile Disease Diagnostics," eprint arXiv:1511.08060, 2015.
22. D. M. Sharath, S. A. Kumar, M. G. Rohan, Akhilesh, K. V. Suresh and C. Prathap, "Disease
Detection in Plants using Convolutional Neural Network," 2020 Third International
Conference on Smart Systems and Inventive Technology (ICSSIT), 2020, pp. 389-394, doi:
10.1109/ICSSIT48917.2020.9214159
23. S. Ramesh et al., "Plant Disease Detection Using Machine Learning," 2018 International
Conference on Design Innovations for 3Cs Compute Communicate Control (ICDI3C), 2018,
pp. 41-45, doi: 10.1109/ICDI3C.2018.00017.
24. P. Panchal, V. C. Raman and S. Mantri, "Plant Diseases Detection and Classification using
Machine Learning Models," 2019 4th International Conference on Computational Systems
and Information Technology for Sustainable Solution (CSITSS), 2019, pp. 1-6, doi:
10.1109/CSITSS47250.2019.9031029. (plant disease)
25. Tanya Makkar, Yogesh Kumar, Ashwani Kr Dubey., “Analogizing Time Complexity of
KNN and CNN in Recognizing Handwritten Digits” 2017 Fourth International Conference
on Image Information Processing (ICIIP), 10.1109/ICIIP.2017.8313707,21-23 Dec. 2017.
26. P. Tm, A. Pranathi, K. SaiAshritha, N. B. Chittaragi, and S. G. Koolagudi, "Tomato Leaf
Disease Detection Using Convolutional Neural Networks," 2018 Eleventh International
Conference on Contemporary Computing (IC3), 2018, pp. 1-5, doi:
10.1109/IC3.2018.8530532.

You might also like