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

Report Prethika

Report
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
0% found this document useful (0 votes)
23 views

Report Prethika

Report
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/ 54

PLANT LEAF DISEASE DETECTION USING CNN

PHASE I REPORT

Submitted by

IRUTHAYA ANTONY PRETHIKA D

(950322405003)

in partial fulfillment for the award of the degree of

MASTER OF ENGINEERING

IN

COMPUTER SCIENCE AND ENGINEERING

GRACE COLLEGE OF ENGINEERING

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

ANNA UNIVERSITY, CHENNAI

DECEMBER – 2023

i
ANNAUNIVERSITY, CHENNAI

BONAFIDE CERTIFICATE

Certified that this Report titled “ PLANT LEAF DISEASE DETECTION ” is


the bonafide work of IRUTHAYA ANTONY PRETHIKA .D (950322405003)
who carried out the work under my supervision. Certified further that to the best of
my knowledge the work reported herein does not form part of any other thesis or
dissertation on the basis of which a degree or award was conferred on an earlier
occasion on this or any other candidate.

SIGNATURE SIGNATURE

Dr. K. M. ALAAUDEEN M.E.,Ph.D Mrs. V. REVATHY M.E.,(Ph.D)

Head Of The Department Assistant Professor

Department of Computer Science and Department of Computer Science and

Engineering Engineering

Grace College of Engineering Grace College of Engineering

Thoothukudi-628005 Thoothukudi-628005

This report is submitted for the Project Work Phase I viva-voce examination held
on ……………………

INTERNAL EXAMINER EXTERNAL EXAMINER

ii
ABSTRACT
Plants and crops that are infected by pests have an impact on the country's
agricultural production. Usually, farmers or professionals keep a close eye on
the plants in order to discover and identify diseases. However, this procedure is
frequently time-consuming, costly, and imprecise. Plant disease detection can
be done by looking for a spot on the diseased plant's leaves. The goal of this
paper is to create a Disease Recognition Model that is supported by leaf image
classification. To detect plant diseases, we are utilizing image processing with
a Convolution neural network (CNN). A convolutional neural network(CNN)
is a form of artificial neural network that is specifically intended to process pixel
inputand is used in image recognition. Farmers do not expertise in leaf disease
so they produce less production. Plant leaf diseases detection is the important
because profit and loss are depends on production. CNN is the solution for leaf
disease detection and classification. Main aim of this research is to detect the
apple, grape,corn, potato and tomato plants leaf diseases. Plant leaf diseases are
monitoring of large fields of crops disease detection, and thus automatically
detected the some feature of diseases as per that provide medical treatment.
Proposed Deep CNN model has been compared with popular transfer learning
approach such as VGG16. Plant leaf disease detection has wide range of
applications available in various fields such as Biological Research and in
Agriculture Institute. Plant leaf disease detection is the one of the required
research topic as it may prove benefits in monitoring large fields of crops, and
thus automatically detect the symptoms of diseases as soon as they appear on
plant leaves.

iii
சசசசசசசசச

சசசசசசசசாசச சாசசசசசசாசசசச சாசசசசசசச சசசசசசச சசசசசசசச சாசசசாசச சாசசாச சசசசசசசசசாசச சாசாசசாசச சசசசசசசாசசசசசசசச. சசசசசசாச, சாசசசசசசசச
சசசசசா சசாசசசா சசாசசசசசசசச சசசசசசசசசச

சசாசசசசசசா சசசசசசசா சாசாசசசசசாச சாசசசசசசச சசசசசசாசாசசச சசசசசசசச சசசசசசசசசசச. சசசசாசாசாசா, சசசச சசசசசசசசச சசாசசசசச சசசசசசச
சசாசசசசசசசசாசாசசசா, சசசசசசசசாசசச சசசசசசச

சசசசசசசசசசசசச. சசசசசசசச சாசசசசசசசா சசசசசாசச சசா சசசசசசசச சசசசசாசசசச சசசசச சாசச சசசசசசச சசாசசசசசாசச. சசச சச சசசசாசாசச சசசசச
சசாசசசசசாசசசசா சசசசச சசசசசசாச சாசாாாசச சசசசாசாசாசசச சசசசசச சாசாசச சசசசசசசசாசச. சாசச சசசசசசசசசச சசாசசசச,

சசசசசசசாசசச சசசாசசச சசசசசசசசாசச (CNN) சசசசச சச சசசசசசாசசசசசசச சசசாசசசசாசசசசசசாசச. சசசசசசசாசசசா சசசாசசச சசசசசசாசசசச (CNN) சசசசசச

சசசசசசச சசசசசசசசா சசசசசசசாசசசா சசச சசசசசாசசசா, சசச சசசாசாசாச சாசசசசச சசசசசசாசசசா சசசசசசசசசாசசசசச சசாசசசசாசசச சசாசாசசச

சசசசசசச சச சசசசசசாசசாசசசா சசசசசசசசாசசாசசசசசசசச. சசசசாசசசசசசசசச சசச சசசசசசசசசச


சசசாசசசசசசசச சசாசச, சசசாசச சசச சசசசசாச சசசசசசசசசச சசசசசசசா சசசசசசசசசச. சாசச சசச சசசசசசசசசச சசாசசசசசா சாசசசசசசாசசா,

சசசசசசா சசசசசசச சசாசசசசா சசசசசாசாசசசச சசசசசசசசசச. CNN சசச சசசசச சசாசசசசசா சசசசசசச சசசசாசாசசசாசசசாச சசசசசச. சசசச

சசாசசசாசசசாசச சசசாசாச சசசசாசசச சசசசசசா, சாசாசசசச, சசாசசச, சசசசசசாசாசசசசச சசசசசசச சசாசாசச

சசசசசசசசச சசச சசசசசசசசசச சசசசசசசசசசசசச. சசசச சசச சசசசசசசச சசசசசசசசசச சசசசச சசாசசசசசசசா சசாாச சசசசசசச சசாசாசசசசசா, சசசசசசசச
சாசசசாசசசச சசசசசசசசசச சசச

சசசசசசசாசச சாச சசசசசசசசச சாசசசசச சசாசசசசாசச. சசசசசசாசசசசாசசசச சாசச சாசசசசசா சாசசச VGG16 சசாசசச சாசசசசாச சாசசாசசச
சசசசசச சசாசசசாசசசசசசச சசாசாசசாசசசசசச. சாசச சசச சசசசச சசாசசசசசா, சசசாசசசா சசாசசசாசா சசசசசசச சசசசசசசச சசசசசசசா சசாசசச சசசசசசச

சசசசசசசசச சசசசச சசசசசசச சசசசசசசசசசசசச சசசசசசசசசசசச. சசசச சசச சசசசச சசசசசசசசசசசசசசாசசசசா சசாசசசாசா சசசசாசாசசாசச சசசசாசசசா,
சசசசாசச சசச சசசசசசசாசச சசசசச

சசசசசசசசச சசாசாசசசாசசசசா சசசாசசச சசசசசசசசசசசசா, சசசாசச சாசச சசசசசாசச சசசசச சசசசசசசசசச சசசசசசசசசசசசச

சசசசசசச சசசசசசசசசசசசசச.

iv
ACKNOWLEDGEMENT

First of all I thank GOD THE ALMIGHTY for having helped me in completion

of this project successfully.

I am grateful to my Chairman and Vice chairman for creating opportunity and

providing all facilities to carry out this project work.

I express my sincere thanks to my Principal Dr. S. Richard, M.Tech., Ph.D for

his encouragement, which has motivated me to strive hard to excel in my discipline of

engineering.

I wish to thank Dr. K. M. Alaaudeen, M.E., Ph.D Head of the Department,

Department of Computer Science and Engineering, for furnishing every essential

facility, her guidance and support throughout this project work.

I gratefully thank my project guide Mrs. V. Revathy, M.E., (Ph.D) for the timely

advice and creative support rendered in favour of me.

Lastly, I thank my parents and friends for their constant encouragement without

which this assignment would not be possible.

IRUTHAYA ANTONY PRETHIKA.D

v
TABLE OF CONTENTS

CHAPTER TITLE PAGE NO

NO

ABSTRACT iii

LIST OF FIGURES ix

LIST OF ABBREVIATION X

1 INTRODUCTION 1

1.1 METHODOLOGY 3

1.2 DATA COLLECTION AND PROCESSING 3

2 LITERATURE SURVEY 4

3 SYSYEM ANALYSIS 6

3.1 EXISTING SYSTEM 6

3.2 PROPOSED SYSTEM 6

3.3 CNN-BASED PREDICTIVE SYSTEM 6

3.3.1 Application 8

3.3.2 Objectives 8

3.3.3 Motivation 9

4 REQUIREMENT SPECIFICATION 10

4.1 HARDWARE REQUIREMENTS 10

4.2 SOFTWARE REQUIREMENTS 10

4.3 FUNCTIONAL REQUIREMENTS 10

vi
5 TECHNOLOGY OVERVIEW 11

5.1 INTRODUCTION TO PYTHON 11

5.2 FEATURE 11

5.3 TOOLS AND TECHNOLOGIES 13

5.3.1 Numpy 13

5.3.2 Compiler Option 13

5.3.3 Jupter Notebook 13

5.3.4 Scitlearn 13

5.3.5 Tensorflow 14

5.3.6 Keras 14

6 CONVOLUTIONAL NEURAL

NETWORK(CNN) ARCHITECHTURE 15

6.1 ARCHITECHTURE DIAGRAM 15

6.2 CONVOLUTIONAL LAYER 15

6.3 POOLING LAYER 16

6.4 FULLY CONNECTED LAYER 16

6.4.1 The first fully connected Layer 16

6.4.2 Connected output Layer 16

7 MODULE BUILDINGS 17

7.1 SUPERVISED LEARNING 17

7.2 UNSUPERVISED LEARNING 18

7.3 SEMISUPERVISED LEARNING 18

7.4 REINFORCEMENT LEARNING 19


vii
8 EXISTING WORK & IMPLEMENTATION 20

8.1 OVERVIEW OF EXISTING WORK 20

8.2 IMPLEMENTATION WORK 21

9 DATASET AND IMPLEMENTATION 24

9.1 DATASET DETAIL 24

9.2 DATASETS 25

9.3 FLOW DIAGRAM 27

10 TRAINING MODEL 28

11 FEASIBLITY STUDY 33

11.1 ECONOMICAL FEASIBILITY 33

11.2 TECHNICAL FEASIBILITY 33

11.3 SOCIAL FEASIBILITY 34

12 RESULT 35

12.1 SAMPLE CODE 36

13 FUTURE SCOPE 40

13.1 FUTURE SCOPE 40

14 REFERNCES 41

viii
LIST OF FIGURES

FIGURES NO. TITLE PAGE NO

1 TRAINING AND TEST DATASET 2

2 DISEASE DATASET 2

3 CNN ARCHITECHTURE 15

4 CONVOLUTIONAL LAYER 15

5 POOLING LAYER 16

6 FULLY CONNECTED LAYER 16

7 SUPERVISED LEARNING 17

8 UNSUPERVISED LEARNING 18

9 SEMI-SUPERVISED LEARNING 18

10 REINFORCEMENT LEARNING 19

11 PROPOSED WORKFLOW 21

12 EXPERIMENTAL MODEL 23

13 VGG16 LAYERED ARCHITECHTURE 23

14 LEAF DISEASE DATASET 25

15 VEGITABLE , FRUITS LEAVES

WITH DISEASE 26

16 FLOW DIAGRAM 27

17 TRAINING MODEL 28

ix
x
LIST OF ABBREVIATIONS

SI.No Abbreviation Meaning

1 CNN Convolutional Neural Network

2 R-CNN Region based Convolutional Neural Network

3 VGG16 Visual Geometry Group

4 ROI Region Of Interest

5 SVM Support Vector Machine

6 KNN K Nearest Neighbor

7 DL Deep Learning

8 GLCM Gray-Level Co-occurrence Matrix

xi
CHAPTER 1

INTRODUCTION

Agricultural production is a very old means of obtaining food. It is a vital


sourceof income for people all around the world. No one can exist in our world
withoutfood. Plants are crucial not only for humans, but also for animals who
rely on them for food, oxygen, and other necessities. The government and
experts are taking significantinitiatives to enhance food production, and they
are working successfully in the real world.When a plant becomes afflicted with
a disease, all living organisms in the environment are affected in some way.
This plant diseasecan affect anywhere on the plant, including the stem, leaf,
and branch.Even the types of illnesses that impact plants, such as bacterial and
fungal diseases etc can differ. The illness that impacts the crops will be
determined by factors such as climate. There are a large number of peoplethat
are food insecure. This occurs asa result of insufficient food crop output. Even
significant climate changes will have an impact on plant development.This type
of natural tragedy is unavoidable.Early detection of plant disease aids in the
prevention of large-scale crop losses. Farmers must apply the appropriate
insecticides for their crops. Too many pesticides are harmful to crops and
farmland. Getting expert advice will help you avoid misusing chemicals on
plants. Plants havebeen the focus of many researchers to aid farmers and others
involved in agriculture.When a disease is visible to the naked eye, it is
straightforward to detect. The illness may be discovered and treated early if the
farmer has sufficient information and monitors the crops on a regular basis.
However, this phase only exists when the disease is extreme or crop output is
low. Then there are the different innovations.Farmers will benefit from the
introduction of automated disease detection tools.

1
This approach yields outcomes that are suitable for both little and large-
scale agricultural cultivation. Importantly, the results are precise, and the
disorders aredetected in a very short amount of time. These technologies rely
heavily on deeplearning and neural networks to function. Deep Convolutional
Neural Network is utilized in this study to identify infected and healthy
leaves, as well as to detectillness in afflicted plants. The CNN model is
designed to suit both healthy and sick leaves; photos are used to train the
model, and the output is determined by the input leaf. images divided into
two parts training and testing dataset.

1.Apple scab 2.Grape Esca 3.Corn leaf spot 4.potato Early 5.Tomato
Figure 1. Two parts training and testing dataset.

Figure 2. Disease leaf

2
1.1 METHODOLOGY

 Data Collection
 Preprocessing
 Model selection
 Data Visualization
 Data Modeling
 Data Training
 Data Testing
 Data Prediction
 Evaluation
 Optimization

1.2 DATA COLLECTION & PREPROCESSING :

Data collection is the process of collecting every detail about the heart
diseases and diabetes like symptoms and the rate of possible counts. After
collecting the every good data set we have to prepare the data set separately for
everything. It will increase the accuracy rate as well as the perfect model.
Preprocessing is the process of data we have to prepare our data set according
to the symptoms. We have to prepare two datasets for the model. Because
preparing the data with possibilities at the same time is not a preparing the
data's that can be understandable by machine. Preprocessing of selecting the
features that will affectour model and which won't change in output. After the
selection of the Features we will use that data to train our model.

3
. CHAPTER 2

LITERATURE SURVEY

Robert G. de Luna, Elmer P. Dadios, Argel A. Bandala, “Automated Image


Capturing System for Deep Learning-based Tomato Plant Leaf Disease
Detection and Recognition,” International Conference on Advances in Big
Data, Computing and Data Communication Systems (icABCD) 2019[1].Suma
VR Amog Shetty, Rishab F Tated, Sunku Rohan, Triveni S Pujar, “CNN based
Leaf Disease Identification and Remedy Recommendation System,” IEEE
conference paper 2019[2]. Peng Jiang, Yuehan Chen, Bin Liu, Dongjian He,
Chunquan Liang, “Real-Time Detection of Apple Leaf Diseases Using Deep
Learning Approach Based on Improved Convolution Neural Networks,” IEEE
ACCESS 2019 [3]. Geetharamani, Arun Pandian, “Identification of plant leaf
diseases using a nine- layer deep convolution neural network,” Computers and
Electrical Engineering 76 (2019)[4]. Omkar Kulkarni, “Crop Disease Detection
Using Deep Learning,” IEEE access 2018[5]. Abirami Devaraj, Karunya
Rathan, Sarvepalli Jaahnavi and K Indira, “Identification of Plant Disease using
Image Processing Technique,” International Conference on Communication
and Signal Processing, IEEE 2019[6]. Velamakanni Sahithya, Brahmadevara
Saivihari, Vellanki Krishna Vamsi, Parvathreddy Sandeep Reddy and
Karthigha Balamurugan, “GUI based Detection of Unhealthy Leaves using
Image Processing Techniques,” International Conference on Communication
and Signal Processing 2019[7]. Balakrishna K Mahesh Rao, “Tomato Plant
Leaves Disease Classification Using KNN and PNN,” International Journal of
Computer Vision and Image Processing 2019[8]. Masum Aliyu Muhammad
Abdu, Musa Mohd Mokji, Usman Ullah Sheikh, Kamal Khalil, “Automatic
Disease Symptoms Segmentation Optimized for Dissimilarity Feature
extraction in Digital Photographs of Plant Leaves,” IEEE 15th International
Colloquium on Signal Processing & its

4
Applications2019[9].https://data.mendeley.com/datasets/tywbtsjrjv/1.Retrieve
d, http://dx.doi.org/10.17632/tywbt sjrjv.1.Suja Radha, “Leaf Disease Detection
using Image Processing,” Article in Journal of Chemical and Pharmaceutical
Sciences, March 2017[10]. Sneha Patel, U.K Jaliya, Pranay Patel, “A Survey
on Plant Leaf Disease Detection,” International Journal for Modern Trends in
Science and Technology, April 2020.[11]

5
CHAPTER 3

SYSTEM ANALYSIS

3.1 EXISTING SYSTEM :

Deep Convolutional Neural Network is utilized in this study to identify


infected andhealthy leaves, as well as to detect illness in afflicted plants. The
CNN modelis designed to suit both healthy and sick leaves; photos are used to train
the model, andthe output is determined by the input leaf.

3.2 PROPOSED SYSTEM :

Plants are susceptible to various disease-related disorders and seizures.


There arevarious causes which can be characterized by their effect on plants,
disturbances due to environmental conditions such as temperature, humidity,
excessive or insufficient food, light and the most common diseases such as
bacterial, viral and fungal diseases. In the proposed system, we use the CNN
algorithm to detect disease in plant leaves because with the help of CNN the
maximum accuracy canbe achieved if the data is good. We are building a neural
network model for imageclassification. this model will be deployed on the android
application for live detection of plant leaf disease through an android phone’s
camera. The recognition and classification procedures are depicted.

3.3 CNN-BASED PREDICTIVE SYSTEMS:


In the area of plant illness and pest identification, CNNs have been
extensively utilized. One of the first applications of CNNs in this field was the

6
lesions in plant images, utilizing classification networks. The method
employed involves training CNNs to recognize specific patterns or features in
the input image that are associated with various diseases or pests. After training,
the networkcan be utilized to classify new images as diseased or healthy. The
classification of raw images is a straightforward process that utilizes the entire
image as input to the CNN. However, this approach may be limited by the
presence of irrelevant information or noise in the image, which can negatively
impact the performance of he network. In order to address this problem,
investigators have proposed utilizing are gion of interest (ROI) based approach,
in which is the model is taught to categorize specific regions of the image that
contain the lesion, rather than the entire image. Multi-category classification is
another area of research in this field, which involves training CNNs to
recognize multiple types of diseases or pests in the same image. This approach
can be more challenging than binary classification, as it requires CNNs to learn
more complex and diverse patterns in the input images. The first broad
application of CNNs for plant pest and disease detection was the identification
of lesions using categorization networks. Current study issues include the
categorization of raw pictures, classification following recognition of regions
of interest pest identification can bea highly effective strategy. CNN is a DL
model that is ideally suited for image classification problems since it can
automatically learn picture attributes. To train the network when the team
constructed it independently, a tagged collection of photos of ill and healthy
plants was required. There must be a variety of pests and illnesses,
environmental circumstances within the databases. The team can then
construct the network architecture and choose relevant parameters based on
the specific features of the intended recipient plant pest and disease.
Alternately, during transfer learning, you can employ a CNN model that has
already been

7
fact that the pre-trained network has already acquired generic characteristics
from huge datasets. Notably, transfer learning enables teams t o harness the
performance of a model trained in some data that were developed using
extensive, varied datasets demonstrated to perform well on similar tasks.
Establishing the weight parameters formulti-objective disease and pest
classification networks, obtained through binary learning between healthy and
infected samples as well as pests, areuniform. A CNN model is designed that
integrates basic metadata and allows training on a single multi-crop model to
identify 17 diseases across five cultures by utilizing a unified newly suggested
model which has ability to handle multiplecrops multi-crop model(Picon et al.,
2019). The following goals can be accomplished through the use of the
proposed model:
1. Achieve more prosperous and stable shared visual characteristics than a
single culture.
2.Is unaffected by diseases that cause similar symptoms across cultures.
3.Seamlessly integrates the context for classifying conditional crop
diseases.Experiments show that the proposed model eliminates 71 percent of
classification errors and reduces data imbalance,with a balanced data the
proposed model boasts

3.3.1 Applications:
 Biological research

 Plant leaf disease detection also useful in agriculture institute.Some plant


leaf disease detection automatic techniques are beneficial for large work of
monitoring infarm of crops disease detection.

3.3.2 Objectives :
The objective of this research is to concentrate based on potato, tomato,
corn,grapes, and apple leaf disease detection using CNN.

8
3.3.3 Motivation
Identifying and recognition of leaves disease is the solution for saving
the reduction of large farm in crop disease detection and profit in
productivity, it is beneficial in agricultural institute, Biological research.

9
CHAPTER 4

REQUIREMENT SPECIFICATION

4.1 HARDWARE REQUIREMENTS

 RAM : 4 GB

 Keyboard : Logitech 110 Keys

 Mouse : Logitech Mouse

 System : Intel Core i4

 Hard disk : 60 GB

4.2 SOFTWARE REQUIREMENTS

 Pandas
 Sklearn
 Matplotlib
 Numpy

4.3 FUNCTIONAL REQUIREMENTS

 Language: Python

 Packages: Pandas, NumPy, Sklearn, Flask

 Framework: Anaconda

 Front End: HTML

 Back End: Machine Learning Mode

10
CHAPTER 5

TECHNOLOGY OVERVIEW

5.1 INTRODUCTION TO PYTHON:


Python is an interpreted, high-level and general-purpose programming
language.Python's design philosophy emphasizes code readability with its
notableuse ofsignificant whitespace. Its language constructs and object- oriented
approach aim to help programmers write clear, object- oriented, and functional
programming. Python is often described as a "batteriesincluded" language due
to its comprehensive standard library. Python was createdin the late 1980s, and
first released in 1991, by Guidovan Rossum as a successor to the ABC
programming language. Python 2.0, released in 2000, introduced newfeatures,
such as list comprehensions, and a garbage collection system withreference
counting, and was discontinued with version 2.7 in 2020. Python
3.0,releasedin 2008, was a major revision of the language that is not completely
backward-compatible and much Python 2 code does not run unmodified on
Python Python interpreters are supported for mainstream operating systems
and availablefor a few more (and in the past supported many more). A global
community ofprogrammers develops and maintains CPython, a free and open-
source referenceimplementation. A non-profit organization, the
PythonSoftware Foundation,manages and directs resources for Python and
CPython development. It currently ties with Java as the second most popular
programming language in the world.

5.2 FEATURE:
Python is a multi-paradigm programming language. Object-oriented
programming and structured programming are fully supported, and many of its

11
functional programming and aspect-oriented programming (including by meta
programming and meta objects (magic methods)). Many other paradigms are
supported via extensions, including design by contract and logic
programming.Python uses dynamic typing and a combination of referencecounting
and a cycle- detecting garbage collector for memory management. It also
features dynamic name resolution (late binding), which binds method and
variable names during program execution.It supports multiple
programmingparadigms, including structured (particularly, procedural), object-
oriented, and functional programming. Python is often described as a "batteries
included" language due to its comprehensive standard library. Python was
created in the late 1980s, andfirst released in 1991, by Guido van Rossum as a
successor to the ABC programming language. Python 2.0, released in 2000,
introduced new features, such as list comprehensions, and a garbage collection
system with reference counting, and was discontinued with version 2.7 in 2020.
Python 3.0, released in 2008, was a major revision of the language that is not
completely backward-compatible and much Python 2 code does not run
unmodified on Python 3.Python interpreters are supported for mainstream
operating systems and available for a few more (and in the past supported many
more). A global community of programmers develops and maintains CPython,
a free and open- source reference implementation. A non-profit organization,
the PythonSoftware Foundation, manages and directs resources for Python and
CPython development. It currently ties with Java as the second most popular
programming language in the world. Pandas is an open source Python package that
caters diverse toolsfor dataanalysis. The package contains various data
structures that can be used for manydiverse data manipulation tasks. It also
includes a range of methods that can be invoked for data analysis, which
becomes feasible when working on data science .

12
5.3 TOOLS AND TECHNOLOGIES:

5.3.1 Numpy :

Numpy is python package which provide scientific and higher level


mathematicalabstractionswrapped in python. It is [19] the core library for
scientific computing,that contains a strong ndimensional array object,
provide tools for integrating C,C++ etc. It is additionally useful in linear
algebra, random number capability etc. Numpy’s array type augments the
Python language with an efficient data structureused for numerical work.
Numpy additionally provides basic numerical routines,like tools for
locatingEigenvector. The versatile architecture permits you to deploy
computation to at least one or more CPUs or GPUs in a desktop, server, or
mobiledevice with a single API. Tensor Flow was originally developed by
researchers andengineers acting on the Google Brain Team.
5.3.2 Compiler option :

Anaconda is also a premium open-source distribution of the Python and R


programming languages for large-scale process, predictive analytics, and scientific
computing, that aims tomodify package managing and deployment.
5.3.3 Jupiter notebook :

The Jupyter Notebook is an open-source web application that enables you to


makeand share documents that contain live code, equations, visualizations and
narrative text. Uses include: data cleaning and transformation, numerical
simulation, statistical modeling, datavisualization, machine learning, and
much more

5.3.4 Scitlearn :

Scikit-learn [21] could be a free machine learning library for Python. It


features numerous classification, regression and clustering algorithms like
support vector machine, random forests, and k-neighbors’, and it additionally
13
supports Python numerical and scientific librarieslike NumPy and SciPy.
Scikit-learn is especiallywritten in Python, with some core algorithmswritten in
Python to get performance. Support vector machines are enforced by a python
wrapper around LIBSVM .i.e., logistic regression and linear support vector
machines by a similar wrapper around LIBLINEAR.

5.3.5 Tensorflow :

TensorFlow [22] is an open source software library for numerical


computation using data flow graphs. Nodes inside the graph represent
mathematical formula, whereas the graph edges represent the
multidimensional knowledge arrays (tensors) communicated between them.
The versatile architecture permits you to deploy computation to at least one or
more CPUs or GPU sin a desktop, server, or mobile device with a single API.
Tensor Flow was originally developed by researchers and engineers acting on
the Google Brain Team at intervals Google’s Machine Intelligence analysis
organization for the needs of conducting machine learning and deep neural
networks research, however, the system are general enough to be applicable
in a wide range of alternative domains as well.

5.3.6 Keras :

Keras is a high-level neural networks API, written in Python and capable


of running on top of TensorFlow, CNTK, or Theano. It was developed with
attentionon enabling quick experimentation. Having the ability to travel from
plan to resultwith the smallest amount do able delay is key to doing great research.
Keras permits for straightforward and quick prototyping (through user-
friendliness, modularity, and extensibility).Supports each convolutional
networks and

14
CHAPTER 6

CONVOLUTIONAL NEURAL NETWORK (CNN)


ARCHITECTURE

6.1 ARCHITECHTURE DIAGRAM :

Figure 3. CNN Architecture

A Convolutional Neural Network has three layers: a convolutional layer, a


poolinglayer, and fully connected layer. Figure 3shows all layers together.

6.2 CONVOLUTIONAL LAYER:

Figure 4. Convolutional layer

15
6.3 POOLING LAYER:

Figure 5. Pooling Layer

6.4 FULLY CONNECTED LAYER :

The preceding layers' output is "flattened" and turned into a single vector .

6.4.1 The first fully connected layer :

Adds weights to the inputs from the feature analysis to anticipate the
proper label.

6.4.2 Fully Connected output layer:

Offers the probability for each label in the end. Fig 5 shows the internal
working of fully connected layer

Figure 6. Fully connected Layer

16
CHAPTER 7

MODULE BUILDINGS
There is a very wide range of machine learning algorithms to choose
from, mostof which are available in the python library Scikit-learn. However,
most of the implementations of these algorithms do not accept sparse matrices
as inputs, andsince we have a large number of nominal features coming from
our n-grams features it is imperative that we encode our features in a sparse
matrix. Out of thealgorithms that do support sparse matrices in Scikit-learn, I
ended up trying naiveBayes, logistic regression and support vector machine
(SVM) with a linear kernel.I got the best results in cross validation using SVM
with aneuclidean regularization coefficient.

7.1 Supervised learning

7.2 Unsupervised learning

7.3 Semi Supervised learning

7.4 Reinforcement learning

7.1 SUPERVISED LEARNING :

Figure 7. Supervised learning


17
7.2 UNSUPERVISED LEARNING :

In unsupervised learning we have less information about objects, in


particular, the train set is unlabeled. What is our goal now? It’s possible to
observe some similarities between groups of objects and include them in
appropriate clusters. Some objects can differ hugely from all clusters, in this
way we assume these objects to be anomalies.

Figure 8. Unsupervised learning

7.3 SEMI-SUPERVISED LEARNING :

Semi-supervised learning tasks include both problems we described


earlier: they use labeled and unlabeled data. That is a great opportunity for
those who can’t afford labeling their data. The method allows us to
significantly improve accuracy, because we can use unlabeled data in the train
set with a small amountof labeled data.

Figure 9. Semi –Supervised learning

18
7.4 REINFORCEMENT LEARNING :

Reinforcement learning is not like any of our previous tasks because we


don’t have labeled or unlabeled datasets here. RL is an area of machine
learning concerned with how software agents ought to take actions in some
environment to maximize some notion of cumulative reward.

Figu r e 1 0 Reinforcement learning

19
CHAPTER 8

EXISTING WORK & IMPLEMNTATION

8.1 OVERVIEW OF EXISTING WORK :

Existing work related to leaf disease detection using CNN show to detect
and classify leaf disease using image processing techniques that follow steps
like Image Acquisition: image acquisition in the first load the image in digital
pictureprocess andthatconsist capturing the image through digital camera and
stores it indigital media for additional MATLAB operations .

B. Image Preprocessing: The main aim of image pre-processing is to enhance


the image information contained unwanted distortions or to reinforce some
image features for any processing . Preprocessing technique uses various
techniques like dynamic image size andform, filtering of noise, image
conversion, enhancing image and morphological operations.

C. Image Segmentation: In image segmentation is used K-means cluster


technique for partitioning of pictures into clusters during which a minimum of one
part of cluster contain image with major space of unhealthy part. The k means
cluster algorithmic rule is applied toclassify the objects into K variety of categories
per set of features.

D. Feature extraction: After clusters are formed texture features are


extracted using GLCM.(Gray-Level Co-occurrence Matrix).

E. Classification: In classification is used for testing the leaf disease. The


Random forestclassifier is used for
classification.

20
8.2 IMPLEMENTATIONWORK :

Apple, grape, potato, and tomato plant leaves which are categorized total
24 typesoflabels apple label namely: Apple scab, Black rot, Apple rust, and
healthy. Corn label namely:Corn Cercospora Gray spot, Corn rust, Corn
healthy, Corn Blight [11][13]. Grape label namely: Black rot, Esca, healthy,
and Leaf blight. Potato label namely: Early blight, healthy, and Late blight.
Tomato label namely: bacterial spot, early blight, healthy, late blight, leaf
mold, septoria leaf spot, spidermite, target sport, mosaic virus, and yellow leaf
curl virus[11][13].
The dataset consist of 31,119 images of apple, corn, grape, potato and tomato,
outof 31,119 images 24000 images are used. all Images are resized into 256 x
256,that images divided intotwo parts training and testing dataset, the whole
range of the train test split using 80-20 (80%of the whole dataset used for the
training and 20%for the testing)[11][13]. Then train CNN model.

Figure 11. Proposed workflow

Convolutional neural networks (CNN) can be used for the computational


21
They belong to the category of multi-layer neural networks which can
betrained to learn the required features for classification purposes.Less pre-
processing is required in comparison to traditional approaches and automatic
feature extractionis performed for better performance. For the purpose of leaf
disease detection, thebest results could be seen with the use of a variation of
the LeNet architecture . LeNet consists of convolutional, activation, max-
pooling and fully connected layer also LeNet is simple CNN model. This
architecture used for the classification of the leaf diseases in LeNet model. It
consists of an additional blockof convolution, activation and pooling layers in
comparison to the original LeNetarchitecture. The model used in this paper
been shown in Fig. 2.Each block consists of a convolution, activation and a
max pooling layer.Three such blocks followed by fully connected layers and
soft-max activation are used in this architecture. Convolution and pooling
layers are used for feature extraction whereas the fully connected layers are
used for classification. Activation layers are used for introducing non-linearity
into the network.Convolution layer applies convolution operation for
extraction of features. With the increase in depth, the complexity of the
extracted features increases. The size of the filter is fixedto 5 × 5 whereas
number of filters is increased progressively as we move from one block to
another. The number of filters is 20 in the first convolution block while it
isincreased to 50 in the second and 80 in the third. This increase in the number
offilters is necessary to compensate for the reduction in the size of the feature
maps caused by the use ofpooling layers in each of the blocks. After the
application of the convolution operation feature maps are zero padded, in order
to preserve the size of theimage. The max pooling layer is used for reduction in
size of the feature maps,speeding up the training process, and making the
model less variant to minor changesin input. The kernel size for max pooling
is 2×2. Re-LU activationlayer is used in eachof the blocks for the introduction
of nonlinearity. Also, Dropout regularization technique has been used with a
keep probability of 0.5to avoid over-fitting the train set.

22
The second dense layer is followed by a soft max activation function to
computetheprobability scores for the ten classes.

Experimental result(a)input image(b)convolution layer-1(c) convolution layer-2 (d) convolution


layer-(e)flatting layer [3].

Figure 12. Experimental Model

Further, in every experiment, the overall accuracy over the whole period
of training and testing regular intervals (for every epoch) will be computed.
The overall accuracy score willbe used for performance evaluation.
Transfer learning is a knowledge- sharing method that reduces the size of the
training data, contains 224*224 image fix size. To transfer the learning of a
pre- trained model to a new model Transfer learning is useful. Transfer
learning has been used in various applications, such as plant classification,
software defect prediction, activity recognition and sentiment classification.
In this, the performance of the proposed Deep CNN model has been
comparedwith popular transfer learning approach VGG16.

Figure 13. VGG16 layeredarchitecture

23
CHAPTER 9

DATASET & IMPLEMENTATION

9.1 DATASET DETAIL :

The Plant leaf diseases dataset with augmentation data-set, 39 different


classes of plant leaf and background images are available. The data-set
containing 61,486 images. We used six different augmentation techniques for
increasing the data-setsize. These techniques are,
Image flipping,
Gamma correction,
Noise injection,
PCA color augmentation,
Rotation, and
Scaling .
We use The Plant leaf diseases dataset with augmentation dataset only
30,052 images with 24 labels. The apple label namely: Apple scab, Black rot,
apple rust,and healthy. Corn labelnamely: Corn Cercospora spot Gray spot,
Corn rust, Corn healthy, Corn NorthernBlight[13][11]. Grape label namely:
Black rot, Esca, healthy, and Leaf blight. Potato labelnamely: Early blight,
healthy, and Late blight. Tomato label namely: bacterial spot, early blight,
healthy, late blight, leaf mold, septoria leaf spot, spider mite, target sport,
mosaic virus, yellow leaf curl virus.Transfer learning is a knowledge- sharing
method that reduces the size of the training data, contains 224*224 image fix
size. To transfer the learning of a pre-trained model to a new model Transfer
learning is useful. Transfer learning has been used in various applications, such
as plant classification, software defect prediction, activity recognition and
sentiment classification. In this, the performance of the proposed Deep CNN
model has been compared with popular transfer learning approach.

24
9.2 DATASETS :

Figure 14. Leaf Disease Dataset

25
Apple scab Apple black rot Cader apple Apple healthy Corn rust

Corn healthy Grape rot Grape Esca Grape blight Grape healthy

Potato Mold Tomato blight Tomato Mold Potato healthy Tomato spot

Tomato Bacterial Tomato healthy Tomato Two-spotted Tomato mosaic Tomato Spot
Figure 15. vegetable and fruits leaves with diseases

(1) The first step is to collect data. We are using the PlantVillage Dataset, which
is widelyavailable. This dataset was released by crowdAI.
(2) Pre-processing and Augmentation of the collected dataset is done using pre-
processingand Image-data generator API by Keras.
(3) Building CNN(Convolutional Neural Network) Model (Vgg-19
architecture) forclassification of various plant diseases.
(4) Developed model will be deployed on the Android Application with help of
TensorFlowlite.

26
9.1 FLOW DIAGRAM :

Figure 16. Flow diagram

27
CHAPTER 10

TRAINING MODEL

Figure 17. Training Model

28
Contain Total 1500 dataset images are divided into two parts 1200 are in training
part and300 is the testing part.

29
30
31
Figure 18. CNN Model

32
CHAPTER 11

FEASIBILITY STUDY

The feasibility of the project is analyzed in this phase and business


proposal is put forth with a very general plan for the project and some
costestimates. During system analysis the feasibility study of the proposed
system isto be carried out. This is to ensure that the proposed system is not a
burden to thecompany. For feasibility analysis, some understanding of the major
requirementsfor the system is essential.

Three key considerations involved in the feasibility analysis,

1.Economical Feasibility
2.Technical Feasibility
3.Social Feasibility

11.1 ECONOMICAL FEASIBILITY :


This study is carried out to check the economic impact that the system
willhave onthe organization. The amount of fund that the company can pour
into the researchand development of the system is limited. The expenditures
must be justified. Thus the developed system as well within the budget and this
was achieved because most of the technologies used are freely available. Only
the customized products had to be purchased.

11.2 TECHNICAL FEASIBILITY :


This study is carried out to check the technical feasibility, that is, the
technical requirements of the system. Any system developed must not have a
high demand on the available technical resources. This will lead to high demands
on the available technical resources. This will lead to high demands being placed
on the client. Thedeveloped system must have a modest requirement, as only
minimal or null changes are required for implementing this system.
33
11.3 SOCIAL FEASIBILITY :
The aspect of study is to check the level of acceptance of the system by
the user. Thisincludes the process of training the user to use the system efficiently.
The user must not feel threatened by the system, instead must accept it as a
necessity. Thelevel of acceptance by the users solely depends on the methods
that are employedto educate the user about the system and to make him familiar
with it. His level ofconfidence must be raised so that he is also able to make
some constructive criticism, which is welcomed, as he is the final user of
the system.

34
CHAPTER 12
RESULT

A 95.6% accuracy rate was achieved using early stopping while Training
the model on 50 epochs. Figure 7 depicts the visualization of training and
validation accuracy. The result of detecting and recognizing a strawberry plant
is shown in Figure 8. On the left, a healthy plantleaf, and on the right, a sick
infected plant. The result of detecting and recognizing a potato plant is shown
in Figure 9. On the left,a healthy plant leaf, and on the right, a sick infected
plant.

35
SAMPLE CODE :

import pandas
as pd import
numpy as np
import scipy
import matplotlib.pyplot
as pltimport tensorflow as
tf
import seaborn as sns
from tensorflow.keras.layers import *
from tensorflow.keras.models import
*
from tensorflow.keras.preprocessing import image
from flask import Flask
#import numpy
as np#import os
#from tensorflow.keras.preprocessing.image import load_img
#from tensorflow.keras.models import load_model
#filepath =
'C:/Users/preth/Documents/Training'#model
= load_model(filepath)
#print(model)

model = Sequential() ## creating a blank model


model.add(Conv2D(32,kernel_size=(3,3),activation='relu',input_shape=(224,224,
3)))
model.add(MaxPooling2D(pool_size=(2,2)))
model.add(Conv2D(64,(3,3),activation='relu'))

36
model.add(MaxPooling2D(pool_size=(2,2)))
model.add(Conv2D(128,(3,3),activation='relu'))
model.add(MaxPooling2D(pool_size=(2,2)))

model.add(Conv2D(256,(3,3),activation='relu'))
model.add(MaxPooling2D(pool_size=(2,2)))
model.add(Dropout(0.25)) ### reduce the
overfitting

model.add(Flatten()) ### input layer


model.add(Dense(256,activation='relu')) ## hidden
layer of annmodel.add(Dropout(0.5))
model.add(Dense(512,activation='relu')) ## hidden
layer of annmodel.add(Dropout(0.5))
model.add(Dense(4,activation='softmax')) ##
output layer
model.compile(loss='categorical_crossentropy',optimizer='adam',metrics=['acc
uracy'])
model.summary()

#Moulding train images


train_datagen = image.ImageDataGenerator(rescale = 1./255, shear_range =
0.2,zoom_range = 0.2, horizontal_flip = True)

test_dataset = image.ImageDataGenerator(rescale=1./255)
train_generator =
train_datagen.flow_from_directory('C:/Users/preth/Desktop/t
raining', #'C:/Users/preth/Desktop/plant disease/training',
target_size = (224,224),batch_size = 15, class_mode =
'categorical')

37
validation_generator = test_dataset.flow_from_directory(
'C:/Users/preth/Documents/Testing',
target_size = (224,224),

batch_size = 15,
class_mode =
'categorical')
#### Train the
modelhistory =
model.fit(
train_generator,
steps_per_epoch = 7,
epochs = 2,
validation_data = validation_generator)

print("Training Ended")

print("Accuracy score is:")


print(model.evaluate_generator(validation_generator
))

plt.figure(figsize=(20,10))
plt.subplot(1, 2, 1)
plt.suptitle('Optimizer : Adam', fontsize=10)
plt.ylabel('Loss', fontsize=16)
plt.plot(history.history['loss'], label='Training Loss')
plt.plot(history.history['val_loss'], label='Validation
Loss')plt.legend(loc='upper right')

plt.subplot(1, 2, 2)
38
plt.ylabel('Accuracy',
fontsize=16)
plt.plot(history.history['accuracy'], label='Training Accuracy')
plt.plot(history.history['val_accuracy'], label='Validation Accuracy')
plt.legend(loc='lower right')
plt.show()

39
CHAPTER 13
FUTURE SCOPE

13.1 FUTURE SCOPE :

 The forecasting of disease in early stage, so that appropriate measures can be taken
to minimize the loss in crops.
 Recommendations of chemicals and their ratio to convert the further spread of
disease on the different parts of plants after the proper identification of diseases.
 Other than plant leaf disease identification, it can also be used for identification
and classification of nutrients deficiency of plant leaves.
 Creating and training a CNN model can be used to detect the classification of other
plat disease too, by simply training the model using respected datasets.

40
CHAPTER 14
REFERENCES

[1] Robert G. de Luna, Elmer P. Dadios, Argel A. Bandala, “Automated Image

Capturing System for Deep Learning-based Tomato Plant Leaf Disease


Detection and Recognition,” International Conference on Advances in Big Data,
Computing and Data Communication Systems (icABCD) 2019.

[2] Suma VR Amog Shetty, Rishab F Tated, Sunku Rohan, Triveni S Pujar, “CNN

based Leaf Disease Identification and Remedy Recommendation System,” IEEE


conference paper2019.

[3] Peng Jiang, Yuehan Chen, Bin Liu, Dongjian He, Chunquan Liang, “Real-Time

Detection of Apple Leaf Diseases Using Deep Learning Approach Based on


Improved Convolution Neural Networks,” IEEE ACCESS 2019.

[4] Geetharamani, Arun Pandian, “Identification of plant leaf diseases using a nine-

layer deep convolution neural network,” Computers and Electrical Engineering


76 (2019).

[5] Omkar Kulkarni, “Crop Disease Detection Using Deep Learning,” IEEE access
2018.

[6] Abirami Devaraj, Karunya Rathan, Sarvepalli Jaahnavi and K Indira,

“Identification of Plant Disease using Image Processing Technique,”


International Conference onCommunication and Signal Processing, IEEE 2019.

[7] Velamakanni Sahithya, Brahmadevara Saivihari, Vellanki Krishna Vamsi,

Parvathreddy Sandeep Reddy and Karthigha Balamurugan, “GUI based

41
Detection of Unhealthy Leaves using Image Processing Techniques,”
International Conference on Communication and Signal Processing 2019.

[8] Balakrishna K Mahesh Rao, “Tomato Plant Leaves Disease Classification Using

KNN and PNN,” International Journal of Computer Vision and Image Processing
2019.

[9] Masum Aliyu Muhammad Abdu, Musa Mohd Mokji, Usman Ullah Sheikh,
Kamal
Khalil, “Automatic Disease Symptoms Segmentation Optimized for
Dissimilarity Feature extraction in Digital Photographs of Plant Leaves,” IEEE
15th International Colloquium on Signal Processing & its Applications 2019.

https://data.mendeley.com/datasets/tywbtsjrjv/1.Retrieved,
http://dx.doi.org/10.17632/tywbtsjrjv.

42
PAPER PUBLICATION CERTIFICATE

43

You might also like