Nothing Special   »   [go: up one dir, main page]

Leaf Disease Detection7

Download as pdf or txt
Download as pdf or txt
You are on page 1of 69

A Major Project Report On

LEAF DISEASE DETECTION USING MATLAB


Submitted for partial fulfilment of the requirements for the award of the degree

Of

BACHELOR OF TECHNOLOGY
IN

Electronics and Communication Engineering


BY

Ms. P. Akhila (20641A0424)


Mr. G. Sadeep Kumar (20641A0455)
Mr. CH. Uday Sai (20641A0441)
Mr. CH. Rahul (20641A0439)

Under the guidance of

Mr. G. BABU
Associate professor

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

VAAGDEVI COLLEGE OF ENGINEERING


(Autonomous, Affiliated to JNTUH, NAAC ‘A’ Grade and NBA Accredited )
BOLLIKUNTA, WARANGAL – 506 005
2023 – 2024
DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

VAAGDEVI COLLEGE OF ENGINEERING


(Autonomous, Affiliated to JNTUH, NAAC ‘A’ Grade and NBA Accredited)
BOLLIKUNTA, WARANGAL – 506 005
2023 – 2024

CERTIFICATE

This is to certify that the project work entitled “Leaf Disease Detection Using MATLAB”
is a Bonafide work carried out by Ms. P.Akhila (20641A0424) in partial fulfilment of the
requirements for the award of degree of Bachelor of Technology in Electronics &
Communication Engineering from Vaagdevi College of Engineering, (Autonomous)
during the academic year 2023-2024.

Mr. G. Babu Dr. M. Shashidhar

Project guide Head of the Department

Associate professor
DECLARATION

I declare that the work reported in the project entitled “Leaf Disease Detection Using
MATLAB” is a record of work done by us in the partial fulillment for the award of the
degree of Bachelor of Technology in Electronics & Communication Engineering,
VAAGDEVI COLLEGE OF ENGINEERING (Autonomous), Affiliated to JNTUH,
Accredited By NBA, under the guidance of Mr. G. BABU, Associate professor, ECE
Department, I hereby declare that this project work bears no resemblance to any other
project submitted at Vaagdevi College of Engineering or any other university/college for
the award of the degree.

Ms. P. Akhila(20641A0424)
Mr. G. Sandeep Kumar(20641A0455)
Mr. CH. Uday Sai(20641A0441)
Mr. CH. Rahul(20641A0439)
ACKNOWLEDGEMENT

The development of the project in Mini project (VII Semester) though it was an arduous
task, it has been made by the help of many people. I am pleased to express our thanks to
the people whose suggestions, comments, criticisms greatly encouraged us in betterment
of the project.

I would like to express my sincere gratitude and indebtedness to our project guide
Mr. G. Babu, Associate professor, for him valuable suggestions and interest throughout
the course of this project.

I would like to express my sincere thanks and profound gratitude to Dr. K. Prakash,
principal of Vaagdevi College of Engineering, for his support, guidance and
encouragement in the course of our project.

I am also thankful to the Head of the Department Dr. M. Shashidhar, Professor for
providing excellent infrastructure and a nice atmosphere for completing this project
successfully.

I am highly thankful to the project coordinators for their valuable suggestions,


encouragement and motivations for completing this project successfully.

I am thankful to all other faculty members for their encouragement.


I convey my heartfelt thanks to the lab staff for allowing me to use the required equipment
whenever needed.

Finally, I would like to take this opportunity to thank my family for their support through
the work. I sincerely acknowledge and thank all those who gave directly or indirectly their
support in completion of this work.
Ms. P. Akhila(20641A0424)
Mr. G. Sadeep Kumar(20641A0455)
Mr. CH. Uday Sai(20641A0441)
Mr. CH. Rahul(20641A0439)
TABLE OF CONTENTS
PG NO

CHAPTER 1

INTRODUCTION
1.1 Objectives 01

1.2 Problem specification 02

1.3 Methodology 3-7

CHAPTER 2

LITERATURE SURVEY 8 - 10

CHAPTER 3

PROBLEM SPECIFICATION 11 - 12

CHAPTER 4

SYSTEM DESIGN 13 - 18

CHAPTER 5

IMPLEMENTATION

5.1 Introduction to MATLAB 19

5.2 Image enhancement 20 - 21

5.3 Algorithm 22

5.4 Performance evaluation parameters 23


5.5 Methodology 24 - 30

5.6 System architecture 31 – 44

5.7 Detail description of each module 44 - 46

CHAPTER 6

TESTING

6.1 Testing purpose 47

6.2 Unit Testing 48

6.3 Regression testing 48

6.4 Stress testing 49

CHAPTER 7

SNAPSHOTS 50 - 56

CHAPTER 8

CONCLUSION 57 - 58

CHAPTER 9

BIBLIOGRAPHY 59 - 60
ABSTRACT

The increasing importance of precision agriculture, the development of automated


system for crop health monitoring has become a critical area of research. This paper presents
an innovative approach for the early detection of leaf diseases in plants using image
processing techniques implemented in MATLAB. The proposed system aims to provide
farmers and agricultural practitioners with a reliable tool to identify and mitigate potential
threats to crop yield caused by diseases. The methodology involves the acquisition of high-
resolution images of plant leaves, followed by a series of preprocessing steps to enhance
image quality and remove noise. Feature extraction techniques are then applied to capture
distinctive patterns and characteristics associated with healthy and diseased leaves. Machine
learning algorithms, integrated into the MATLAB environment, are employed for the
classification of leaves into different disease categories. In conclusion, the proposed leaf
disease detection system offers a cost-effective, non-invasive, and timely solution for
identifying and managing plant diseases.
As agriculture increasingly embraces technology, this system stands at the forefront
Advancements in crop health monitoring, contributing to the overall goal of ensuring food
security in an ever-changing agricultural landscape. The MATLAB image processing starts
with capturing of digital high resolution images. Healthy and unhealthy images are captured
and stored for experiment. Then images are applied for pre-processing for image
enhancement. Captured leaf & fruit images are segmented using k-means clustering method
to form clusters. Features are extracted before applying K-means and SVM algorithm for
training and classification. Finally diseases are recognized by this system. In this paper
section 1 gives an introduction and importance of plant disease detection. Section 2 gives a
brief literature review of leaf & fruit disease detection techniques.
LIST OF FIGURES Pg No.

Support Vector Machine 6


Clustering process 15
Architectural diagram of proposed system 31
Use case diagram of recognition and classification 33
Pre-processing of input image 34
Segmentation of binary image 35
Feature extraction of segmented image 36
Obtaining support vector from GLCM values 39
Green color hyperplane 41
Finding optimal hyperplane 42
Result 56

LIST OF FLOWCHARTS Pg No
Steps in digital image 4
System flow chart 16
System architecture 18
Algorithm flow 22
Flow chart of proposed system 43
CHAPTER 1
INTRODUCTION

1.1 OBJECTIVES

1. To detect leaf disease portion from image.

2. To extract features of detected portion of leaf.

3. To recognize detected portion of leaf through SVM.

4. Leaf in Image

Two types of leaf (Healthy and Unhealthy)

5. Why leaf disease detection recognition?

1. Agriculture research

2.Image retrieval

3.Digitalize the farmers

4.Increase production of crops

6. MATLAB’S versatility enables researchers to develop sophisticated algorithms for

automated disease identification, making it powerful tool in precision agriculture.

This technology helps farmers detect disease early for crop protection.

1
1.2 PROBLEM SPECIFICATIONS

The problem specifications for leaf disease detection using MATLAB typically include:
Image Acquisition: Obtain a dataset of high-resolution images containing healthy leaves
and leaves affected by various diseases. These images should cover different plant species,
growth stages, and environmental conditions.
Image Preprocessing: Clean and enhance the acquired images to remove noise, normalize
lighting conditions, and improve contrast. Preprocessing techniques may include filtering,
thresholding, and morphological operations.
Feature Extraction: Identify informative features from the preprocessed images that can
effectively distinguish between healthy and diseased leaves. Features may include color
histograms, texture descriptors, shape characteristics, and vein patterns developing an
automatic certificate generation system using MATLAB presents several challenges that
need careful consideration. Key issues include the need for robust user input validation to
prevent errors in certificates arising from inaccurate or incomplete data.
Classification Algorithm: Develop a robust classification algorithm to automatically
classify leaves into healthy or diseased categories based on the extracted features. Common
classification techniques include support vector machines (SVM), artificial neural networks
(ANN), decision trees, and k-nearest neighbors (k-NN).
Model Training and Validation: Split the dataset into training and validation sets to train
the classification model. Utilize cross-validation techniques to assess the model's
performance and ensure its generalization to unseen data.
Performance Evaluation: Evaluate the performance of the classification model using
metrics such as accuracy, precision, recall, F1 score, and receiver operating characteristic
(ROC) curve analysis.
Deployment and Integration: Implement the trained classification model into a practical
application or system for real-time leaf disease detection. This may involve integrating the
MATLAB-based detection system with other hardware or software components, such as
cameras, drones, or agricultural machinery.

2
1.3 METHODOLOGY

For recognition and order of plant maladies is utilized a picture handling strategy. The
general idea for any vision related calculation of picture grouping is nearly the same and
appeared in figure 1.6. To start with, the advanced pictures are obtained from the earth
utilizing a computerized camera. At that point picture preparing systems are connected to the
procured pictures to separate valuable highlights that fundamentalfor encourage investigation.
After that Support Vector Machine (SVM) method is utilized for the grouping according to
particularissue. The well ordered procedure is as demonstrated as follows:
1. RGB picture procurement

2. Change over the information picture into shading space

3. Registering the shading highlights

The techniques as takes after well ordered as takes after:


Image Acquisition: Picture procurement is a vital advance. These images are obtainedby
utilizing the distinctive computerized system. Here, the system, computerized scanners is
utilized to catch pictures. Then for investigation of illness on the leaves better nature of pictures
is required and picture store is required.

Picture Pre-handling: picture procurement and making the picture storage, the following
stage is for picture pre-handling. To secure unique picture in that the information picture pre-
handling step is an exceptionally productive task. The pre- preparing of pictures uses stifle not
desired bending of all pictures and upgrade few picture highlights critical for additionally
handling and investigation assignment. In picture pre-handling step it incorporates shading
space change, picture improvement, and picture division. The gained picture will have some
picture organize. This picture is changed as RGB arrange. RGB pictures of plant leaves are
changed over as shading space portrayal. All RGB images of the plant leaves are changed
overas the Hue Saturation Value (HSV) image arrange.

3
Fig 1.1 Steps in Digital Image Processing

HUE – It is a shading property that portrays unadulterated shading as apparent by an


eyewitness.
Absorption – Immersion named as relative perfection or the measure of white light added to
HUE.
Rate – This implies sufficiency of light.
After the shading place change process, tone part is utilized to encourage examination.
Immersion and esteem both are dropped, because it doesn't provide any additional data.

Properties Separation: This type of extraction is related to dimensionality diminishment.


Right when the data of a computation is excessively generous, making it impossible in any
capacity took care of and it is suspected to be overabundance then it can be changed into a
lessened course of action of features. In the examination of sick pictures, there is have to
remove the infections. All of this procedure is called as feature extraction. Separated
4
highlights are relied upon has the significant information from the info information, with the
goal which may coveted undertaking are done by using this diminished portrayal rather than
the total beginning data. This is utilized for highlight extraction which incorporates diverse
advances, for example, sifting, standardization, division and question ID. Highlight extraction
gives an arrangement of noteworthy districts and protests. There are three techniques for
include extraction which are generally utilized. These are as per the following:

1. Surface depend Highlight separation

2. Shape dependent absorption separation

3. Shading depend Highlight separation

that it utilizes just two surfaces.


4. Surface depend Highlight separation

5. Shading depend Highlight separation


Classification: The system of characterization is absolutely reliant on a question
acknowledgment method. There is a little distinction between picture handling and question
acknowledgment, picture preparing manages an alternate method which can enhance the
visual nature of the info picture, while protest acknowledgment manages depiction and
arrangement of the question. In the hypothetical approach, the example is spoken to in a
vector space so the

choice calculation (in light of a factual idea) is utilized to choose which class of example has
a place with SVM strategy, it can be extensively partitioned into traditional and neural system
approach. The traditional approach relies upon the insights of the information to be grouped.

Support Vector Machine: This is a non-straight analyser. One of the machine learning
calculations are utilized as a part of numerous example acknowledgment issues, including
surface characterization. In SVM, the information is non-straight mapped to directly isolated
information in some high dimensional space giving great grouping execution. SVM boosts
the peripheral separation between various classes. Separation of classes is finished with
different pieces. SVM expected to run with only two classes by choosing the subspace of
vector plane. This can be done by increasing the edge from the subspace vector plane of the
two classes. The illustrations closest to the edge that were chosen the hyper plane is known as

5
help vectors. Figure
1.7 shows that assistance vector machines thought. More class portrayal is moreover proper
and is on a very basic level created by various two classes SVM, either by using one-versus-
all or one-versus-one. The triumphant class is then controlled by the most astounding yield
work or the greatest votes individually as appeared in figure 1.7.

Fig 1.7 Support Vector Machine

SVM Analyser: A Bolster vector machine is an effective instrument for parallel grouping,
equipped for producing quick classifier work following a preparation period. There are a few
ways to deal with receiving SVMs to characterization issues with at least three classes. In
machine learning, reinforce Vector machines are overseen learning models with related
learning estimation that analyze data used for request and backslide examination. SVM are
characteristically two class classifiers. The customary method to do multiclass grouping with
SVMs is utilize one of the strategies. The classifier assessment comprise the yield esteem
higher than the limit region recorded as "genuine" and any SVM yield esteem lower than the
edge are recorded promotion "false". The SVM classifier comprises the double grouping of
pictures. In SVM, the information is non-straight mapped to directly isolated information in
some high dimensional space giving great grouping execution. SVM boosts the peripheral
separation between various classes. Separation of classes is finished with different pieces.
SVM expected to run with only two classes by choosing the subspace of vector plane.

6
1.3 Advantages and Disadvantages of SVM
Advantage:
 Its predication exactness is more

 SVM working is intense while planning cases contain goofs.

 Its basic geometric understanding and a meager arrangement.

 As like neural frameworks the calculation dispersed nature of SVMs


does not depend upon dimensionality of the information volume.

Disadvantages:
 This type of analyzer incorporates extended getting ready time.

 In SVM it is difficult to fathom the informed limit (loads).

 The far reaching number of assistance vectors used from the trainings set
to do portrayal undertaking.

7
CHAPTER 2
LITERATURE SURVEY

Describes the way to deal with keep the harvests from overwhelming misfortune via
watchful location of illness. In cotton, ailments in leaf are basic issue since it diminishes the
generation of cotton. The area of intrigue is leaf on the grounds that the vast majority of
maladies happen in leaf as it were. The infections that happen in cotton leaf are alternaria,
cercospora and red leaf spot. Histogram evening out is utilized to pre-process the info picture
to build the differentiation in low complexity picture, k-implies bunching calculation which
orders objects.Division depends on an arrangement of highlights that parcel the pre-processed
picture into number of classes, lastly order is performed utilizing neural-organize.
Depicts an approach is valuable in edit security particularly in extensive zone ranches, which
depends on mechanized systems that can recognize unhealthy leaves utilizing shading data of
clears out. The infection can be recognized by catching a picture of a specific plant leaf took
after by extricating highlight from the caught picture. To start with the caught RGB picture is
changed over to dim picture &then dim picture is resized and perform shrewd edge recognition,
apply different correlation strategies, which recognize the nearness of ailment and furthermore
the sort of infections . It empowers early control and security measures for particular illnesses.

Depicts a determination procedure that is generally visual and requires exact judgement
and furthermore logical techniques. Picture of infected leaf is caught .as the after effect of
division colour HSV highlights are removed. Counterfeit neural system (ANN) is then
prepared to recognize the sound and unhealthy examples. ANN characterization execution is
80% better in precision.

Describes the approach for location and calculation of surface data for plant leaf
infections. The preparing framework comprises of four primary advances, shading picture is
changed over to HSI, at that point the green pixels are covered and expelled utilizing
particular edge esteem, at that point the pre-handled picture is fragmented and the helpful
sections are removed, at last the surface data is acquired. The maladies exhibits on the plant
leaf are assessed in viewof the surface data.

8
Gives products answer for consequently recognize and group plant leaf malady. This
approach will expand efficiency of harvests. It incorporates a few stages that are picture
procurement, picture pre preparing and division, include extraction and characterization.

Portrays a framework comprises of four phases; the primary stage is the picture
improvement, which incorporates, histogram investigation, hsi upgrade and force
modification. Fuzzy c- implies calculation is utilized for division of caught picture. Shading,
state of spot, estimate is three highlights used to separate highlights from leaf. At that point
order depends on back spread based neural systems.

Give picture handling based arrangements that are programmed, modest, and precise.
Arrangement is made out of four primary strides; in the initial step the RGB leaf picture is
changed to other shading model. Next, in the second step, the changed pictures are fragmented
to get better data.t he k-implies bunching procedures utilized for sectioning the info picture.

Depicts the approach that has diverse advances. In initial step, for the most part green
hued pixels are distinguished. Next, in light of particular edge esteems green pixels are veiled.
Otsu's strategy processes edge an incentive to cover the green pixels. The other extra advance
is picture pixels that may have RGB esteems of ZERO then, pixels tainted group (protest)
total limit is expelled. The accuracy of this system for grouping infections is in the vicinity
of 83%and 94%.

Depicts the approach starts with catch of leaf the pictures from rural field. Gabor
channel is utilized fragment the information picture before highlight extraction. At that point
division of info picture is done to remove the surface data and shading highlights.
Appropriate determination of the component esteems to prepare manufactured neural
system to precisely recognize the sound and infected examples leaf accurately. Ann based
classifier has precision of 91%.

Identification of the plant sicknesses is the way to keeping the misfortunes in the yield
and amount of the rural item. The investigations of the plant maladies mean the investigations
of outwardly detectable examples seen on the plant. Wellbeing checking and malady
identification on plant is extremely basic for supportable horticulture. It is exceptionally hard
to screen the plant sicknesses physically. It requires huge measure of work, expertise in the

9
plant illnesses, and furthermore require the exorbitant preparing time. Henceforth, picture
handling is utilized for the discovery of plant infections. Illness discovery includes the means
like picture obtaining, picture pre-preparing, picture division, highlight extraction and order.
This paper talked about the strategies utilized for the recognition of plant illnesses utilizing
their leaves pictures.

Plant infections have transformed into a situation as it can cause huge decrease in both
quality and amount of rural items. Programmed discovery of plant infections is a fundamental
research point may exhibit benefits in watching considerable fields in products, along these
lines normally perceive the signs of diseases when they appear on leaf takes off. This
proposed framework is a product answer for programmed discovery and arrangement of plant
leaf maladies.

10
CHAPTER 3
PROBLEM DEFINITION

3.1 System Requirement Specification

Programming necessity particular is the announcement of what is expected of the


framework engineers. It ought to incorporate both the client prerequisites for a framework
and the point by point particular of the framework necessities. Programming framework
necessities are regularly delegated Functional and Non-Functional prerequisites. Useful
necessities are those that allude to the usefulness or administrations that framework is relied
upon to give. The Use Cases can be alluded as the utilitarian prerequisites. Non-useful
necessities are the imperativeson the administrations and capacities offered by framework.

Programming prerequisites is a sub-field of programming building that arrangement


with the elicitation, examination, determination, and approval of necessities for
programming. The product prerequisite particular report enrols every single essential
necessity for wander headway. To deduce the prerequisites always we require cautious and
clear understanding of the things to be delivered. These are all the set up after itemized
correspondences with venturegroup and the client.

Functional Requirements: Functional prerequisites characterize the inward workings of the


product: that is, the specific unpretentious components, controlling of data, dealing with
information then some specifichandiness which show how the utilization cases are to be
fulfilled. They are upheld by non- useful needs that may have constrained restrictions on layout.

Non-Functional Requirements: Non-functional prerequisites are necessities which


determine paradigm which could be used to judge the assignment of a system, rather than
specific practices. This should be diverged from useful necessities that indicate particular
conduct or capacities. Average no-practical necessities are unwavering quality, adaptability,
and cost. Non-pragmatic requirements are routinely named as the utilities of a structure.

Dependability: If any exemptions happen amid the execution of the product it ought to be
gotten and along these lines keep the framework from slamming.

11
Adaptability: The framework ought to be created such that new modules and functionalities
can be included, consequently encouraging framework advancement.

Cost: The cost ought to be low on the grounds that a free accessibility of programming bundle.

3.2 PROGRMMING REQUIREMENTS


Operating system: windows 8/ above
Languages: M-Scripting
Software: MATLAB 14a version

3.3 HARDWARE REQUIREMENTS


Processor: intel i5
Hard disk: 500GB
RAM: 8GB

12
CHAPTER 4
SYSTEM DESIGN

Design process is the portrayal of the framework, or a procedure of the creating a


model, which will be utilized to create or manufacture the framework. The contribution for the
outline procedure is the Software Requirement Specification (SRS) completely and the yield
is "Plan of the proposed framework". While SRS is completely in issue space, plan is the
initial phase in moving from the issue area. Configuration is basically a scaffold between the
Requirement Specification and the last answer for answer for fulfilling the necessities. A
System Design is a calendar or plans to build up another framework. The investigator
designs the information and the yield of the new framework, its coherent and physical gadgets
to get information, create data and store the outcomes. It determines how to meet the
necessities of the client as pointed out amid the System's Analysis Phase.

Programming Design lays on a specific area has item processing and is tuned giving
some values to enhancement of its uses. Once the product prerequisites are determined,
programming configuration is the first of the three exercises Design, Coding and Testing.

The outline procedure for the product frameworks often has two levels. At the principal
level the emphasis is on choosing which modules are required for the framework, the
determination of these modules, and how the modules will be interconnected. This is known
as the "Best level plan" and the name for the best level outline is "Framework Design". The
essential goal of the System Design is to look after productivity, cost, adaptability and
security of the framework.

Framework Design is where in the consideration and auxiliary parts of the framework
are outlined with an end goal to adjust the framework to the data prerequisites of the
association. Configuration is the initial phase in moving from area to arrangement space.

4.1 Data Flow Diagram: A Data flow diagram (DFD) is a graphics depiction of "data
stream" via an information structure. Information flow diagrams can be in this manner be used
tot he view of data getting ready (Modified plan). On a DFD, information things spill out of
an outer information source or an inside information store to inner data saved or outside

13
information drown, it means that interior streamline.

On a DFD, information things spill out of an outer information source or an inside information
store to inner data saved or outside information drown, it means that interior streamline.

DFD shares false information regard the arranging of methods, else whether procedure will use
neither in progression nor in parallel. So this is in the way exceptionally not exactly as a
flowchart, which shows the flood of control through an estimation, enabling the peruses the
picture out which activities should be used, in whatever arrange, and under which conditions,
however not what sorts of data can be contributed so yield takes the framework, nor where that
information shall originates and move for, nor to which place that information takes to put
away.

Information Flow Diagram is a designs device used to depict and break down the development
of information through a framework – manual or mechanized. They centre on the information
streaming into the framework between processes all through information stores.

Favourable circumstances of Data stream outlines:


 It helps in avoiding mistakes

 Clients can recommend alteration of DFD for more precision

 Straightforward documentations can be comprehended by the clients and itmainly


includes some of the steps are described below:
Image Acquisition: Image acquirement is an imperative progress. These pictures are
gotten by using the particular mechanized framework. In this framework, an automated
scanner utilizes to get pictures. To the examination that illness for a leaves, finer nature
of the pictures are wanted so picture database is required
Picture Pre-dealing with: Finishing all photo obtainment & making that photo storage, they
accompanying stage so that picture pre-taking cares of. To securing one of a kind picture in
that the data picture pre-dealing with step is an especially profitable work. so the before
planning of the pictures that smother unused twisting to that photos & redesignfew photo
specialties basic to furthermore dealing with that examination process. Picture taking care
before of step it consolidates shading place change, picture change, andpicture division.
The picked up picture will have some photo sort out .

14
Color based segmentation: color based segmentation using K-suggests bundling picture
division is the game plan of a photo into different social events. K-Means gathering figuring is
an unsupervised count and it is used to partition the charmed area from the establishment. K-
infers gathering is a method for vector quantization. A cluster is a social occasion of articles
which are "similar" among them and are "dissimilar" to the things having a place with various
gatherings. The direct graphical case is showed up in fig 4.2

Fig 4.1 Clustering process

For this circumstance we easily recognize the 4 clusters into which the data can be parcelled;
the closeness administer is expel: no less than two articles have a place with a comparable
bundle in case they are "close" as showed by a given detachment (for this circumstance
geometrical partition). This is called isolate based grouping. Another kind of bundling is
hypothetical gathering; no less than two articles have a place with a comparable gathering if
this one describes a thought typical to each one of those things. Packing implies the path
toward social event tests so the cases are equivalent inside each get-together. The social
occasions are called gatherings. Its straightforwardness and viability, gathering approaches
were one of the vital strategies used for the division of (completed) trademark pictures. A
cluster is a social occasion of articles which are "similar" among them and are "dissimilar" to
the things having a place with various gatherings. This is called isolate based grouping.
Another kind of bundling is hypothetical gathering; no less than two articles have a place
with a comparable gathering if this one describes a thought typical to each one of those things.

15
Its straightforwardness and viability, gathering approaches were one of the vital strategies
usedfor the division of (completed) trademark pictures.

Fig 4.2 system flow chart

16
In section clustering, the goal is to make one game plan of gatherings that fragments the data in
to similar social occasions. Diverse systems for bundling are separate based by which if noless
than two things having a place with a comparative gathering are close as showed by a given
partition, by then it called evacuate is based batching. In our work we have used K- suggests
gathering approach for performing picture division using Mat lab programming. A better than
average gathering strategy will make astonishing groups with high intra-class likeness and low-
between class similarity. The idea of collection result depends upon both the similarity measure
used by the system and its use. The idea of a gathering system is moreover assessed by its ability
to locate a couple or most of the covered plans. Picture division is commencing of picture
examination and understanding and a critical part and a most settled and most troublesome issue
of picture planning. Batching infers gathering and perceiving things that are given practically
identical properties. Clustering techniques describes the pixels with same characteristics into
one gathering, along these lines encircling differing packs as demonstrated by insight between
pixels in a group, it is a methodology for unsupervised learning and a run of the mill framework
for accurate data examination used as a piece of various fields, for instance, plan affirmation ,
picture examination and bioinformatics

SVM Classifier: An assistance vector machine is a skilled instrument for parallel request, fit
for creating snappy classifier work following a readiness period. There are a couple of
approaches to manage getting SVMs to portrayal issues with no less than three classes In
machine learning, bolster vector machines that controlled study idols with associated
acceptable computations which separate information utilized for game-plan and break faith
examination. SVM are inherently two class classifiers. The customary technique to do
multiclass plan with SVMs is use one of the procedures. The classifier appraisal contain the
yield regard higher than the cutoff locale recorded as "certified" and say SVM yield regard
lower than the edge are recorded as "false". The SVM classifier include the combined portrayal
of pictures.
GLCM technique Gray level Co-event framework (GLCM): is created for every pixel
outline H&S pictures of contaminated group. The graycomatrix work makes a dark level co-
event grid by ascertaining how every now and again a pixel with the specific power esteem I
happens in a predefined spatial relationship to a pixel with the esteem j.As a matter of course
this spatial relationship is the pixel of intrigue and its quick right

17
pixel. Notwithstanding, we can determine some other spatial connection between twos. To
make different GLCMs, indicate a variety of balances to the grayco matrix work. These
balances characterize pixel connections of differing heading and separation. Bearings can be
even, vertical, along two diagonals. Ascertaining measurements from GLCM network
otherwise called SGDM.

Fig 4.3 System Architecture

Fig 4.4 System process Diagram

18
CHAPTER 5
IMPLEMENTATION

5.1 Introduction to MATLAB

Picture getting ready is a system to play out a couple of assignments in the picture,
combining the particular true objective for fetch the updated photo else to remove few
significant information from that. That was a kind of banner getting responsible in which
input was the picture & crop may photo else traits/features relates to the picture. Nowadays,
images getting ready was among rapidly frowning propels. It outlines focus look into zone
inside building andprogramming designing orders too.

Picture getting ready basically joins the three phases which are getting like:
 Getting a photo from methods for image acquirement instruments;

 Inspecting as well as controlling the photo;

 Obtained conclusion may be changed image or report which depend on image


examination.

The two modifications of frameworks utilized the image intending to be specific,


essential and moved picture managing. Fundamental picture dealing with can be utilized for
the printed copies like printouts and photos. Picture overseers utilize various stray pieces the
clarification while utilizing these visual frameworks. Modernized image preparing procedures
help in charge of the impelled pictures by utilizing PCs. Mainly three general sorts that a
broad assortment in information need for inclusion while utilizing pushed method are pre-
dealing with, change, and show, data extraction. Making setups in Matlab, if a photo was
secured like a JPEG-picture in their plate you first look it into Matlab. Regardless,
remembering the ultimate objective for start doing on a photo, for instance play out the
wavelet change in the photo, they should change over it onto a substitute course of action.
This territory illuminates four setups. Power picture (diminish scalepicture).

19
5.2 Image Enhancement: Contrast enhancement

Picture update frameworks have been for the most part used as a piece of various
employments of picture getting ready where the subjective idea of pictures is basic for
human interpretation. Separation is a basic factor in any subjective appraisal of picture
quality. Separation is made by the qualification in luminance reflected from two abutting
surfaces. Ina manner of speaking, separate is the qualification in visual properties that makes
a challenge discernible from various articles and the establishment. In visual perception,
separate is managed by the qualification in the shading and brightness of the things with
various articles. Our visual structure is more unstable to separate than incomparable
luminance; thusly, we can see the world equivalently paying little regard to the broad
changes in lighting up conditions. Various figuring’s for accomplishing contrast overhaul
have been made and applies to issuesin picture taking care of.

In handling photos in Matlab, understanding key commands like loading, processing,


and saving images is crucial. The Photo Processing Toolbox offers a wide range of functions
accessible through Matlab's help program. Essential tasks include image manipulation, format
conversion, and display. With typical photos consisting of pixels, optimizing image complexity
is vital for efficient processing and memory management. Techniques like Fourier and
Wavelet analysis aid in compression, while Matlab's array support simplifies data handling.
Many image patternsto support by Matlab are as follows:
 JPEG
 BMP
 PCX
 TIFF
 HDF
 XWB
Nearly pictures they find in the web will JPEG-pictures that are in the caption for a
championamong the all all around utilized weight benchmarks for pictures. On the off chance
that you have secured a photograph they would more have the capacity to much of the time
than not see from postfix what plot that is secured in. For instance, a photograph mentioned

20
as myimage.jpg is secured in that JPEG strategy and they'll watch it afterwards on that they
can stack a photograph of this game plan into Matlab

Making setups in Matlab, if a photo was secured like a JPEG-picture in their plate you first
look it into Matlab. Regardless, remembering the ultimate objective for start doing on a photo,
for instance play out the wavelet change in the photo, they should change over it onto a
substitute course of action. This territory illuminates four setups. Power picture (diminish scale
picture)
It was the same as a "diminish measure picture" & that was the photo they will generally use
with the course. That addresses a photo was a network where all part had a regard contrasting
with wonderful/diminish pixel that the relating state must be toned.

paths to deal with address the score that addresses the sparkle had the pixel: That twofold state
(or information create). That apportions of floating number ("The decimal numbers") in the
region of 0 and 1 for each pixel. They regard 0 identifies with dim then regard 1 thinks about
be white. Interchange place is known unit 8 which distributes entirenumber in the region of 0
and 255 for address the splendor of a pixel. That regard 0 identifies with dim & 255 for white.
A class unit 8 just wants around 1/8 of its limit appeared differently in relation to the class
twofold. Of course, various numerical limits must be associated with the twofold class. We will
see later how to change over among twofold and unit 8.
 Binary picture: This photo organizes similarly set away a photo as a system yet can
simply shading the pixel dull else white. That doles out 0 with dim & 1 for white.
 Significant picture: It has a realistic technique for addressing shading pictures. (In
that course they will generally use with diminish measure pictures however only you
had made sense of how they use for a diminish measure picture they will moreover
had a ideathat manage how to use with shading pictures). A recorded pictures store a
photo as two frameworks. The essential system has an indistinct size from the photo
and a number for each pixel. The secondary system has known as shading aide with
its shape may be not exactly as same as that photo. The numbers with the essential
system is a rule of which number to be use in that shading map cross section.
 RGB picture: Another association with shading pictures. That addresses a photo
forthree cross sections has size planning that photo outline.

21
5.3 Algorithm:
Step 1: Begin
Step 2: Load picture if live picture at that point utilize IP webcam else stack picture
fromdatabase
Step 3: Pre process the gained picture to enhance the differentiation
Step4: Change over from RGB to L-a-b shading space
Step 5: Apply k implies for bunching
Step 6: Plot 3 bunches and select the proper group from the given
Step 7: Pick the fitting group
Step 8: Concentrate the component from it
Step 9: Classifier will group the malady
Step 10: Stop

Fig 5.1 Algorithm flow

22
5.4 Performance Evaluation Parameters: Viable execution of K-implies clustering
strategies is assessed in light of parameters, for example mean, Standard deviation,
Variance, Entropy, RMS, Contrast, Correlation, Energy, Smoothness, Kurtosis, IDM,
Homogeneity which is described below.

1. Mean (Array’s mean value or average mean): Its profits the mean estimations of the
components along various measurements of a cluster.
M = mean (A)

2. Standard deviation: That outcomes in the square foundation for a fair estimation on
the change for that populace for which X is drawn, where long as X comprises for free,
indistinguishably dispersed
S = Standard deviation (X)

Where, X that was a vector, returns that X.

3. Entropy: It is gives E, the scalar esteem speaking to that entropy for dim scale picture
I.E = Entropy (I), Entropy is defined as-sum (p.*log(p))
4. RMS (Root Mean Square): RMS is characterized as the Standard Deviation of the
pixelsforces. Its profits the root-mean-square (RMS) level of the info, X.
Y = RMS(X)

5. Variance: The fluctuation is ordinarily used to discover why every pixel shifts with
theneighboring pixel with it is uses as a part of arrange into various district.
6. Kurtosis: Kurtosis restores the example kurtosis of Standard deviation. To vectors,
kurtosis was a kurtosis has that component with the vector Std.
k = kurtosis (X)

7. Skewness: It is restores the skewness


of X.y = skewness (X)
8. Contrast: Complexity restores the scale of that force differentiates within a pixel and
thatnext over to entire picture.
Contrast has to be 0 for a contrast picture.

23
9. immediate overan entire picture. Range = [-11]. Connection has -1 or 1 to a flawlessly
emphatically else adversely related picture.

10. Energy: Vitality restores the aggregate of squared components in the SGDM = [0 1].
Vitality has 1 to the consistent picture.
11. Homogeneity: Homogeneity shares back esteem those measures that mutuality for the
dispersion of components with the SGDM for the SGDM corner to corner. Range = [0
1] Homogeneity is 1 to a corner to corner SGDM.

METHODOLOGY

The stages involved in leaf disease prediction and classification system are as

1. Image Collection

2. Image Preprocessing

3. Image segmentation

4. Feature extraction

5. Classification

Image Collection:
In image processing, it is defined as the action of retrieving an image from some
source, usually a hardware based source processing. This is the first step in the workflow
sequence because without an image, no processing is possible. The image that is acquired is
completely unprocessed. Image analysis starts with image acquisition this involves all
aspects that haveto be addressed in order to obtain very carefully.

Image pre-processing:

Image processing is a mechanism that focuses on the manipulation of images in


different ways in order to enhance the image quality. This is a method to perform some
operations on an image, in order to get an enhanced image or to extract some useful
information from it. It is a type of signal processing in which input is an image and output

24
may be image or characteristics or features associated with that image. Image pre-
processing methods use the considerable redundancy in images. Neighboring pixels
corresponding toone object in real images have essentially the same or similar brightness
value. Therefore, distorted pixel can often be restored as an average value of neighboring
pixels. Images aretaken as the input and output for image processing techniques it is the
analysis of image toimage transformation which is used for the enhancement of image
i.e. to increase the contrast for the input image and also restoration for geometrical
distortion.

Image segmentation is one of the most important tasks in image processing. It is


the process of dividing an image into different homogeneous regions such that the
pixelsin each partitioned region possess an identical set of properties or attributes. The
goal of segmentation is to simplify or change the representation of an image into
something that is more meaningful and easier to analyze. Image segmentation is
typically used to locate Objects and boundaries (lines, curves etc) in images. The result
of image segmentation is a set of segments that collectively cover the entire image, or a
set of contours extractedfrom the image. Each of the pixels in a region is similar with
respect to some characteristic or computed property such as color, intensity or texture.
Adjacent regions are significantly different with respect to the same characteristic.
When applied to a stack of images, typicalin medical imaging, the resulting contours
after image segmentation can be used to create 3D reconstructions with the help of
interpolation algorithms.

Image segmentation is basically used to isolate region of interest from the


background noise. For image processing techniques, we have used Matlab R2014ab in
which MATLAB is a high performance language for technical computing. MATLAB
(MATRIX LABORATORY) is an interactive system for matrix based computation
designed for scientific and engineering use. It is good for many forms of numeric
computation and visualization. Hence, MATLAB was used for image processing tasks of
leaf disease images to enhance the quality of image and to change images to binary for
feature extraction purposes. From the original leaf disease images, the image is filtered
in order to avoid other noises that are formed due to illumination effect.

25
Image Segmentation:
Image segmentation is one of the most important tasks in image processing. It is
the process of dividing an image into different homogeneous regions such that the
pixelsin each partitioned region possess an identical set of properties or attributes. The
goal of segmentation is to simplify or change the representation of an image into
something that is more meaningful and easier to analyze. Image segmentation is
typically used to locate objects and boundaries (lines, curves etc) in images. The result
of image segmentation isa set of segments that collectively cover the entire image, or a
set of contours extracted from the image.

During image segmentation, the given image is separated into a homogeneous


region based on certain features. Larger data sets are put together into clusters of smaller
and similar data sets using clustering method. In this proposed work, K-means clustering
algorithm is used in segmenting the given image into three sets as a cluster that contains
the diseased part of the leaf. Since we have to consider all of the colors for segmentation,
intensities are kept aside for a while and only Color information is taken into
consideration. The RGB image is transformed into LAB form (L-luminous, a*b-
chromous) of the three dimensional LAB, only last two are considered and stored as AB.
As the image is converted from RGB to LAB, only the “a” component i.e. the Color
component is extracted.

The goal of segmentation is to simplify or change the representation of an


image into something that is more meaningful and easier to analyze. Image
segmentation is typically used to locate objects and boundaries (lines, curves etc) in
images. The result of image segmentation isa set of segments that collectively cover the
entire image, or a set of contours extracted from the image. During image
segmentation, the given image is separated into a homogeneous region based on certain
features. Larger data sets are put together into clusters of smaller and similar data sets
using clustering method.

26
Feature Extraction:
Feature extraction starts from an initial set of measured data and builds derived
values (features) intended to be informative and non-redundant facilitating the
subsequent learning and generalization steps and in some cases leading to better human
interpretations. A feature is a piece of information extracted from an image. It is
defined as an interesting part of an image. Features are used as a starting point for
many computer vision algorithms. So, the overall algorithm will often only be as good
as its feature detector. Feature extraction is related to dimensionality reduction. Feature
extraction is the method by which unique features of leaf images are extracted. This
method reduces the complexity in classification problems. The purpose of feature
extraction is to reduce the original data set by measuring certain properties, or features,
that distinguish one input pattern from another.

GLCM (Texture features): A statistical method of examining texture that


considers the spatial relationship of pixels is the gray level co-occurrence
matrix(GLCM), also known as the gray-level spatial dependence matrix. The GLCM
functions characterize the texture of an image by calculating how often pairs of pixel
with specific values and in a specified spatial relationship occur in an image creating a
GLCM and then extracting statistical measures from matrix. Feature extraction is a
method of capturing visual content of images for indexing & retrieval. Gray level co-
occurance matrix( GLCM ) method is a way of extracting second order statistical texture
features. The approach has been used in a number of applications, third and higher order
textures consider the relationships among three or more pixels. These are theoretically
possible but not commonly implemented due to calculation time and interpretation
difficulty. GLCM isa powerful tool for image feature extraction by mapping the Gray
level co-occurrence probabilities based on spatial relations of pixels in different angular
directions.

27
Classification:
The intent of the classification process is to categorize all pixels in a digital image
into one of several land cover classes or themes. This categorized data may then be used
to produce thematic maps of the land cover present in an image. The binary classifier
which makes use of the hyper-plane which is also called as the decision boundary between
two of the classes is called as Support Vector machine (SVM). Support- vector
machine constructs a hyperplane or set of hyperplanes in a high or infinite- dimensional
space, which can be used for classification, regression or other tasks like outliers
detection. The standard SVM is a non-probabilistic binary linear classifier, i.e. it
predicts for each given input, which of two possible classes the input is a member of.
Since an SVM is a classifier, in the given set of training examples, each marked as
belonging to one of two categories an SVM training algorithm builds a model that
predicts whether anew example falls into one category or the other.

Some of the problems of pattern recognition like texture classification make use
of SVM. Mapping of nonlinear input data to the linear data provides good
classification in high dimensional space in SVM. They are motivated by the principle
of optimal separation, the idea that a good classifier finds the largest gap possible
between data points of different classes. The marginal distance is maximized between
different classes by SVM. Different kernels are used to divide the classes. SVM is
basically binary classifier which determines the hyper plane in dividing two classes.
The boundary is maximized between the hyper plane and the two classes. The samples
that are nearest to the margin will be selected in determining the hyper plane is called
as support vectors. This categorized data may then be used to produce thematic maps of
the land cover present in an image. The binary classifier which makes use of the hyper-
plane which is also called as the decision boundary betweentwo of the classes is called as
Support Vector machine (SVM). Support- vector machine constructs a hyperplane or
set of hyperplanes in a high or infinite- dimensional space, which can be used for
classification, regression or other tasks like outliers detection.

28
SYSTEM REQUIREMENT SPECIFICATION

System requirement specification is obtained by providing the appropriate


platform to implement the system. It is the elaborative conditions which the system
need to attain. Moreover, it provides a thorough understanding for the system on what
to do, without having any conditions for the system on how to do. The specification
gives out the implementation base or the plan and restricts for the outside visible
characters.

Hardware Requirements

 Processor : Dual core i3 and above

 RAM : 512MB and Above

 Speed : 2.4GHz and Above

 Secondary Device : 40GB and above

Software Requirements

 Programming Language : M-Scripting

 IDE : MATLAB 8.10

 Operating System : Windows 7 and above

Functional Requirements

The flow of the project is as follows:

 Input the image of leaf part that needs to be diagnosed from the user.

 Analyze the image and detect the type of leaf disease.

 Prompt the type of disease to the user.

29
Non-Functional Requirements

 Extensibility Requirements:
The system must be flexible enough to incorporate new requirements as and when
required.

 Documentation Requirements:
The system must have the correct documentation so that the system can be easily
understood for the purpose of enhancement.

 Pre-processing techniques: The aim of pre-processing is an improvement of the image


data that suppresses unwanted distortions or enhances some image features important
for further processing. Dataset will take sample images and convert them to gray scale
images and finally to binary images.

 Segmentation: Image segmentation is typically used to locate objects and


boundaries (lines, curves, etc) in images. Binary images are used to extract the
ROI(region of interest) using K-means algorithm.

 Feature Extraction: Feature extraction is the method by which unique features of


leaf lesion images are extracted. This method reduces the complexity in classification
problems. GLCM features and physical features of segmented images are extracted.

Classification:

The intent of the classification process is to categorize all pixels in a digital image into
one of several land cover classes or themes. This categorized data may then be used to
produce thematic maps of the land cover present in an image. Further using GLCM value
we classify the clusters by using SVM algorithm. System requirement specification is
obtained by providing the appropriate platform to implement the system. It is the
elaborative conditions which the system need to attain. Moreover, it provides a thorough
understanding for the system on what to do, without having any conditions for the system
on how to do.

30
System architecture:

The system which is being used currently performs the task in image recognition
and classification of it. The system is implemented in the matlab using the M- scripts. The
input image (diseased part) is matched with the images in the database using Euclidean
distance value. So, the matched image with minimum value is recognized and classified to
give the respective output.

Image Pre-processing Segmentation


retrieved
RGB Nois K- Euclidi
from
to e Means an
disease

Feature
Type of c Extraction
leaf multiSVM
s GL CM
Disease

i
c
a
t

Figure: Architectural diagram of the proposed system

Figure shows the system architecture for the proposed method. It begins from
collecting the image from the database. The image is selected from the database and given
as an input for the system. The input image is pre-processed and converted to gray scale
image to find the threshold value based on input image. A grayscale image is simply one
in which the only colors are shades of gray. Based on threshold value further binary and
segmented images are obtained.
The segmented image is than processed for the feature extraction where the features are
extracted. GLCM features, morphological features and statistical features are extracted.

31
Further, classification is done by using the support vector machine (SVM) and the type of
the leaf disease is predicted with the accuracy rate.

Specification using Use Case Diagrams:

The relationship among the user and the system is shown in simple way using use
cases. A name within the ellipse indicates the use cases. A stickman notation is used for
actor, with the name being placed below and solid line connects actor and use cases.
Use case for leaf disease prediction and classification is depicted in the below
Figure. Initially the set of captured images are stored in a temporary file in MATLAB.
The aim of pre-processing is an improvement of the image data that suppresses unwanted
distortions or enhances some image features important for further processing. Dataset will
take sample images and convert them to gray scale images and finally to binary images. The
obtained RGB image is converted into Gray Scale image to reduce complexity. Then the
pre-processing techniques are applied on the obtained Gray Scale image. Image
segmentation is typically used to locate objects and boundaries (lines, curves, etc) in images.
Based on the observation the segmented image is used to obtain the region of interest (ROI).
Feature extraction is the method by which unique features of leaf lesion images are
extracted. This method reduces the complexity in classification problems. The significant
features are extracted using GLCM resulting in support vector values. The intent of the
classification process is to categorize all pixels in a digital image into one of several land
cover classes or themes. Further, we classify the support vector and using Euclidian distance
we match the closest image in database and recognize the required output. Initially the set
of captured images are stored in a temporary file in MATLAB. The aim of pre-processing
is an improvement of the image data that suppresses unwanted distortions or enhances
some image features important for further processing. Dataset will take sample images and
convert them to gray scale images and finally to binary images.

32
Data Collection

Pre-processing

Segmentation

Feature
Extraction

Classification
USER SYSTEM

Result

Figure: Use case diagram of recognition and classification of image

Module Specification:

Module Specification is the way to improve the structure design by breaking down
the system into modules and solving it as independent task. By doing so the complexity is
reduced and the modules can be tested independently.

Image Pre-processing:
Image processing is a mechanism that focuses on the manipulation of images in
different ways in order to enhance the image quality. Image processing is a mechanism that
focuses on the manipulation of images in different ways in order to enhance the image
quality. This is a method to perform some operations on an image, in order to get an
enhanced image or to extract some useful information from it. As shown in Figure images
are taken as the input and output for image processing techniques. It is the analysis of
image to image transformation which is used for the enhancement of image i.e. to increase
the contrast for the input image and also restoration for geometrical distortion.

33
The input Conversion of
images inputimage to
(Disease RGB matrix
part)

Conversion of
GrayScale Conversion of RGB
image to image to Gray Scale
Binary image

Figure: Pre-processing of input image

Image Segmentation using K-Means Clustering:


K-mean is the most popular partitioning method of clustering. K-mean is a
unsupervised, non-deterministic, numerical, iterative method of clustering. In K-mean each
cluster is represented by the mean value of objects in the cluster. As shown in below Figure
3.4 we partition a set of n object into k cluster so that inter cluster similarity is low and intra
cluster similarity is high. Similarity is measured in term of mean value of objects in a
cluster.The algorithm consists of two separate phases.
1st Phase select k centroid randomly, where the value k is fixed in advance.

2nd Phase Each object in data set is associated to the nearest centroid. Euclidean distance is
used to measure the distance between each data object and cluster centroid.
The following shows the algorithm for K-Means Clustering.

Input K: number of cluster (for dynamic clustering initialize the value of k by two) Fixed
number of cluster = yes or no (Boolean). D: {d1, d2,..dn} a data set containing n objects.
Output A set of k clusters.
Method:

Step 1: Randomly choose K data item from D dataset as the initial cluster centres

Step 2: Repeat

34
Step 3: Assign each data item to the cluster to which object is most similar based on the
mean value of the object in cluster
Step 4: Calculate the new mean value of the data items for each cluster and update the
mean value Until no change

Step 5: If fixed number of cluster = yes (Go to step 11) Compute the inter-cluster

distance using eq (1)Compute the intra-cluster distance


Step 6: If new intra-cluster distance old inter-cluster distance go to step 10 else go to
step11k=k+1
Step 7: Stop this algorithm give optimal number of cluster for unknown data set

The time taken by this algorithm for small dataset is almost same as standard k-
mean algorithm but the time taken by dynamic clustering algorithm for large data set is
more as compare to standard k-mean algorithm.

Binary Image Masking

Segmented Matrix Obtain ROI

Figure: Segmentation of binary image

35
Feature Extraction using GLCM
Feature extraction is the method by which unique features of leaf lesion images are
extracted. This method reduces the complexity in classification problems. The purpose of
feature extraction is to reduce the original data set by measuring certain properties, or
features, that distinguish one input pattern from another. Features are used as a starting
point for many computer vision algorithms. So, the overall algorithm will often only be as
good as its feature detector. Feature extraction is related to dimensionality reduction.
GLCM is a powerful tool for image feature extraction by mapping the Gray level co-
occurrence probabilities based on spatial relations of pixels in different angular directions.
As shown in below Figure 3.5 for the segmented matrix applying the GLCM features we
extract GLCM values. Morphological features: Morphology refers to the form and
structure of an organism as a whole, including all internal and external structures. This
include aspects of the outward appearance (shape, structure, color, pattern) and structure
of the internal parts like bones and organs. Morphology is the geometric property of a
given image, in our caseit is the sizeand shape characteristics of human leaf disease image.

Segmented Apply GLCM GLCM


Matrix Values

Figure: Feature extraction of segmented image

36
Shape Feature Extraction:
Shape feature extraction used in this paper is solidity, extent, minor axis length and
eccentricity. This features taken Shape feature extraction used in this paper are solidity,
extent, minor axis length and eccentricity. These features taken from research in order to
extract shape feature in diseased region.
Eccentricity is used to recognize whether the rust shape is a circle or line segment.
Eccentricity is the ratio of the distance between the foci of the ellipse and its major axis
length. An ellipse whose eccentricity is 0 can recognized as a circle, while an ellipse whose
eccentricity is 1 can recognized as a line segment.
Minor axis length is used to measure length of axis of the diseased region. Minor
axis length is the length of the minor axis of the ellipse that has the same normalized second
central moments as the region.
Extent is used to measure area of diseased region that is divided by the area of the
bounding box. Extent is computed as the area divided by area of the bounding box.
Solidity is used to measure area of diseased region divided by pixels in the convex
hull. Solidity is the proportion of the pixels in the convex hull that are also in the region. It
is computed by dividing the area by convex area.

Texture Feature Extraction:


Gray Level Co-occurrence Matrix (GLCM) extract second order statistical texture features.
Texture feature extraction used in this research is contrast, correlation, energy and
homogeneity. These features taken from research to extract texture feature in leaf disease
region.

Contrast of the pixel and its neighbors is calculated over all of the image Pixels.

Contrast is used to measure contrast between neighbourhood pixel.


equation 3.1
Correlation is a measure of correlation of a pixel with its neighbors over all of the image

equation 3.2
Energy is a sum of G (grey level co-occurrence matrix elements.
equation 3.3

37
Homogeneity computes similarity of G to the diagonal matrix.

equation 3.4
All of the four features described in this section represent texture of the images of diseased
region in comparison with the normal one.
Color Feature Extraction:
Color is a distinctive feature for image representation that is invariant with respect
to scaling, translation and rotation of an image [9]. Mean, skewness and kurtosis are used
to represent Color as features. To do this, we transform RGB to LAB.
Mean used to represent average value of each Color channel.

equation 3.5
Skewness and kurtosis used to measure the distribution of each Color channel.
Skewness can be described as:

equation 3.6

Skewness is a measure of symmetry. If a distribution or data is symmetric, it looks the same


to the left and right of the centre point. Kurtosis can represent whether the data are peaked
or flat relative to a normal distribution [12]. Kurtosis can be described as follows:

equation 3.7

Combination of mean, skewness and kurtosis is used to represent Color feature of normal
and diseased image of leaf.

38
Classification using Support Vector Machine Algorithm:
The binary classifier which makes use of the hyper-plane which is also called as the
decision boundary between two of the classes is called as Support Vector machine (SVM).
As shown below figure 3.6 by applying Euclidian distance support vectors are obtained.
Some of the problems of pattern recognition like texture classification make use of SVM.
Mapping of nonlinear input data to the linear data provides good classification in high
dimensional space in SVM. The binary classifier which makes use of the hyper-plane which
is also called as the decision boundary between two of the classes is called as Support Vector
machine (SVM). As shown below Figure 3.6 by applying Euclidian distance support vectors
are obtained. Some of the problems of pattern recognition like texture classification make
use of SVM. Mapping of nonlinear input data to the linear data provides good
classification inhigh dimensional space in SVM.

GLCM Values Apply Euclidian Support vectors


distance obtained

Figure: Obtaining Support Vector from GLCM values

Training sample in support vector machine is separable by a hyperplane. This hyperplane


is computed according to the decision function f(x) = sign (w.x) + b, where w is a weight
vector and b is a threshold cut-off.
To maximize the margin, w € f and b have to be minimized to:

equation 3.8
Additional slack variables should be added to prevent overfitting.

equation 3.9

39
SVM was chosen as the binary classifier because it can classify accurately even when limit
samples were available [6]. There are different kernel function in SVMclassifier. Figure 3.7
shows different types of kernel in SVM. They are linear, quadratic, polynomial, and radial
basis function.

Figure: Different kernel in SVM

SVMs (Support Vector Machines) are a useful technique for data classification.
Classification task usually involves separating data into training and testing sets. Each
instance in the training set contains one \target value" (i.e. the class labels) and several
attributes" (i.e. the features or observed variables). The goal of SVM is to produce a
model(based on the training data) which predicts the target values of the test data
given only the test data attributes.
A Support Vector Machine (SVM) is a discriminative classifier formally
defined by a separating hyperplane. In other words, given labeled training data
(supervised learning),the algorithm outputs an optimal hyperplane which categorizes
new examples. Let’s consider the following simple problem:

We are given a set of n points (vectors): x1, x2, x3, ….. xn such that xi is a
vector of length m, and each belong to one of two classes we label them by “+1”

and “-1”. So ourtraining set is

equation 3.8

40
Where, β is known as the weight vector and βo as the bias. For a linearly separableset of 2D
points which belong to one of two classes, find a separating straight line.

In Figure 3.8 you can see that there exist multiple lines that offer a solution to the problem.
A line is bad if it passes too close to the points because it will be noise sensitive andit will
not generalize correctly. Therefore, our goal should be to find the line passing as faras
possible from all points.

Figure: Green Color hyperplane separating two classes ofred squares and blue circles

Then, the operation of the SVM algorithm is based on finding the hyperplane that gives the
largest minimum distance to the training examples. Twice, this distance receives the
important name of margin within SVM’s theory. Therefore, the optimal separating
hyperplane maximizes the margin of the training data which is depicted well in theFigure
3.8.

The optimal hyperplane can be represented in an infinite number of different ways by


scaling of β and βo. As a matter of convention, among all the possible representations of
the hyperplane, the one chosen is,
equation 3.9
Where x symbolizes the training examples closest to the hyperplane. In general, the
training examples that are closest to the hyperplane are called support vectors. This
representation is known as the canonical hyperplane.

41
Figure: Finding optimal hyperplane

The data usually contain noises, which result in overlapping samples in pattern space,
and there may produce some outliers in the training data set. So we need to remove these
outliers from the training data set so that a better decision boundary can be easily formed.
We here apply smoothening method to remove those points that do not agree with the
majority of their k nearest neighbors.

In particular, by comparing with the 1-NN and k-NN classifiers, it can be found that
the SVM classifier can not only save the storage space but also reduce the classification
time under the case of no sacrificing the classification accuracy. Then, the operation of the
SVM algorithm is based on finding the hyperplane that gives the largest minimum distance
to the training examples. Twice, this distance receives the important name of margin
within SVM’s theory. Therefore, the optimal separating hyperplane maximizes the margin
of the training data which is depicted well in the Figure 3.8. So we need to remove these
outliers from the training data set so that a better decision boundary can be easily formed.
We here apply smoothening method to remove those points that do not agree with the
majority of their k nearest neighbors.

42
Flow chart of the proposed system

Start

Training Image Test Image


dataset

Pre-processing Pre-processing

Clustering using Clustering using


K-Means algorithm K-Means algorithm

Feature extraction Feature extraction


Using GLCM Using GLCM

Find distance from

If
True False
distance is
minimum
Test image matches Test image doesn’t
with some training match with any
image training image

Name of a leaf Not a class of leaf


disease disease

Name of a leaf
disease

End

43
In section clustering, the goal is to make one game plan of gatherings that fragments
the data in to similar social occasions. Diverse systems for bundling are separate based by
which if no less than two things having a place with a comparative gathering are close as
showed by a given partition, by then it called evacuate is based batching. In our work we
have used K- suggests gathering approach for performing picture division using Mat lab
programming. A better than average gathering strategy will make astonishing groups with
high intra-class likeness and low-between class similarity. The idea of collection result
depends upon both the similarity measure used by the system and its use. The idea of a
gathering system is moreover assessed by its ability to locate a couple or most of the
covered plans.
Picture division is commencing of picture examination and understanding and a
critical part and a most settled and most troublesome issue of picture planning. Batching
infers gathering and perceiving things that are given practically identical properties.
Clustering techniques describes the pixels with same characteristics into one gathering,
along these lines encircling differing packs as demonstrated by insight between pixels in a
group, it is a methodology for unsupervised learning and a run of the mill framework for
accurate data examination used as a piece of various fields, for instance, plan affirmation,
picture examination and bioinformatics. There is a significant measure of employments of
the K-mean batching, reach out from unsupervised learning of neural framework, plan
affirmations, gathering examination, counterfeit smart, picture taking care of, machine
vision, etc.

Detail description of each module:


This section gives the detailed description of each module which includes pre- processing,
segmentation, feature extraction, classification techniques.
RGB Color Image:
The RGB Color model is additive Color model in which red, green and blue light are added
together in various ways to reproduce a broad array of colours. The name of the model
comesfrom the initials of the three additive primary colors, red, green and blue.

44
The main purpose of the RGB Color model is for the sensing, representation and
display ofimages in electronic systems, such as television and computers, though it has also
been usedin conventional photography.
Before the electronic age, the RGB Color model already had a solid theory behind
it, based on human perception of colors. RGB is a device dependent Color model: different
devices detect or reproduce a given RGB value differently, since the Color elements (such

as phosphors or dyes) and their response to the individual R, G and B levels vary from
manufacturer to manufacturer, or even in the same device over time. Thus an RGB value
doesn’t define the same color across devices without some kind of color_management.
Typical RGB input devices are color TV and video cameras, image scanners and
digital cameras. Typical RGB output devices are TV sets of various technologies (CRT,
LCD, Plasma), computer and mobile phone displays, video projectors, multicolour LED
displays, large screens such as Jumbo Tron. Color printers, on the other hand, are not RGB
devices, but subtractive color devices (Typically CMYK color model).

Grayscale:
In photography and computing, a grayscale or grayscale digital image is an image in which
the value of each pixel is a single sample, that is, it carries only intensity information. Image
is of this sort, also known as black-and-white, are, are, are composed exclusively of shades
of grey, varying from black at the weakest intensity to white at the strongest.

Grayscale images are distinct from one-bit bi-tonal black-and-white, are, are, are images,
which in the context of computer imaging are images with only the two colors, black and
white (also called bi-level or binary images).

Grayscale images are often the result of measuring the intensity of light at each pixel in a
single band of electromagnetic spectrum (e.g. infrared, visible light, ultraviolet),and in such
cases they are monochromatic proper when only a given frequency is captured.But also they
can be synthesized from a full color image.

45
Segmentation:

During image segmentation, the given image is separated into a homogeneous


region based on certain features. Larger data sets are put together into clusters of smaller
and similar data sets using clustering method. In this proposed work, K-means clustering
algorithm is used in segmenting the given image into three sets as a cluster that contains the
diseased part of the leaf. Since we have to consider all of the colors for segmentation,
intensities are kept aside for a while and only color information is taken into consideration.
The RGB image is transformed into LAB form (L-luminous, a*b-chromous). Of the three
dimensional LAB, only last two are considered and stored as AB. As the image is converted
from RGB to LAB, only the “a” component i.e. the color component is extracted.

Feature Extraction:
Feature extraction is the most significant step in recognition stage as a size of the
data dimensionality is reduced in this stage. Also, it can be used for signal processing,
pattern matching. Feature extraction starts from an initial set of measured data and builds
derived values (features) intended to be informative and non-redundant facilitating the
subsequent learning and generalization steps and in some cases leading to better human
interpretations. A feature is apiece of information extracted from an image. Here, features
are extracted using gray level co-occurrence matrix(GLCM) where only the unit and
significant features are extracted. Later, we can get GLCM values and support vectors. To
calculate this GLCM values and support vectors, column matrix of all the images is found
and concatenated to form single matrix, mean of this matrix is calculated and it is subtracted
for normalization. The mean of the matrix is calculated as shown in equation 4.1.
Mean= ∑M Tn equation 4.1
n=1

where, M is the number of column matrix.


Mean from each of the column vector of the database Ti is subtracted as
shown inequation 4.2.
Temp = A - µ equation 4.2
where, A is column matrix & µ is the mean.

46
CHAPTER 6
TESTING

6.1 Testing Purpose


Testing accomplishes an arrangement of things, yet most importantly it evaluates the
idea of the item we are making. This view accept there are absconds in the item holding up
to be found and this view is only sometimes refuted or even talked about.

A couple of components add to the hugeness of making testing a high need of any item change
effort. These include:

 Decreasing the cost of building up the program.

 Guaranteeing that the application carries on precisely as we disclose to the client for
mostby far of projects, flightiness is the minimum attractive outcomes of utilizing an
application
 Diminishing the aggregate cost of possession. By giving programming that looks and
carries on as appeared in the documentation, the clients require less hours of preparing
and less help from item specialists.
 Creating clients dependability and informal piece of the overall industry

6.2 Unit Testing


Unit testing revolves check around the humblest part in software design. Utilizing the
part of steps in system outline as a guide, fundamental like guide, essential control steps are
endeavoured to reveal messes up which is inside the most distant purpose of the part.
Generally, unit testing is a white box organized testing.

Regardless of anything else the module connection endeavoured guarantee that the data
reasonably data streams in as well as out of the program until before test. By then close-by
information formation is attempted to provide guarantee for information group over through
taking challenges up are endeavoured to ensure that the module works authentically at limits
set up to restrict or bind planning. Each free path through the control structure is

47
rehearsed to guarantee that all revelations in a part must be executed at event once. Ultimately,
every slip-ups dealing with ways are attempted. In this wander the testing is done by base up
approach. Starting with tiniest and most negligible level modules and dealing with every one
thus. For each module a driver and looking at stubs were moreover created. In case any errors
found they were corrected in a split second and the unit was attempted afresh.

6.3 Regression Testing


At whatever point if we change the execution within the code, we ought to besides do
fall away from the faith testing. We are able to do in this way by recovering present tests
oppositeto the altered code in order to pick the developments gap if any presents those may
be in previous they may change and it may through making fresh tests which is very
fundamental. with:

A couple of systems and parts considered in the midst of this technique fuse the going

 Test settled bugs rapidly

 Search for responses of fixes. The bug itself might be settled yet they might make
distinctive bugs

 Backslide test is made for each bug settled

 If no less than two tests are similar, make sense of which is less convincing and
discard it

 Recognize tests that the program dependably passes and report them 

 Focus on helpful issues, not those related to plot 

 Take off changes (pretty much nothing and broad) to data and find any
consequent contamination

 Take after the effects of the movements on program memory

48
6.4 Stress Testing
Stress testing, which is specific from of execution testing, resembles harming testing in
other field of building. The goal of stress testing is to crash the application by growing the
taking care of load past execution degradation until the point that the moment that the
application begins.

Bomb due to submersion of benefits or the occasion of goofs. Stress testing reveals
honest bugs that would somehow go undetected until the point that the moment that the
application was sent. Since such bugs are regularly the outcome of design flaws, extend
testing should begin appropriate on time in the change organize on each zone of the
application. Fix these subtle bugs at their source instead of settling symptomatic bugs that
may happen elsewhere inthe application if these bugs were ignored.

Assimilation Evaluation

Coordination evaluation is one of wise development part in evaluation. At all perplexing


packaging, two units which may have quite recently endeavoured are joined to a segment then
the link amid them is endeavoured. Some part, here suggests an arranged total of in excess of
single unit. The reasoning is because of test blend of piece and finally extends the technique
in order to do evaluation in parts comparing with different social affairs. Over the long haul
every single modules which is forming a technique are endeavoured collectively. Any
oversights got while merging all units which are likely identified with the connection amid
units. These techniques reduce the measure of conceivable outcomes to some troublesome
level of examination.

In this item, the base up compromise testing moved nearer has been used, start with
the tiniest and most negligible level modules and proceeding with every one thus. For each
module the tests were driven and the results were noted down.

49
CHAPTER 7

SNAPSHOTS

Home Page:

Home page of the system it mainly includes image loader, image contrast enhancement box
and segment image sector to add image into the box in order to detect and classify the leaf
disease

50
Load image page:

In the above figure the information picture ought to be stacked. The image can be loaded
fromthe dataset.

51
Contrast enhanced:

At this point the contrast of the image will be improved. Then the image experiences
segmentation.

The information picture is first pre processed and the difference is upgraded so the
moment subtle elements are noticeable on a bigger scale. At that point the upgraded picture is
changed over into dark organization portrayal. The second picture demonstrates the enhanced
form of the information picture. The picture will be differentiated and afterward shown.
Presently select the Segment Image choice.

52
Entering clustering Number:

Select one among the sectioned pictures in which the sickness can be distinguished
unmistakably. They chose picture will then be utilized for additionally preparing .

53
Classification of Leaf Disease Result:

In this snapshot, among the sectioned pictures, one picture is chosen and arranged in light of
the ROI. The classifier recognizes that the info leaf picture has a place with the Alternaia
Alterna Spot disease

54
Accuracy detection for 500 iteration:

Here, it shows the entering maximum accuracy for 500 iteration. The system checks accuracy
up to 500 iteration, then it provides better accuracy result.

55
Accuracy detection of Disease:

The computed accuracy will be shown. For accuracy figuring, the portion work is changed
and the cross approval alongside class execution is utilized.

RESULT

56
CHAPTER-8
CONCLUSION

The world is moving more towards advancement subordinate time. Here, we have
introduced, a programmed framework to distinguish leaf illnesses for different plants utilizing
GLCM and multiclass SVM. The calculation was tried principally on five distinct sorts of
sicknesses that are normally found and we have a precision of upto 92-98%. The consequences
of the investigation demonstrate that, the utilized approach would be of indispensable for
recognizing the plant maladies. Along these lines, we have displayed a solid framework which
would enable the farmers to distinguish the illness in ahead of schedule to organize.

The computer can therefore arrange different sorts of plants through the leaf pictures
stacked from different digital equipments such as scanners, cameras etc. One of the classifier
called as SVM which is used to recognizing all ailment with a greater accuracy, speed on
planning along with direct structure. Differentiated and distinctive procedures appear
differently in relation with different types of method this type of computation are brisk in
completion of task, to achieve success in the field of affirmation with straightforward for
utilization which is easy to get it. The introduced plant leaf examination computation which
is attempted in each apparent leave. Suggested test occurs exhibits in such a way that the
approach is regard iscritical, that would altogether be able to support an exact area of plant
leaf illness in small calculation effort.

57
PROSPECTIVE ENHANCEMENTS

SVM, however a twofold portrayal technique, with a fundamental control, can be


used for a multiple class case. This gives more space not just to arrange but instead to
perceive the illnesses. Before long the structure is self-loader. This can be completely
customized by picking ROI in light of manage, for instance, critical parts examination, or
picking the gathering with greater affliction zone et cetera with the right database, this
procedure can be associated with more illnesses. Representation:, skin diseases, Breast
cancer, Liver infectionsidentification andclassification etc.,

Planned work stresses in investigation of work in specific area with front line
properties then advancement through making an android application so, Farmers can without
a doubt get it.

58
CHAPTER-9
BIBLIOGRAPHY
Referred Books:

1. Pawan P.Warne, Dr.S.R. Ganorkar“ Detection of Diseases on Cotton Leaves Using K-


Mean Clustering Method”, International Research Journal of Engineering and
Technology(IRJET) Volume: 02 Issue: 04 | July-2015, 425- 431.
2. Daisy Shergill, AkashdeepRana, Harsimran Singh “Extraction of rice disease using image
processing”,International Journal Of Engineering Sciences & Research technology, June,
2015,135-143.
3. Malvika Ranjan1, Manasi Rajiv Weginwar,NehaJoshi,Prof.A.B. Ingole, detection and
classification of leaf disease using artificial neural network, International Journal of
Technical Research and Applications e-ISSN: 2320-8163, Volume 3, Issue 3 (May-June
2015), PP. 331-333.
4. RenukaRajendraKajale. Detection & recognition of plant leaf diseases using image
processing and android o.s “International Journal of Engineering Research and General
Science Volume 3, Issue 2, Part 2, March-April, 2015.,ISSN 2091-2730
5. Prakash M. Mainkar, ShreekantGhorpade, MayurAdawadkar”, Plant Leaf Disease
Detection and Classification Using Image Processing Techniques”,International Journal of
Innovative and Emerging Research in Engineering Volume 2, Issue 4, 2015,139-144
6. Prakash M. Mainkar, ShreekantGhorpade, MayurAdawadkar”, Plant Leaf Disease
Detection and Classification Using Image Processing Techniques”,International Journal
of Innovative and Emerging Research in Engineering Volume 2, Issue 4, 2015,139-144
7. Mr. Sachin B. Jagtap, Mr. Shailesh M. Hambarde,” Agricultural Plant Leaf Disease
Detection and Diagnosis Using Image Processing Based on Morphological Feature
Extraction”, IOSR Journal of VLSI and Signal Processing (IOSR-JVSP) Volume 4, Issue
5, Ver. I (Sep-Oct. 2014), PP 24-30.
8. NiketAmoda, Bharat Jadhav, SmeetaNaikwadi,” Detection And Classification Of Plant
Diseases By Image Processing”,International Journal of Innovative Science, Engineering
& Technology, Vol. 1 Issue 2, April 2014.

9. Anand.H.Kulkarni, AshwinPatil R. K., applying image processing technique to detect plant

59
disease, International Journal of Modern Engineering Research (IJMER) Vol.2, Issue.5,
Sep-Oct. 2012 pp-3661-3664 ISSN: 2249-6645
10. Sachin D. Khirade, A. B. Patil “Plant Disease Detection Using Image Processing”, 2015
International Conference on Computing Communication Control and Automation.
11. S. Arivazhagan, R. NewlinShebiah “Detection of unhealthy region of plant leaves and
classification of plant leaf diseases using texture features”, (Department of Electronics and
Communication Engineering, MepcoSchlenk Engineering College, SivakasiTamilnadu,
626 005, India), March, 2013 AgricEngInt: CIGR Journal Open access at
http://www.cigrjournal.org Vol. 15, No.1 211

Referential URLs:

1. file:///C:/Users/MY/Downloads/Introduction_to_image_processing_in_Matlab%20(1).pdf

2. file:///C:/Users/MY/Downloads/Introduction_to_image_processing_in_Matlab%20(2).pdf

3. www.image processing-tuto

60

You might also like