A Deep Learning Method for Plant Disease Diagnosis and Detection in Smart Agriculture

AakashRoy30 297 views 40 slides May 26, 2024
Slide 1
Slide 1 of 40
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40

About This Presentation

Creating and training a CNN model from scratch is a tedious process, this model can be used to detect and classification of other plant disease too, by simply training the model using respected datasets


Slide Content

DEPARTMENT OF COMPUTER SCIENCE
“A Deep Learning Method for Plant Disease Diagnosis and Detection in
Smart Agriculture”
Presented by
Aakash Roy
M.TECH(CSE)
BABASAHEB BHIMRAO AMBEDKAR UNIVERSITY, LUCKNOW
Under the Supervision of
Prof. Sanjay K. Dwivedi
Department of Computer Science

Introduction
Types of pathogens
Types of Plant Disease
Cause of Plant disease
Pesticides Used
Literature Review
Flow Chart of Plant Disease Detection
Proposed Methodology
Necessary Libraries
Datasets
Convolutional Neural Networks
Performance Evaluation
Web Application Interface
Results and Discussion
Conclusions and future scope
References
CONTENTS

INTRODUCTION
Diseases found in agricultural crops is a major threat that cause production and economic losses
as well as reduction in both quality and quantity of agricultural products.
In India 70% of population depend on agriculture and contributes 17% towards the GDP of
country.
Farmers experience great difficulties in switching from one disease control policy to another.
The naked eye observation of experts is the traditional approach, this method can be time
consuming, expensive and inaccurate.
The crop losses can be minimized by applying pesticides or its equivalent to combat the effect
of specific pathogens, if diseases are correctly diagnosed and identified early.

How will it help ?
Identify the type of plant
Identify if the plant has the disease
In case the leaves are affected by the disease, classify the disease

Types of pathogens
Types of Pathogens
that affects crops
Bacteria
Virus
Fungus

Type of plant disease
Therearesomanydifferenttypeofplantdiseasesaretherebutthesearethemostcommonplantdiseases
arefollowingas
1)Fungaldiseasesignsandsymptom:
Fungusbelongstoeukaryoticmemberthatincludesmicroorganism
suchasyeastandmolds.Fungaldiseasesinplantscanmanifestthrough
varioussignsandsymptoms.Theseincludeleafspots,wheresmall,
darkspotsappearonleaves,oftensurroundedbyayellowhalo.Wilting
andleafcurlingcanalsooccur,indicatingdamagetotheplant's
vascularsystem.Powderyordownymildewmaycoverleaveswitha
whiteorgrayishpowderorfuzz.
Leaf rust (common leaf rust in corn)
Stem rust (wheat stem rust)
Sclerotinia (white mold)
Powdery mildew.

Continued..
2)Bacterialdisease:
Bacteriaarethemicroscopiccreatureswhichcomeunder
prokaryoticorganism.Theycanbefoundeverywhere
causingdiseaseandspreadingamongthemassesbacteria
aretheamongthefirsttocomeonthisearth.
Bacterialooze
Water-soakedlesions
Bacterialstreaminginwaterfromacutstem

Continued..
3)Viraldiseasesymptoms:
Virusisaunicellularmicroorganism,Viraldiseasesinplantsoften
resultinsymptomssuchasmosaicpatternsonleaves,whereareas
oflightanddarkgreenalternate.Leafcurlingordistortioncan
occur,aswellasstuntedgrowth.Yellowingofleaves,knownas
chlorosis,isalsocommon.Thesesymptomscanvarydependingon
thespecificvirusandplantspeciesinvolved.
Mosaicleafpattern
Crinkledleaves
Yellowedleaves
Plantstunting

Causes of Plant diseases
Biotic Factors Abiotic factors
Fungi Nutritional abnormalities
Bacteria Pesticides Exposure
Virus Environmental pollutants
Nematodes Extreme weather conditions
Insects and Pests High/low soil moisture
Parasitic plants Chemical Factors

Types of Pesticides are used to protect our plant
1.Insecticides –insects
2.Herbicides –plants
3.Rodenticides –rodents (rats & mice)
4.Bactericides –bacteria
5.Fungicides –fungi
6.Larvicides–larvae

Approaches used to control different diseases:
(1)
Regular survey of
Experts
(2)
Spray after passing
certain time limit
(3)
Naked Eye Survey
of Farmer
(4)
Used of Different
Image Processing
Techniques’
(5)
Use of AI and
Machine Leaning in
Agriculture

Literature Review
References Method Performance Advantage Limitations
[1] The architectures evaluated include
VGG 16, Inception V4, ResNetwith
50, 101 and 152 layers and DenseNets
with 121 layers
Accuracy = 99.75%DenseNetshas consistently improved
with growing number of epochs with
no signs of overfitting
DenseNetsrequires a considerably less
number of parameters and reasonable
computing timetoachieve state-of-the-
art performances
[2] Intel Movidius Neural Compute Stick
consisting dedicated CNN hardware
blocks
Accuracy = 88.46%This model is capable of running on
standalone smart devices like
raspberry-pi or smartphone and drones
Results are reported for a small dataset
[3] Several CNN based architecture were
trained
Accuracy = 99.53%High success rate makes the model a
very useful advisory or early warning
tool in real cultivation conditions
This method suffers from a high
computational cost
[4] The VGGNetpre-trained on ImageNet
and Inception module are selected in
this approach
Accuracy = 91.83%More accurate performance than the
state of the art methods
This method is suffering from the
problem of over-fitting for a large-size
dataset
[5] A framework named k-FLBPCM along
with SVM was used for crop disease
classification
Accuracy = 98.63%The work assisted to enhance
classification accuracy for plants with
similar morphological textures
Detection accuracy degrades for the
distorted samples
[6] The DLQP approach with the SVM
classifier was introduced to categorize
the various plant diseases
Accuracy = 96.53%This work is robust to detect the plant
leaf disease classification under
intense scale and angle variations in
input samples
Classification performance needs further
improvements

Flowchart of Plant Disease Detection

Proposed Methodology
ImageAcquisition:Collectadiversesetofhigh-qualityimagesofhealthyanddiseasedplants.Ensurethe
datasetincludesvariousplantspeciesanddiseasetypestobuildarobustmodel.Sourcescanincludeonline
databases,agriculturalresearchinstitutions,andfieldphotography.
Imagepreprocessing:Preprocessthecollectedimagestoensureconsistencyandenhancemodel
performance.Keystepsinclude:
Resizing:Standardizeimagedimensions(e.g.,128x128pixels)tomatchtheinputrequirementsoftheneural
network.
Normalization:Scalepixelvaluestoarangeof0-1or-1to1forfasterconvergence.
DataAugmentation:Applytransformations(e.g.,rotation,flipping,zooming,shifting)toincreasedataset
diversityandpreventoverfitting.
ModelArchitecture:
ConvolutionalNeuralNetwork(CNN):DesignaCNNmodeltailoredforimageclassification.
Commonlayersincludeconvolutionallayersforfeatureextraction,poolinglayersfordimensionality
reduction,dropoutlayersforregularization,andfullyconnectedlayersforclassification.

Necessary Libraries…
TensorFlowTensorFlowisanopen-sourcedeeplearningframeworkwhichisdevelopedbyGoogle.Itprovidestoolsfor
trainingandbuildingdeeplearningmodels,includingconvolutionalneuralnetworks(CNNs)commonlyusedin
imagevisualizationtasks.
NumPy NumPyisalibraryinpythonprogramminglanguagethathelpsinmanagelargeamountofmultidimensional
matricesandarrays.NumPyalsoenablestheoperationofmathematicalfunctionswhichiscreatedonarraysor
matrices.
Cv2 Cv2isanopensourcemachinelearninglibraryandcomputervisionthatisusedtosolvethecomputervision
problemssuchasreadingorimageresizing.
Sklearn Sklearnisanopensourcemachinelearninglibrarythatincludesregressionalgorithmsandvariousclassification
suchas,randomforestsK-nearestNeighbors,Supportvectormachines,etc.
Keras Kerasisanopensourceneuralnetworklibrarythatisdefinedtoenabletherapidimplementationofdeepneural
networkswithinpythoninterfaceitself.
MatplotlibMatplotlibisaplottinglibrarywhichisusedinpythonforcreatingstaticandanimatedvisualizations.

DATASET(New Plant Disease Dataset)..
The Dataset collected from open source website “Kaggle”.
The Dataset contains 87k image samples of 14 crops.
The dataset consists of 38 classes corresponding to 38 leaf diseases of 14 crops.
the 38 disease are listed bellow and their corresponding images.
(1)Apple_scab,(2)Apple_Black_rot,(3)Apple_Cedar_apple_rust,(4)Apple_healthy,(5)Blueberry_healthy,
(6)Cherry(including_sour)_Powdery_mildew,(7)Cherry(including_sour)_healthy,(8)Corn(maize)_Cercospora_le
af_spot_Gray_leaf_spot,(9)Corn(maize)_Common_rust,(10)Corn(maize)_Northern_Leaf_Blight,(11)Corn_(mai
ze)_healthy,(12)Grape_Black_rot,(13)Grape_Esca(Black_Measles),(14)Grape_Leaf_blight(Isariopsis_Leaf_Spo
t),(15)Grape_healthy,(16)Orange_Haunglongbing(Citrus_greening),(17)Peach_Bacterial_spot,(18)Peach_health
y,(19)Pepper_bell_Bacterial_spot,(20)Pepper_bell_healthy,(21)Potato_Early_blight,(22)Potato_Late_blight,(23)
Potato_healthy,(24)Raspberry_healthy,(25)Soybean_healthy,(26)Squash_Powdery_mildew,(27)Strawberry_Leaf
_scorch,(28)Strawberry_healthy,(29)Tomato_Bacterial_spot,(30)Tomato_Early_blight,(31)Tomato_Late_blight,
(32)Tomato_Leaf_Mold,(33)Tomato_Septoria_leaf_spot,(34)Tomato_Two_spotted_spider_mite,(35)Tomato_Ta
rget_Spot,(36)Tomato_Yellow_Leaf_Curl_Virus,(37)Tomato_mosaic_virus,(38)Tomato_healthy.

Continued..

Offlineaugmentationisusedtorecreatethisdatasetfromtheoriginaldataset.
"https://www.kaggle.com/datasets/vipoooool/new-plant-diseases-dataset"isthelinktothe
originaldataset.Thisdataset,whichisdividedinto38classes,includesover87Krgbphotosof
bothhealthyanddamagedcropleaves.Theentiredatasetissplitupintotrainingand
validationsetsinan80/20ratiowhilemaintainingthedirectorystructure.Forprediction
purposes,anewdirectorywith33testphotosislaterestablished.
Paper Bell Healthy Leaf examples

Tomato target Spot images after processing
DataSets

Data Processing
38 Classes
Total data: 87,867
Training data: 80% (70,295)
Validation Data: 20% (17,572)
Resized Image size: 128 x 128 pixels.
Converted to rgb.

Convolutional Neural Networks
ConvolutionalNeuralNetworks(CNNs)aredeeplearningmodelsdesignedforimageprocessing.Theyuse
convolutionallayerstodetectfeatures,poolinglayerstoreducedimensions,andactivationfunctionslike
ReLUfornon-linearity.Visualizationtechniquessuchasactivationmaps,filters,andClassActivationMaps
(CAM)helpinterpretandunderstandthemodel'slearnedfeatures.
For each Filter we are creating a separate
Feature, Our data size increases
Extracting important
feature, Decreasing
the size of image
Flattening and
feeding to our NN

Types of CNN layer
Convolution layer (CONV):
The convolution layer (CONV) uses filters that perform convolution operations as it is scanning the
inputIwith respect to its dimensions. Its hyperparameters include the filter sizeFand strideS. The
resulting outputOis calledfeature maporactivation map.
.
Filter, kernel size(3*3)
Feature Map

Continued..
Type Max pooling Average pooling
Purpose
Each pooling operation selects the maximum
value of the current view
Each pooling operation averages the values of the
current view
Illustration
Comments
• Preserves detected features
• Most commonly used
• Down samples feature map
• Used in LeNet
•Pooling (POOL):
Thepoolinglayer(POOL)isadownsamplingoperation,typicallyappliedafteraconvolutionlayer,which
doessomespatialinvariance.Inparticular,maxandaveragepoolingarespecialkindsofpoolingwherethe
maximumandaveragevalueistaken,respectively.
Pool size= 2
Stride=movement of sliding Window(2*2)

Continued..
•Fully Connected (FC):
Thefullyconnectedlayer(FC)operatesonaflattenedinputwhereeachinputisconnectedtoall
neurons.Ifpresent,FClayersareusuallyfoundtowardstheendofCNNarchitecturesandcanbeusedto
optimizeobjectivessuchasclassscores.
Dense Layer or
Hidden Layer
Output Layer
Flattened

Simple CNN architecture

Our Proposed Model
Our model have following number of layers:
5 convolution, 5 max pooling, 2 dropout, 1 flatten, 2 dense
IMAGE
128×128×3
Dense Layer
1500 UNIT
.
Dense(OUTP
UT)LAYER
38 UNITS
.

Componentinvolvedintraining:
Eachelementplaysasignificantroleinshapingthemodel'sperformanceandgeneralizationcapabilities.Properly
configuringtheseparametershelpspreventoverfitting,acceleratesconvergence,andensuresrobustevaluation.A
well-tunedmodelcanaccuratelydiagnoseplantdiseases,enhancingagriculturalpracticesandplanthealth
management.Theseconceptsempowersresearchersandpractitionerstodevelopsophisticatedsolutionsforcomplex
real-worldproblems.
Input image 128*128*3
Pooling Max Pooling
Dropout 40%
Normalization Batch Normalization
Optimizer Adam
Learning rate 0.0001
Loss Categorical cross entropy
Metrics Accuracy
Epochs 10

Performance Evaluation
Fig. (a) Training and validation accuracy, (b) Training and validation loss.
10

Continued..

CLASSIFICATION REPORT

Confusion Matrix
The confusion matrix is a table that is often used to describe the performance of a classification model
on a set of test data for which the true values are known. It allows the visualization of the performance
of an algorithm.
In a confusion matrix, which is a common tool for evaluating the performance of classification models, the
x-axis represents the predicted labels or classes, and the y-axis represents the actual labels or classes.


Figure 7. Confusion Matrix

Architecture: Plant Disease Detection Using Tensorflow
Backend

WEB APPLICATION INTERFACE
Web application interface: Home Page

Continued..
Web application interface: After uploading leaf image with the identified disease

SYSTEM REQUIRMENTS
HARDWARE REQURMENTS
•Pc with core i7 processor
•8GB RAM or above
•300GB hard disk or above
•2GB graphic card or above
SOFTWAREREQUIREMENTS
•Windows 10
•Python 3.7
•Anaconda (Jupyter)
•Python Packages

Inthiswork,Themodelthatbesthandlesthecomplexitiesoftheenvironmentmayyieldreliable
identifications.
Therearechallengestobeovercome,butthedeeplearning-basedplantdiseasedetectionmodel
proposedinthisstudyhasthepotentialtoreduceenvironmentalcomplexityandimprove
detectionperformance.
Infuturestudies,wecanplantodevelopanewneuralnetworktogeneratezero-havingstarted
setsthatareappropriateforthevariousleaves.Thiswillallowustoshortenthetrainingtime,
increasethetransferlearningmodel'sendofcalculationthreshold,andfinishtheiterationsooner
Conclusions

Future scope
The forecasting of disease diseases in early stage, so that appropriate measures can be
taken to minimize the loss in crops.
Our project have shown pretty good accuracy, it can be implemented in real time mobile
applications and web services, so that farmers can identify diseases simply by taking
photo of suspected leaves of plants.
Recommendation of chemicals and their ratio to control the further spread of diseases 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 from scratch is a tedious process, this model can be
used to detect and classification of other plant disease too, by simply training the model
using respected datasets.

REFERENCES
[1]S.S.Harakannanavar,J.M.Rudagi,V.I.Puranikmath,A.Siddiqua,andR.Pramodhini,“PlantLeafDisease
DetectionusingComputerVisionandMachineLearningAlgorithms,”Glob.TransitionsProc.,2022,doi:
10.1016/j.gltp.2022.03.016.
[2]A.S.Zamanietal.,“PerformanceofMachineLearningandImageProcessinginPlantLeafDiseaseDetection,”vol.
2022,pp.1–7,2022.
[3]A.K.Singh,S.V.N.Sreenivasu,U.S.B.K.Mahalaxmi,H.Sharma,D.D.Patil,andE.Asenso,“HybridFeature-
BasedDiseaseDetectioninPlantLeafUsingConvolutionalNeuralNetwork,BayesianOptimizedSVM,andRandom
ForestClassifier,”J.FoodQual.,vol.2022,2022,doi:10.1155/2022/2845320.
[4]Y.He,Q.Gao,andZ.Ma,“ACropLeafDiseaseImageRecognitionMethodBasedonBilinearResidualNetworks,”
vol.2022,2022.
[5]K.L.Narayananetal.,“BananaPlantDiseaseClassificationUsingHybridConvolutionalNeuralNetwork,”Comput.
Intell.Neurosci.,vol.2022,2022,doi:10.1155/2022/9153699.
[6]L.Li,S.Zhang,andB.Wang,“PlantDiseaseDetectionandClassificationbyDeepLearning-AReview,”IEEE
Access,vol.9,no.Ccv,pp.56683–56698,2021,doi:10.1109/ACCESS.2021.3069646.

Thankyou
Tags