“LEAF DISEASE DETECTION USING MATLAB”

60
DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING A PROJECT REPORT ON “LEAF DISEASE DETECTION USING MATLAB” Submitted in the partial fulfillment of the requirements in the 8 th semester of BACHELOR OF ENGINEERING IN INFORMATION SCIENCE AND ENGINEERING By ANU ELZA JOHN 1NH14IS012 Under the guidance of Mrs. SHOBA M Sr. Assistant Professor, Dept. of ISE, NHCE

Transcript of “LEAF DISEASE DETECTION USING MATLAB”

DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING

A PROJECT REPORT ON

“LEAF DISEASE DETECTION USING MATLAB”

Submitted in the partial fulfillment of the requirements in the 8th semester of

BACHELOR OF ENGINEERING

IN

INFORMATION SCIENCE AND ENGINEERING

By

ANU ELZA JOHN 1NH14IS012

Under the guidance of

Mrs. SHOBA M Sr. Assistant Professor, Dept. of ISE, NHCE

NEW HORIZON COLLEGE OF ENGINEERING

Outer ring road, Kadubeesanahalli, Near Marathahalli, Bengaluru-560103

DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING

CERTIFICATE

Certified that the project work entitled “Leaf Disease Detection using Matlab”, carried

out by Ms. Anu Elza John,1NH14IS012, a bonafide student of NEW HORIZON COLLEGE OF

ENGINEERING, Bengaluru, in partial fulfillment for the award of Bachelor of Engineering in

Information Science and Engineering of the Visveswaraiah Technological University, Belgaum

during the year 2018-19.It is certified that all corrections/suggestions indicated for Internal

Assessment have been incorporated in the Report deposited in the departmental library.

The project report has been approved as it satisfies the academic requirements in respect of

Project work prescribed for the said Degree.

Name & Signature of the Guide Name Signature of the HOD Signature of the Principal

External Viva

Name of the Examiners Signature with Date

1.

2.

DEPARTMENT OF INFORMATION SCIENCE AND ENGINEERING

DECLARATION

I hereby declare that I have followed the guidelines provided by the Institution in

preparing the project report and presented report of project titled “Leaf Disease

Detection using Matlab”, and is uniquely prepared by me after the completion of

the project work. I also confirm that the report is only prepared for my academic

requirement and the results embodied in this report have not been submitted to any

other University or Institution for the award of any degree.

Signature of the Student Name: Anu Elza John

USN: 1NH14IS012

ABSTRACT

ACKNOWLEDGEMENT

Any achievement, be it scholastic or otherwise does not depend solely on the individual efforts

but on the guidance, encouragement and cooperation of intellectuals, elders and friends. A

number of personalities, in their own capacities have helped me in carrying out this project. I

would like to take an opportunity to thank them all.

First and foremost I thank the management, Dr. Mohan Manghnani, Chairman, New Horizon

Educational Institutions for providing us the necessary state of art infrastructure to do Project.

I would like to thank Dr.Manjunatha, Principal, New Horizon College of Engineering,

Bengaluru, for his valuable suggestions and expert advice.

I would like to thank Dr. R J Anandhi, Professor and Head of the Department, Information

Science and Engineering, New Horizon College of Engineering, Bengaluru, for constant

encouragement and support extended towards completing my Project.

I deeply express my sincere gratitude to my guide Mrs. Shoba M , Sr. Asst. Professor,

Department of ISE, New Horizon College of Engineering, Bengaluru, for her able guidance,

regular source of encouragement and assistance throughout my project period.

Last, but not the least, I would like to thank my peers and friends who provided me with valuable

suggestions to improve my project.

Anu Elza John

(1NH14IS012)

TABLE OF CONTENTS

LIST OF FIGURES

Figure no Figure Name Page no

LIST OF TABLES

Table no Table Name Page no

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 1

Chapter 1

Preamble

1.1 Introduction

With the development of enormous information investigation hardware, more

commitment has been paid to sickness desire from the impression of huge information

request, different investigates have been led by picking the highlights precisely from

countless to improve reality of threat grouping as opposed to the once chosen

physiognomies. In any case, those common work generally estimated organized

information.

As per a report by McKinsey, half of Americans have at least one perpetual illnesses, and

80% of American therapeutic consideration expense is spent on interminable infection

treatment. With the improvement of expectations for everyday comforts, the rate of

lung malady is expanding. The United States has spent a normal of 2.8 trillion USD every

year on endless sickness treatment.

This sum contains 18% of the whole yearly GDP of the United States. The medicinal

services issue of plant illnesses is additionally significant in numerous different nations.

With the development in restorative information, gathering electronic wellbeing records

(EHR) is progressively helpful.

Agricultural productivity is something on which economy highly depends. This is the one

of the reasons that disease detection in plants plays an important role in agriculture

field, as having disease in plants are quite natural. If proper care is not taken in this area

then it causes serious effects on plants and due to which respective product quality,

quantity or productivity is affected. For instance a disease named little leaf disease is a

hazardous disease found in pine trees in United States. Detection of plant disease

through some automatic technique is beneficial as it reduces a large work of monitoring

in big farms of crops, and at very early stage itself it detects the symptoms of diseases

i.e. when they appear on plant leaves. This paper presents an algorithm for image

segmentation technique which is used for automatic detection and classification of plant

leaf diseases. It also covers survey on different diseases classification techniques that

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 2

can be used for plant leaf disease detection. Image segmentation, which is an important

aspect for disease detection in plant leaf disease, is done by using genetic algorithm.

Agricultural productivity is that issue on that Indian Economy extremely depends. this is

often the one in all the explanations that malady detection in plants plays a very

important role in the agriculture field, as having the malady in plants are quite natural. If

correct care isn't taken during this space then it causes serious effects on plants and

because of that various product quality, amount or productivity is affected. Detection of

disease through some automatic technique is helpful because it reduces an oversized

work of watching in huge farms of crops, and at terribly early stage itself it detects the

symptoms of diseases means that after they seem on plant leaves. This paper presents a

neural network algorithmic program for image segmentation technique used for

automatic detection still as the classification of plants and survey on completely

different diseases classification techniques that may be used for plant leaf disease

detection. Image segmentation, that is a very important facet for malady detection in

plant disease, is completed by victimization genetic algorithmic program.

The aim of this study is to design, implement and evaluate an image -processing-

based software solution for automatic detection and classification of plant leaf

diseases. Studies show that relying on pure naked-eye observation of experts to

detect and classify such diseases can be prohibitively expensive, especially in

developing countries. Providing fast, automatic, cheap and accurate image-

processing-based solutions for that task can be of great realistic significance. The

methodology of the proposed solution is image-processing-based and is

composed of four main phases; in the first phase we create a color

transformation structure for the RGB leaf image and then, we apply device-

independent color space transformation for the color transformation structure.

Next, in the second phase, the images at hand are segmented using the K -means

clustering technique. In the third phase, we calculate the texture features for the

segmented infected objects. Finally, in the fourth phase the extracted features

are passed through a pre-trained neural network. As a testing step we use a set of

leaf images taken from Al-Ghor area in Jordan. Present experimental results

indicate that the proposed approach can significantly support an accurate and

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 3

automatic detection and recognition of leaf diseases. The developed Neural

Network classifier that is based on statistical classification perform well in all

sampled types of leaf diseases and can successfully detect and classify the

examined diseases with a precision of around 93%. In conclusion, the proposed

detection models based neural networks are very effective in recognizing leaf

diseases, whilst K-means clustering technique provides efficient results in

segmentation RGB images.

Plant diseases have turned into a nightmare as it can cause significant reduction

in both quality and quantity of agricultural products , thus negatively influence

the countries that primarily depend on agriculture in its economy . Consequently,

detection of plant diseases is an essential research topic as it may prove useful in

monitoring large fields of crops and thus automatically detect the symptoms of

diseases as soon as they appear on plant leafs.

Monitoring crops for to detecting diseases plays a key role in successful

cultivation (Babu and Srinivasa Rao, 2010; Camargo and Smith, 2009; Weizheng et

al., 2008). The naked eye observation of experts is the main approach adopted in

practice (Weizheng et al., 2008). However, this requires continuous monitoring of

experts which might be prohibitively expensive in large farms. Further, in

some developing countries, farmers may have to go long distances to contact

experts, this makes consulting experts to very expensive and time consuming

(Babu and Srinivasa Rao, 2010; Camargo and Smith, 2009). Therefore; looking for

a fast, automatic, less expensive and accurate method to detect plant disease

cases is of great realistic significance (Babu and Srinivasa Rao, 2010; Camargo and

Smith, 2009).

Studies show that image processing can successfully be used as a disease

detection mechanism (Weizheng et al., 2008; El-Hally et al., 2004). Since, the late

1970s, computer-based image processing technology applied in the agricultural

engineering research became a common (Weizheng et al., 2008; Moshashai et al.,

2008). In this study we propose and experimentally validate the significance of

using clustering techniques and neural networks (Soltanizadeh and Shahriar,

2008; Wakaf and Saii, 2009) in automatic detection of leaf diseases.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 4

The proposed approach is image-processing-based and is composed of four main

phases; in the first phase we create a color transformation structure for the RGB

leaf image and then, we apply device-independent color space transformation for

the color transformation structure. Next, in the second phase, the images at hand

are segmented using the K-Means clustering technique (Macqueen,

1967; Hartigan and Wong, 1979; Ali et al., 2009; Jun and Wang, 2008). In the third

phase, we calculate the texture features for the segmented infected objects.

Finally, in the fourth phase the extracted features are passed through a pre -

trained neural network. As a testbed we use a set of leaf images taken from Al-

Ghor area in Jordan. We test our program on five diseases which effect on the

plants; they are: Early scorch, Cottony mold, Ashen mold, late scorch and tiny

whiteness. Using the proposed framework, we could successfully detect and

classify the examined diseases with a precision of around 93% in average. The

minimum precision value was 80%.

Present experimental results indicate that the proposed approach can

significantly support accurate and automatic detection of leaf diseases.

1.2 Relevance of the project

The existing methodology for disease detection is a just optic observation by specialists

through that identification and detection of plant diseases is completed. For doing thus,

an oversized team of specialists still as continuous watching of specialists are needed,

that prices terribly high once farms are massive. At an equivalent time, in some

countries, farmers don’t have correct facilities or maybe concept that they'll contact

specialists. Because of that consulting specialists even price high still as time

overwhelming too. In such condition, the advised technique proves to be helpful in

watching massive fields of crops. And automatic detection of the diseases by simply

seeing the symptoms on the plant leaves makes it easier still as cheaper.

Leaf shape description is that the key downside in leaf identification. Up to now, several

form options are extracted to explain the leaf form. However, there's no correct

application to classify the leaf once capturing its image and identifying its attributes,

however. In plant leaf classification leaf is classed supported its completely different

morphological options. A number of the classification techniques used are :

Fuzzy Logic

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 5

Principal Component Analysis

K-Nearest Neighbor Classifier

Plant disease classification has wide application in Agriculture.

There are many techniques that are presently being utilized to make computer-based

vision systems victimization options of plants extracted from pictures as input

parameters to varied classifier systems. During this paper, a method to argument

already existing techniques of plant leaves identification system is represented. This

paper, a brand new classification model involving Neural Networks (NN) was utilized to

develop a pc primarily based vision system for automatic identification of plant species.

1.3 Purpose

The examination exactness is decreased when the nature of restorative information in

deficient.

Besides, various districts display one of a kind qualities of certain local ailments, which

may debilitate the expectation of infection episodes. In any case, those current work for

the most part viewed as organized information. There are no legitimate strategies to

deal with semi organized and unstructured. The proposed framework will consider both

organized and unstructured information. The investigation exactness is expanded by

utilizing Machine Learning calculations.

1.4 Scope of the project

With the development of enormous information investigation hardware, more

commitment has been paid to sickness desire from the impression of huge information

request, different investigates have been led by picking the highlights precisely from

countless to improve reality of threat grouping as opposed to the once chosen

physiognomies. In any case, those common work generally estimated organized

information.

As per a report by McKinsey, half of Americans have at least one perpetual illnesses, and

80% of American therapeutic consideration expense is spent on interminable infection

treatment. With the improvement of expectations for everyday comforts, the rate of

lung malady is expanding. The United States has spent a normal of 2.8 trillion USD every

year on endless sickness treatment.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 6

This sum contains 18% of the whole yearly GDP of the United States. The medicinal

services issue of plant illnesses is additionally significant in numerous different nations.

With the development in restorative information, gathering electronic wellbeing records

(EHR) is progressively helpful.

Agricultural productivity is something on which economy highly depends. This is the one

of the reasons that disease detection in plants plays an important role in agriculture

field, as having disease in plants are quite natural. If proper care is not taken in this area

then it causes serious effects on plants and due to which respective product quality,

quantity or productivity is affected. For instance a disease named little leaf disease is a

hazardous disease found in pine trees in United States. Detection of plant disease

through some automatic technique is beneficial as it reduces a large work of monitoring

in big farms of crops, and at very early stage itself it detects the symptoms of diseases

i.e. when they appear on plant leaves. This paper presents an algorithm for image

segmentation technique which is used for automatic detection and classification of plant

leaf diseases. It also covers survey on different diseases classification techniques that

can be used for plant leaf disease detection. Image segmentation, which is an important

aspect for disease detection in plant leaf disease, is done by using genetic algorithm.

Agricultural productivity is that issue on that Indian Economy extremely depends. this is

often the one in all the explanations that malady detection in plants plays a very

important role in the agriculture field, as having the malady in plants are quite natural. If

correct care isn't taken during this space then it causes serious effects on plants and

because of that various product quality, amount or productivity is affected. Detection of

disease through some automatic technique is helpful because it reduces an oversized

work of watching in huge farms of crops, and at terribly early stage itself it detects the

symptoms of diseases means that after they seem on plant leaves. This paper presents a

neural network algorithmic program for image segmentation technique used for

automatic detection still as the classification of plants and survey on completely

different diseases classification techniques that may be used for plant leaf disease

detection. Image segmentation, that is a very important facet for malady detection in

plant disease, is completed by victimization genetic algorithmic program.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 7

The aim of this study is to design, implement and evaluate an image -processing-

based software solution for automatic detection and classification of plant leaf

diseases. Studies show that relying on pure naked-eye observation of experts to

detect and classify such diseases can be prohibitively expensive, especially in

developing countries. Providing fast, automatic, cheap and accurate image -

processing-based solutions for that task can be of great realistic significance. The

methodology of the proposed solution is image-processing-based and is

composed of four main phases; in the first phase we create a color

transformation structure for the RGB leaf image and then, we apply device-

independent color space transformation for the color transformation structure.

Next, in the second phase, the images at hand are segmented using the K -means

clustering technique. In the third phase, we calculate the texture features for the

segmented infected objects. Finally, in the fourth phase the extracted features

are passed through a pre-trained neural network. As a testing step we use a set of

leaf images taken from Al-Ghor area in Jordan. Present experimental results

indicate that the proposed approach can significantly support an accurate and

automatic detection and recognition of leaf diseases. The developed Neural

Network classifier that is based on statistical classification perform well in all

sampled types of leaf diseases and can successfully detect and classify the

examined diseases with a precision of around 93%. In conclusion, the proposed

detection models based neural networks are very effective in recognizing leaf

diseases, whilst K-means clustering technique provides efficient results in

segmentation RGB images.

1.5 Problem definition

The social insurance networks / biomedical are unfit to foresee the malady dependent on

the patients tried information depictions. There is no precise examination of

restorative information benefits early infection recognition, persistent consideration,

and network administrations. We propose an image-processing-based solution for

the automatic leaf diseases detection and classification. We test our solution on

five diseases which effect on the plants. Those diseases are: (1) Early scorch, (2)

Cottony mold, (3) ashen mold, (4) late scorch and (5) tiny whiteness.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 8

The concept of automatic plants leaves-disease detection presented in the

following sections was developed on the plant leaves images acquired from Al -

Ghor area in Jordan. Detection and recognition of leaves diseases are like ly to

give better performance and can provide clues to treat the diseases in its early

stages. Visual interpretation of plant diseases manually is both inefficient and

difficult; also, it requires the expertise of trained botanist. A closer inspection of

the plant diseases images reveals several difficulties for the possible leaves

diseases detection.

1.6 Problem explanation

The developed system classifies the leafs at hand into infected and not -infected

classes. Compared to the work of Bauer et al. (2009), our systems can:

Identify disease type in addition to disease detection

Deal with more diseases

Be directly expanded to cover even more diseases

Detect diseases that infect plant leaves and stems. Our proposal can identify and

classify diseases that infect the stem part of plants as well as shows an example of

such infection cases

Weizheng et al. (2008), a fast and accurate new method is developed based on

computer image processing for grading of plant diseases. For that, leaf region

was segmented by using Otsu method (Sezgin and Sankur, 2004; Otsu, 1979).

After that the disease spot regions were segmented by using Sobel operator to

detect the disease spot edges. Finally, plant diseases are graded by calculating

the quotient of disease spot and leaf areas. Our proposal is different as it aims at

classifying diseased leafs based on disease type.

The proposed approach starts first by creating device-independent color space

transformation structure. Thus, we create the color transformation structure that

defines the color space conversion.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 9

The next step in our proposal is that we apply device-independent color space

transformation, which converts the color values in the image to the color space

specified in the color transformation structure. The color transformation

structure specifies various parameters of the transformation. A device dependent

color space is the one where the resultant color depends on the equipment used

to produce it. For example the color produced using pixel with a given RGB values

will be altered as the brightness and contrast on the se when the leaf is infected

.by more than one disease. K-means uses squared Euclidean distances.

The proposed approach starts first by creating device-independent color space

transformation structure. Thus, we create the color transformation structure that

defines the color space conversion. Then, we apply device-independent color

space transformation, which converts the color values in the image to the color

space specified in the color transformation structure. The color transformation

structure specifies various parameters of the transformation. Finally, K -means

clustering is used to partition the leaf image into four clusters in which one or

more clusters contain the disease in case when the leaf is infected by more than

one disease. K-means uses squared Euclidean distances.

1.7 Objective of the study

The concept of automatic plants leaves-disease detection presented in the following

sections was developed on the plant leaves images acquired from Al-Ghor area in

Jordan. Detection and recognition of leaves diseases are likely to give better

performance and can provide clues to treat the diseases in its early stages. Visual

interpretation of plant diseases manually is both inefficient and difficult; also, it requires

the expertise of trained botanist. A closer inspection of the plant diseases images reveals

several difficulties for the possible leaves diseases detection.

The method followed for extracting the feature set is called the color co-occurrence

method or CCM method in short. It is a method, in which both the color and texture of

an image are taken into account, to arrive at unique features, which represent that

image. Next we explain this method in more detailed.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 10

1.8 Existing system

In the field of agricultural information, the automatic identification and diagnosis of

maize leaf diseases is highly desired. To improve the identification accuracy of maize leaf

diseases and reduce the number of network parameters, the improved GoogLeNet and

Cifar10 models based on deep learning are proposed for leaf disease recognition in this

paper.

Maize leaf diseases have various symptoms. It may be more difficult for inexperienced

farmers to diagnose diseases than for professional plant pathologists . As a verification

system in disease diagnostics, an automatic system that is designed to identify plant

diseases by the plant’s appearance and visual symptoms could be of great help to

farmers.

Two improved models that are used to train and test nine kinds of maize leaf images are

obtained by adjusting the parameters, changing the pooling combinations, adding

dropout operations and rectified linear unit functions, and reducing the number of

classifiers. In addition, the number of parameters of the improved models is significantly

smaller than that of the VGG and AlexNet structures. During the recognition of eight

kinds of maize leaf diseases, the GoogLeNet model achieves a top - 1 average

identification accuracy of 98.9%, and the Cifar10 model achieves an average accuracy of

98.8%.

1.8.1 Limitations

The system which is implemented and is deployed across the country has certain

limitations such as: persistent consideration, and network administrations .

Be that as it may, supposedly, none of past work handle restorative content

information by CNN.

Moreover, there is a huge contrast between infections in various areas, basically in

light of the differing atmosphere and living propensities in the district.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 11

1.9 Proposed system

Identification of the plant diseases is the key to preventing the losses in the yield and

quantity of the agricultural product. The studies of the plant diseases mean the studies

of visually observable patterns seen on the plant. Health monitoring and disease

detection on plant is very critical for sustainable agriculture. It is very difficult to monitor

the plant diseases manually. It requires tremendous amount of work, expertize in the

plant diseases, and also require the excessive processing time. In most of the cases

disease symptoms are seen on the leaves, stem and fruit. The plant leaf for the

detection of disease is considered which shows the disease symptoms. The disease

causing agents in plants will be majorly defined as pathogens of any agent. The

symptoms diseased leaf image & then compared with normal leaf image. After feature

extraction is done, the learning database images are classified by using neural network.

These feature vectors are considered as neurons in ANN. The output of the neuron is the

function of weighted sum of the inputs. After extraction of features, the diseases are

identified with SVM classifier. Here Multiclass Support vector machines can be used for

classification of features extracted leaf images. In this Approach we have evident one of

the promising approach for the disease identification has been done using image

processing technique and remedy for the identified disease has been implemented. The

obtained results are to cluster the image segments and classify the image defect, and

measure the accuracy of affected areas in plant of these pathogenic agents will be

witnessed mostly in leaves, stem and in branches of the plants.

1.9.1 Advantages

The proposed system tackles the problems mentioned in the existing system such as:

User-Friendly.

Cheap and can be used without much investment.

Early detection of disease could yield more and reduce the loss.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 12

Chapter 2

Literature Survey

2.1 XIHAI ZHANG, YUE QIAO, FANFENG MENG, CHENGGUO FAN, AND MINGMING

ZHANG “Identification of Maize Leaf Diseases Using Improved Deep Convolutional Neural

Networks” *1+

In the field of agricultural information, the automatic identification and diagnosis of

maize

leaf diseases is highly desired. To improve the identification accuracy of maize leaf

diseases and reduce the number of network parameters, the improved GoogLeNet and

Cifar10 models based on deep learning are proposed for leaf disease recognition in this

paper.

Maize leaf diseases have various symptoms. It may be more difficult for inexperienced

farmers to diagnose diseases than for professional plant pathologists . As a verification

system in disease diagnostics, an automatic system that is designed to identify plant

diseases by the plant’s appearance and visual symptoms could be of great help to

farmers.

Two improved models that are used to train and test nine kinds of maize leaf images are

obtained by adjusting the parameters, changing the pooling combinations, adding

dropout operations and rectified linear unit functions, and reducing the number of

classifiers. In addition, the number of parameters of the improved models is significantly

smaller than that of the VGG and AlexNet structures. During the recognition of eight

kinds of maize leaf diseases, the GoogLeNet model achieves a top - 1 average

identification accuracy of 98.9%, and the Cifar10 model achieves an average accuracy of

98.8%.

Monzurul Islam, Anh Dinh, Khan Wahid, Pankaj Bhowmik, “Detection of Potato

Diseases Using Image Segmentation and Multiclass Support Vector Machine” [2]

Potato is one of the most significant food crops. The diseases causing substantial yield

loss in potato are Phytophthora infestans (late blight) and Alternaria solani (early blight).

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 13

Early detection of these diseases can allow to take preventive measures and mitigate

economic and production losses. Over the last decades, the most practiced approach for

detection and identification of plant diseases is naked eye observation by experts. But in

many cases, this approach proves unfeasible due to the excessive processing time and

unavailability of experts at farms located in the remote areas. Hence, the introduction of

image analysis tools turns out to be an effective method for continuous monitoring of

plant health status and early detection of plant diseases. As diseases leave some visible

symptoms on the plants, particular on leaves, disease detection can be performed by

imaging analysis of those visible patterns on leaves. Thus imaging technique combined

with machine learning offers a solution to the issue of agricultural productivity and

ensures food security. So the objective of this work is to develop imaging and machine

learning based effective and error-free disease detection system for plant.

Modern phenotyping and plant disease detection provide promising step towards food

security and sustainable agriculture. In particular, imaging and computer vision based

phenotyping offers the ability to study quantitative plant physiology. On the contrary,

manual interpretation requires tremendous amount of work, expertise in plant diseases,

and also requires excessive processing time. In this work, we present an approach that

integrates image processing and machine learning to allow diagnosing diseases from leaf

images. This automated method classifies diseases (or absence thereof) on potato plants

from a publicly available plant image database called ‘Plant Village’. Our segmentation

approach and utilization of support vector machine demonstrate disease classification

over 300 images with an accuracy of 95%.

Huu Quan Cap, Katsumasa Suwa, Erika Fujita, Satoshi Kagiwada, Hiroyuki Uga, Hitoshi

Iyatomi, “A Deep Learning Approach for on-site Plant Leaf Detection” [3]

Plants have been faced with many dangerous diseases which cause a serious reduction

in quality and quantity of agriculture products. Therefore, detecting and preventing

plant diseases promptly is essential to resolve this issue. In general, plant diagnosis is

performed with visual inspection by experts and biological examination is second choice

if needed. They are usually expensive and time-consuming. Several computer-based

methodologies have been applied to detect plant diseases based on their leaf images.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 14

Plant diseases are the major problem in the worldwide agriculture sector. Therefore, the

early detection is essential for reducing economic losses and mitigating the seriousness

of the global food problem. Some fast and accurate computer-based methods have been

applied to detect plant diseases. However, as far as our best knowledge, all those

methodologies only accept a narrow range image, typically one or limited number of

target(s) are in the image frame as their input. Thus, they are time-consuming and

difficult to be applied for onsite wide range images (e.g. images or videos from

stationary surveillance camera). In this paper, authors propose leaf localization method

from on-site wide-angle images with a deep learning approach. Our method achieves a

detection performance of 78.0% in F1-measure at 2.0 fps.

Wenjiang Huang, Qingsong Guan, Juhua Luo, Jingcheng Zhang, Jinling Zhao, Dong

Liang, Linsheng Huang, and Dongyan Zhang, “New Optimized Spectral Indices for

Identifying and Monitoring Winter Wheat Diseases” [4]

The vegetation indices from hyper spectral data have been shown for indirect

monitoring of plant diseases. But they cannot distinguish different diseases on crop.

Wenjiang Huang et al developed the new spectral indices for identifying the winter

wheat disease. They consider three different pests (Powdery mildew, yellow rust and

aphids) in winter wheat for their study. The most and the least relevant wavelengths for

different diseases were extracted using RELIEF-F algorithm.

The classification accuracies of these new indices for healthy and infected leaves with

powdery mildew, yellow rust and aphids were 86.5%, 85.2%, 91.6% and 93.5%

respectively [1].

Monica Jhuria, Ashwani Kumar, and Rushikesh Borse, “Image Processing For Smart

Farming: Detection Of Disease And Fruit Grading” [5]

Authors uses image processing for detection of disease and the fruit grading in [2]. They

have used artificial neural network for detection of disease. They have created two

separate databases, one for the training of already stored disease images and other for

the implementation of the query images. Back propagation is used for the weight

adjustment of training databases. They consider three feature vectors, namely, color,

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 15

textures and morphology [2]. They have found that the morphological feature gives

better result than the other two features.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 16

Chapter 3

System Requirement Specification

Image processing is a method to convert an image into digital form and perform

some operations on it, in order to get an enhanced image or to extract some useful

information from it. It is a type of signal dispensation in which input is image, like

video frame or photograph and output may be image or characteristics associated

with that image. Usually Image Processing system includes treating images as two

dimensional signals while applying already set signal processing methods to them. It is

among rapidly growing technologies today, with its applications in various aspects of a

business. Image Processing forms core research area within engineering and computer

science disciplines too.

3.1 General Description of the System

Image processing is a method to convert an image into digital form and perform

some operations on it, in order to get an enhanced image or to extract some useful

information from it. It is a type of signal dispensation in which input is image, like

video frame or photograph and output may be image or characteristics associated

with that image.

Usually Image Processing system includes treating images as two dimensional

signals while applying already set signal processing methods to them. It is among rapidly

growing technologies today, with its applications in various aspects of a business. Image

Processing forms core research area within engineering and computer science

disciplines too.

Output is the last stage in which result can be altered image or report that is based on image

analysis.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 17

Intel 2.21 GHz.

40 GB. ➢ Hard Disk

➢ Floppy Drive

➢ Monitor

➢ Mouse

1.44 Mb.

15 VGA Colour.

Logitech.

➢ Platform

➢ Language

➢ IDE/Tool

:

:

: MATLAB 2010Ra

3.1.2 Overview of Data Requirements

To achieve the objectives and benefits expected from the computer based system, it is essential for

people who will be involved to be confident of their role in the new system. This involves them in

understanding the overall system. As the system becomes more complex the need for education and

training is more important. Education of the user should really have taken place much earlier in the

project when they were being involved in the investigation and design work. Once staff has been

trained the system can be tested.

3.2 Technical Requirements of the System

3.2.1 Hardware Requirements

➢ System :

:

:

:

:

:

.

3.2.2 Software Requirements

MATLAB

Windows 7

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 18

3.3 Input Requirements

The input Design is the process of converting the user-oriented inputs in to the computer-

based format. The goal of designing input data is to make the automation as easy and free

from errors as possible. The input design requirements such as user friendliness, consistent

format and interactive dialogue for giving the right message and help for the user at right

time is also considered as an important aspect for the development of the project. Input

design is a major part of overall system design which requires very careful attention.

3.4 Output Requirements

During output design process, developers identify what kind of output is needed. We get

the quality output by presenting the information clearly to the end user so that it meets the

requirements of the end user. Results of the processing are communicated to the users and

to other systems through outputs. It is most important and direct source information to the

user. Efficient and intelligent output improves the systems relationship with source and

destination machine. Objective of the output design is to develop the output design that

meets the end user requirements and to make the output available on time for making the

good decisions.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 19

Fig:3.4.1 Snapshot of Eclipse.

3.5 Language Specification

3.5.1 JDK 1.7

Java is the first programming language designed from ground up with network

programming in mind. The core API for Java includes classes and interfaces that provide

uniform access to a diverse set of network protocols. As the Internet and Network

programming has evolved, java has maintained its cadence. New APIs and toolkit have

expanded the available options for the java network programmer. Java is both a

programming language and an environment for executing programs written in java

language.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 20

Fig:3.5.1 Working of java.

The following figure illustrates how this works.

We can think of Java byte codes as the machine code instructions for the Java

Virtual Machine (Java VM). Every Java interpreter, whether it’s a development tool

or a Web browser that can run applets, is an implementation of the Java VM. Java

byte codes help make “write once, run anywhere” possible. You can compile your

program into byte codes.

On any platform that has a Java compiler, the byte codes can then be run on

any implementation of the Java VM. That means that as long as a computer has a Java

VM, the same program written in the Java programming language.

Java byte codes are the platform-independent codes interpreted by the interpreter on the

Java platform. The interpreter parses and runs each Java byte code instruction on the

computer. Compilation happens just once; interpretation occurs each time the program is

executed.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 21

3.5.2 Eclipse SDK Features

Eclipse & Android SDK Tools are an integrated development environment (IDE) for

visually designing, constructing, testing, and deploying Web services, portals, and

Java (J2EE) applications. Eclipse SDK 4.0 (based on e4 technology) is the next

generation platform for building Eclipse-based rich client desktop applications. This

new release makes it easier for developers to develop and assemble application and

tools based on the Eclipse platform.

Figure 3.5.2 Java compiler

In computer programming Eclipse does a multi-language I integrated

development environment (IDE) comprise a base workspace and an extensible

plug-in system for customizing the environment. It is written mostly in Java. It can

be used to develop applications in Java and, by means of various plug-INS, other

programming language including Ada, C, C++, COBOL, FORTRAN, Haskell, JavaScript,

Lasso, Perl, PHP, Python, Ruby, Scala, Clojure, Groovy, Scheme, and Erlang. It can also

be used to develop packages for the software Mathematical.

Development environments include the Eclipse Java development tools (JDT) for Java and

Scala, Eclipse CDT for C/C++ and Eclipse PDT for PHP, among others. The initial

codebase originated from IBM Visual Age. The Eclipse software development kit (SDK),

which includes the Java development tools, is meant for Java developers. Users can

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 22

extend its abilities by installing plug-ins written for the Eclipse Platform, such as

development toolkits for other programming languages, and can write and contribute

their own plug-in modules. Released under the terms of the Eclipse Public License,

Eclipse SDK is free and open source software (although it is incompatible with the GNU

General Public License). It was one of the first IDEs to run under GNU Class path and

it runs without problems under Iced Tea.

SUMMARY

The main aim of this chapter is to find out whether the system is feasible enough or

not. For these reasons different kinds of System specification, such as functional

requirements, Data requirements, Input requirements, Output requirements And

Language being used.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 23

CHAPTER 4

SYSTEM DESIGN AND ANALYSIS

4.1 Preliminary Design

The system Design is defined as “The process of applying various techniques and principles

for the purpose of defining a process or a system in sufficient detail to permit its

physical realization”. Various design features are followed to develop the system.

The design specification describes the features of the system, the components or

elements of the system and their appearance to end-users.

4.2 System Architecture

System architecture is the conceptual design that defines the structure and behavior

of a system. An architecture description is a formal description of a system, organized in

a way that supports reasoning about the structural properties of the system. It defines

the system components or building blocks and provides a plan from which products can

be procured, and systems developed, that will work together to implement the overall

system.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 24

The System architecture is shown below.

Feature

Extraction and

Selection

Feature

Extraction and

Selection

Neural Network

Input File Training Model Classification

Input Leaf

Training Leaf

Dataset

Feature

Storage

Classified Leaf

Disease

Fig:4.2.1-System Architecture

At first the original image which is browsed being split into block images. The block

images are formed by read image function which takes random numbers in initial using

MATLAB process, the matrix under image functions are transformed in pixel and then

encoded in binary format. The encoded image will generate a encrypted image using

Linear Equation Algorithm.

4.3 Data Flow Diagram of the system

A data-flow diagram (DFD) is a graphical representation of the "flow" of data through an

information system. DFDs can also be used for the visualization of data processing

(structured design). On a DFD, data items flow from an external data source or an

internal data store to an internal data store or an external data sink, via an internal

process.

4.3.1 Level 0 Data flow diagram

A context-level or level 0 data flow diagram shows the interaction between the system

and external agents which act as data sources and data sinks. On the context diagram

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 25

(also known as the Level 0 DFD) the system's interactions with the outside world are

modeled purely in terms of data flows across the system boundary. The context diagram

shows the entire system as a single process, and gives no clues as to its internal

organization

Leaf Disease

Dataset

Clasisfication

1.0

Classified

disease

4.3.2 Level 1 Data flow diagram

The Level 1 DFD shows how the system is divided into sub-systems (processes), each of

which deals with one or more of the data flows to or from an external agent, and which

together provide all of the functionality of the system as a whole.

Use case Diagram of the system

A use case diagram is a type of behavioral diagram created from a Use-case analysis. Its

purpose is to present a graphical overview of the functionality provided by a system.

Feature selection

Admin

Load Input and Leaf

Dataset

Classify Leaf Disease

Fig:4.3.1- Use case Diagram

This chapter mainly concentrates on system architecture, sequence diagram, use-case

diagram, data flow diagram etc.

Summary

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 26

CHAPTER 5

IMPLEMENTATION

The implementation phase involves the actual materialization of the ideas, which

are expressed in the analysis document and developed in the design phase.

Implementation should be perfect mapping of the design document in a suitable

programming language in order to achieve the necessary final product. Often the

product is ruined due to incorrect programming language chosen for implementation or

unsuitable method of programming.

It is better for the coding phase to be directly linked to the design phase in the sense if

the design is in terms of object oriented terms then implementation should be preferably

carried out in a object oriented way.

The implementation involve:

1.Careful planning

2. Investigation of the current system and the constraints on implementation.

3. Training of staff in the newly developed system.

Implementation of any software is always preceded by important decisions

regarding selection of the platform, the language used, etc. these decisions are often

influenced by several factors such as real environment in which the system works,

the speed that is required, the security concerns, and other implementation specific

details. There are three major implementation decisions that have been made before

the implementation of this project. They are as follows:

1.Selection of the platform (Operating System).

2. Selection of the programming language for development of the application.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 27

3. Coding guideline to be followed.

Algorithm steps for Image Processing

Digital image processing allows the use of much more complex algorithms, and hence,

can offer both more sophisticated performance at simple tasks, and the implementation

of methods which would be impossible by analog means.

In particular, digital image processing is the only practical technology for:

Classification

Feature extraction

Multi-scale signal analysis

Pattern recognition

Projection

Digital filters are used to blur and sharpen digital images. Filtering can be performed by:

convolution with specifically designed kernels (filter array) in the spatial domain

masking specific frequency regions in the frequency (Fourier) domain.

In computer science, digital image processing is the use of computer algorithms to perform image

processing on digital images.[1] As a subcategory or field of digital signal processing, digital image

processing has many advantages over analog image processing. It allows a much wider range of

algorithms to be applied to the input data and can avoid problems such as the build-up of noise and

signal distortion during processing. Since images are defined over two dimensions (perhaps more)

digital image processing may be modelled in the form of multidimensional systems.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 28

5.2 Functional Description of the module

Raw data is commonly presented in graphical form in published literature. Often

authors may be in need to source data from such publications. The raw research data

is normally not available to fellow researchers due to non availability of data itself or

lack of interest of the author to share the data. Presently many software tools are

available for extracting the data from the graphs. But the user has to manually select the

points where the data is to be extracted. Few automation features provided in the tools

are time consuming and need post processing to eliminate the errors in data

extraction. An image processing based algorithm is developed to automatically

extract the data from the graphs with minimal inputs by the user. The tests on the

developed tool shows that the extracted data is close to the raw data with error less

than 1%. The results are motivating enough to upgrade the developed algorithm with

more features.

5.2.1 Data Pre-processing

Pre-processing is a common name for operations with images at the lowest level of

abstraction -- both input and output are intensity 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.

Four categories of image pre-processing methods according to the size of the pixel

neighbourhood that is used for the calculation of a new pixel brightness:

Pixel brightness transformations, Geometric transformations, Pre-processing methods

that use a local neighbourhood of the processed pixel, Image restoration that requires

knowledge about the entire image.

Other classifications of image pre-processing methods exist.

Image Restoration is the operation of taking a corrupt/noisy image and estimating the

clean, original image. Corruption may come in many forms such as motion blur, noise and

camera mis-focus. Image restoration is performed by reversing the process that blurred

the image and such is performed by imaging a point source and use the point source

image, which is called the Point Spread Function (PSF) to restore the image information

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 29

lost to the blurring process.

The objective of image restoration techniques is to reduce noise and recover resolution

loss. Image processing techniques are performed either in the image domain or the

frequency domain. The most straightforward and a conventional technique for

image restoration is de-convolution, which is performed in the frequency domain

and after computing the Fourier transform of both the image and the PSF and undo

the resolution loss caused by the blurring factors. This de-convolution technique,

because of its direct inversion of the PSF which typically has poor matrix condition

number, amplifies noise and creates an imperfect de-blurred image. Also,

conventionally the blurring process is assumed to be shift-invariant. Hence more

sophisticated techniques, such as regularized de-blurring, have been developed to offer

robust recovery under different types of noises and blurring functions.

5.2.2 Clustering of the data

Image segmentation is one of the mostly used methods to classify the pixels of an

image correctly in a decision oriented application. It divides an image into a number of

discrete regions such that the pixels have high similarity in each region and high contrast

between regions. It is a valuable tool in many field including health care, image

processing, traffic image, pattern recognition etc. There are different techniques for

image segmentation like threshold based, edge based, cluster based, neural network

based1. From the different technique one of the most efficient methods is the

clustering method. Again there are different types of clustering: K-means clustering,

Fuzzy C-means clustering, mountain clustering method and subtractive clustering

method.

One of most used clustering algorithm is k-means clustering. It is simple and

computationally faster than the hierarchical clustering. And it can also work for

large number of variable. But it produces different cluster result for different number of

number of cluster. So it is required to initialize the proper number of number of cluster,

k2. Again, it is required to initialize the k number of centroid. Different value of initial

centroid would result different cluster. So selection of proper initial centroid is also an

important task. Nowadays image segmentation becomes one of important tool in

medical area where it is used to extract or region of interest from the background. So

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 30

medical images are segmented using different technique and process outputs are used

for the further analysis in medical.

But medical images in their raw form are represented by the arrays of numbers in

the computer3, with the number indicating the values of relevant physical quantities that

show contrast between different types of body parts.

Although k-means has the great advantage of being easy to implement, it has some

drawbacks. The quality of the final clustering results is depends on the arbitrary

selection of initial centroid. So if the initial centroid is randomly chosen, it will get

different result for different initial centers.

So the initial center will be carefully chosen so that we get our desire segmentation.

And also computational complexity is another term which we need to consider while

designing the K-means clustering. It relies on the number of data elements, number of

clusters and number of iteration.

The segmented an image by using k-clustering algorithm, using subtractive cluster to

generate the initial centroid. At the same time partial contrast stretching is used to

improve the quality of original image and median filter is used to improve segmented

image. And the final segmented result is compare with k-means clustering algorithm

and we can conclude that the proposed clustering algorithm has better segmentation.

The output images are also tune by varying the hyper sphere cluster radius and we can

conclude from that result that by varying the hyper sphere cluster radius we can get

different output. And so we should take the value of hyper sphere cluster very

carefully. Finally RMSE and PSNR are checked and observed that they have small and

large value respective, which are the condition for good image segmentation quality.

And comparison for RMSE and PSNR are done for proposed method and classical K-

means algorithm and it is found that the proposed method have better performance

result. In the future, we can improve the quality of the output image more by using

the morphological operation and get better performance measurement. We can also

implement different clustering method using subtractive clustering algorithm. And

lastly we can implement and analyze in different areas of image segmentation.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 31

5.2.3 Classification of Data

Classification includes a broad range of decision-theoretic approaches to the

identification of images (or parts thereof). All classification algorithms are based on the

assumption that the image in question depicts one or more features (e.g., geometric

parts in the case of a manufacturing classification system, or spectral regions in the

case of remote sensing, as shown in the examples below) and that each of these

features belongs to one of several distinct and exclusive classes. The classes may be

specified a priori by an analyst (as in supervised classification) or automatically

clustered (i.e. as in unsupervised classification) into sets of prototype classes, where

the analyst merely specifies the number of desired categories. (Classification and

segmentation have closely related objectives, as the former is another form of

component labelling that can result in segmentation of various features in a scene.)

The description of training classes is an extremely important component of

the classification process. In supervised classification, statistical processes (i.e. based on

an a priori knowledge of probability distribution functions) or distribution-free processes

can be used to extract class descriptors. Unsupervised classification relies on clustering

algorithms to automatically segment the training data into prototype classes. In

either case, the motivating criteria for constructing training classes is that they are:

i) independent, i.e. a change in the description of one training class

should not change the value of another,

ii) discriminatory, i.e. different image features should have

significantly different descriptions, and

iii) definitive descriptions of that group

Classification between the objects is easy task for humans but it has proved to be a

complex problem for machines. The raise of high-capacity computers, the availability of

high quality and low-priced video cameras, and the increasing need for automatic

video analysis has generated an interest in object classification algorithms. A simple

classification system consists of a camera fixed high above the interested zone, where

images are captured and consequently processed. Classification includes image

sensors, image pre-processing, object detection, object segmentation, feature

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 32

extraction and object classification. Classification system consists of database that

contains predefined patterns that compares with detected object to classify in to

proper category. Image classification is an important and challenging task in various

application domains, including biomedical imaging, biometry, video surveillance,

vehicle navigation, industrial visual inspection, robot navigation, and remote

sensing.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 33

5.3 Flowchart of Proposed System

A flowchart is a type of diagram that represents an algorithm, workflow or

process. Flowchart can also be defined as a diagrammatic representation of an

algorithm (step by step approach to solve a task).

The flowchart shows the steps as boxes of various kinds, and their order by connecting

the boxes with arrows. This diagrammatic representation illustrates a solution

model to a given problem. Flowcharts are used in analyzing, designing, documenting

or managing a process or program in various fields.

Flowcharts are used in designing and documenting simple processes or programs.

Like other types of diagrams, they help visualize what is going on and thereby help

understand a process, and perhaps also find less-obvious features within the

process, like flaws and bottlenecks. There are different types of flowcharts: each type

has its own set of boxes and notations. The two most common types of boxes in a

flowchart are:

• A processing step, usually called activity, and denoted as a rectangular box.

• A decision, usually denoted as a diamond.

Flowcharts depict certain aspects of processes and are usually complemented by other

types of diagram. For instance, Kaoru Ishikawa, defined the flowchart as one of the

seven basic tools of quality control, next to the histogram, Pareto chart, check

sheet, control chart, cause-and-effect diagram, and the scatter diagram. Similarly, in

UML, a standard concept-modelling notation used in software development, the

activity diagram, which is a type of flowchart, is just one of many different

diagram types. Nassi-Shneiderman diagrams and Drakon-charts are an alternative

notation for process flow Common alternative names include: flow chart, process

flowchart, functional flowchart, process map, process chart, functional process chart,

business process model, process model, process flow diagram, work flow diagram,

business flow diagram. The terms "flowchart" and "flow chart" are used

interchangeably.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 34

CHAPTER 6

EXPERIMENTAL RESULTS

6.1 Outcomes of the Proposed System

Screenshot 1:

Fig:6.2.1-To Browse the Image which has to be classified

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 35

Screenshot 2:

Fig:6.2.2-Enhancement of the Image

Screenshot 3:

Fig:6.2.3- Segmentation and Classification of the Image

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 36

Screenshot 4 :

Fig:6.2.4- Accuracy of the Classification

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 37

CHAPTER 7

TESTING

Testing is an important phase in the development life cycle of the product. This is

the phase, where the remaining errors, if any, from all the phases are detected. Hence

testing performs a very critical role for quality assurance and ensuring the

reliability of the software.

During the testing, the program to be tested was executed with a set of test cases and

the output of the program for the test cases was evaluated to determine whether the

program was performing as expected. Errors were found and corrected by using the

below stated testing steps and correction was recorded for future references. Thus, a

series of testing was performed on the system, before it was ready for implementation.

It is the process used to help identify the correctness, completeness, security, and

quality of developed computer software. Testing is a process of technical investigation,

performed on behalf of stake holders, i.e. intended to reveal the quality-related

information about the product with respect to context in which it is intended to operate.

This includes, but is not limited to, the process of executing a program or application

with the intent of finding errors.

The quality is not an absolute; it is value to some person. With that in mind, testing

can never completely establish the correctness of arbitrary computer software;

Testing furnishes a ‘criticism’ or comparison that compares the state and behaviour of

the product against specification. An important point is that software testing should be

distinguished from the separate discipline of Software Quality Assurance (SQA), which

encompasses all business process areas, not just testing.

There are many approaches to software testing, but effective testing of complex

products is essentially a process of investigation not merely a matter of creating and

following routine procedure. Although most of the intellectual processes of testing

are nearly identical to that of review or inspection, the word testing is connoted to

portability, maintainability, compatibility and usability.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 38

7.1 Testing and Validation

At a high level, software testing is needed in order to detect the bugs in the software and

to test if the software meets the customer’s requirements. This helps the

development team to fix the bugs and deliver a good quality product. There are several

points in the software development process where human error can lead to software

that does not meet customer’s requirements. Some of them are listed below.

Customer / person providing the requirements on behalf of the customer

organization may not know what exactly is required or may forget to provide some

details, which may lead to missing features.

The person who is gathering the requirements may misinterpret or completely miss a

requirement when document them.

During the design phase, if there are issues in design, it may lead to bugs in future

Bugs may be introduced during development phase during to human error, lack of

expertise etc.

Testers can miss bugs during testing phase due to human error, lack of time, insufficient

experience etc.

Users may prefer to buy a competing product over a product that has poor quality and

this can result in loss of revenue for the organization. In today’s world, quality is one of

the top priorities for any organization.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 39

7.2 Validation

Validation is the process of evaluating the final product to check whether the

software meets the customer expectations and requirements. It is a dynamic

mechanism of validating and testing the actual product.

V- model means Verification and Validation model. Just like the waterfall model, the V-

Shaped life cycle is a sequential path of execution of processes. Each phase must

be completed before the next phase begins. V-Model is one of the many

software development models. Testing of the product is planned in parallel with a

corresponding phase of development in V-model.

Fig 7.1 V-Model phase

The various phases of the V-model are as follows :

Requirements like BRS and SRS begin the life cycle model just like the waterfall model.

But, in this model before development is started, a system test plan is created.

The test plan focuses on meeting the functionality specified in the requirements

gathering.

The high-level design (HLD) phase focuses on system architecture and design. It

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 40

provides overview of solution, platform, system, product and service/process. An

integration test plan is created in this phase as well in order to test the pieces of the

software systems ability to work together. The low-level design (LLD) phase is where

the actual software components are designed. It defines the actual logic for each and

every component of the system.

The implementation phase is, again, where all coding takes place. Once coding is

complete, the path of execution continues up the right side of the V where the test

plans developed earlier are now put to use.

Coding: This is at the bottom of the V-Shape model. Module design is converted into

code by developers. Unit Testing is performed by the developers on the code written by

them.

Acceptance Testing is a level of software testing where a system is tested for

acceptability. The purpose of this test is to evaluate the system’s compliance with the

business requirements and assess whether it is acceptable for delivery.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 41

7.2 Testing Levels

7.2.1 Functional Testing

Functional Testing is a type of software testing whereby the system is tested against

the functional requirements/specifications. Functions (or features) are tested by

feeding them input and examining the output. Functional testing ensures that the

requirements are properly satisfied by the application. This type of testing is not

concerned with how processing occurs, but rather, with the results of processing. It

simulates actual system usage but does not make any system structure assumptions.

During functional testing, Black Box Testing technique is used in which the internal logic

of the system being tested is not known to the tester. Functional testing is

normally performed during the levels of System Testing and Acceptance Testing.

Typically, functional testing involves the following steps:

Identify functions that the software is expected to perform.

Create input data based on the function’s specifications.

Determine the output based on the function’s specifications.

Execute the test case.

Functional testing is more effective when the test conditions are created directly

from user/business requirements. When test conditions are created from the

system documentation (system requirements/ design documents), the defects in that

documentation will not be detected through testing and this may be the cause of end-

users wrath when they finally use the software.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 42

7.2.2 Non-Functional Testing

Non-functional testing is defined as a type of Software testing to check non-

functional aspects (performance, usability, reliability etc) of a software application. It is

designed to test the readiness of a system as per non-functional parameters which are

never addressed by functional testing.

7.2.3 Testing and validation

Testing is the most important part of the software development process. Some of the

reasons for its importance are as follows:

Testing helps find the bugs in the software which prevent the program from performing

the required tasks. Bug fixing in the early stages helps to save a lot of time. Testing is

essential to ensure that the product will work well once deployed.

Testing improves the quality of the software.

Validation is the process of ensuring that the software built is in accordance with the

business requirements. It assures customer satisfaction.

7.2.4 Testing Levels

Fig.7.1. Represents different levels of testing during the SDLC.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 43

7.2.5 Functional testing

This type of testing is done against the functional requirements of the project.

Types:

Unit testing: Each unit /module of the project is individually tested to check for bugs. If

any bugs found by the testing team, it is reported to the developer for fixing.

Integration testing: All the units are now integrated as one single unit and checked for

bugs. This also checks if all the modules are working properly with each other.

System testing: This testing checks for operating system compatibility. It includes both

functional and non-functional requirements.

Sanity testing: It ensures change in the code doesn’t affect the working of the project.

Smoke testing: this type of testing is a set of small tests designed for each build.

Interface testing: Testing of the interface and its proper functioning.

Regression testing: Testing the software repetitively when a new requirement is added,

when bug fixed etc.

Beta/Acceptance testing: User level testing to obtain user feedback on the product.

7.2.6 Testing

This type of testing is mainly concerned with the non-functional requirements such as

performance of the system under various scenarios.

Performance testing: Checks for speed, stability and reliability of the software, hardware

or even the network of the system under test.

Compatibility testing: This type of testing checks for compatibility of the system with

different operating systems, different networks etc.

Localization testing: This checks for the localized version of the product mainly

concerned with UI.

Security testing: Checks if the software has vulnerabilities and if any, fix them.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 44

Reliability testing: Checks for the reliability of the software

Stress testing: This testing checks the performance of the system when it is exposed to

different stress levels.

Usability testing: Type of testing checks the easily the software is being used by the

customers.

Compliance testing: Type of testing to determine the compliance of a system with

internal or external standards.

7.3 White box testing

White box testing is performed by the developer while developing the various modules

for the software. This type requires thorough knowledge about the software i.e. the

internal logic in the program that is used and the structure of the code used in the

program.

7.4 Unit testing

Unit Testing is the very first level of testing of the software where the minute testable

parts of a newly finished software parts are tested. This is used to validate that each unit

of the software performs as designed.

Fig 7.4: Unit Testing

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 45

Method:

The testing method used for Unit testing is White Box testing method .

OOP concepts supported by unit test framework:

testcase:

A test case is a set of conditions which is used to determine whether a system under test

works correctly.

Examples :

Creating temporary databases.

Starting a server process

testsuite:

Test suite is a collection of testcases that are used to test a software program to show

that it has some specified set of behaviours by executing the aggregated tests together.

testrunner:

A test runner is a component which set up the execution of tests and provides the

outcome to the user.

The Unit test framework of python can be used to convert the decision table test cases

that we use, to carry out testing on the unit by providing input and verifying the output

manually into automated testing.

7.5 Integration testing

Integration Testing is a software test level that combines and tests individual units as a

group. The purpose of this test level is to identify errors in the interaction of integrated

units. In Integration Testing, test drivers and test stubs are used to assist.

Testing the interfaces between units / modules is the main function or goal of this test.

We normally do Integration testing after “Unit testing”. Once all the individual units are

created and tested, we start combining those “Unit Tested” modules and start doing the

integrated testing. The main function or goal of this testing is to test the interfaces

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 46

between the units/modules. The individual modules are first tested in isolation. Once

the modules are unit tested, they are integrated one by one, till all the modules are

integrated, to check the combinational behaviour, and validate whether the

requirements are implemented correctly or not.

Here we should understand that integration testing does not take place at the end of the

cycle, but is carried out at the same time as the development. So most of the time, not

all the modules are available for testing and here's what the challenge is to test.

Fig.7.3. Architecture of a web application taken as example

UI – User Interface module, which is visible to the end user, where all the inputs are

given.

BL – Is the Business Logic module, which has all the all the calculations and business

specificmethods.

VAL – Is the Validation module that has all the input correctness validations.

CNT– Is the content module that has all the static content specific to the user's inputs.

EN – Is the Engine module, this module reads all the data that comes from BL, VAL and

CNT module and extracts the SQL query and triggers it to the database.

Scheduler – Is a module that schedules all reports (monthly, quarterly, semi-annually &

annually) based on user selection

DB – Is the Database.

Now, having seen the architecture of the entire web application, as a single unit,

Integration testing, in this case, will focus on the flow of data between the modules.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 47

The questions here are:

How the BL, VAL and the CNT module will read and interpret ate the data entered in the

UI module?

Is BL, VAL and CNT module receiving the correct data from UI?

In which format the data from BL, VAL and CNT is transferred to the EQ module?

How will the EQ read the data and extract the query?

Is the query extracted correctly?

Is the Scheduler getting the correct data for reports?

Is the result set received by the EN, from the database is correct and as expected?

Is EN able to send the response back to the BL, VAL and CNT module?

Is UI module able to read the data and display it appropriately to the interface?

Big bang integration testing was carried out to test the flow of data and interactions

between the modules in the project.

Fig.7.4 Represents big bang approach

As the project was demonstrated as a prototype big bang approach is the one that was

well- suited to test small systems.

Integration Testing approach:

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 48

Bottom-up approach

Fig.7.5. Represents bottom-up approach of integration testing

As the name suggests, bottom-up testing starts from the application's lowest or

innermost unit and gradually moves up. Integration testing begins with the lowest

module and progresses gradually towards the application's upper modules. This

integration continues until all modules are integrated and tested as a single unit for the

entire application.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 49

7.6 System testing

System Testing is a software test level that tests a complete and integrated software.

This test is intended to evaluate the compliance of the system with the specified

requirements. Testing system requirements: The agenda is to test if the system serves

the initial requirements stated, as in:

The route to be input to the module

The dynamic toll to be generated based on the occupancy and the route chosen if, car

else just consider the route chosen and the type of the vehicle.

Based on the time stamp query the database to know if its one-way or two-way trip and

determine the toll.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 50

Chapter 8

Conclusion and Future Enhancements

8.1Conclusion

The studies of the plant diseases mean the studies of visually observable patterns seen

on the plant. Health monitoring and disease detection on plant is very critical for

sustainable agriculture. It is very difficult to monitor the plant diseases manually. It

requires tremendous amount of work, expertize in the plant diseases, and also require

the excessive processing time. In most of the cases disease symptoms are seen on the

leaves, stem and fruit. The plant leaf for the detection of disease is considered which

shows the disease symptoms. The disease causing agents in plants will be majorly

the viruses. Therefore, for effective and successful crop cultivation, the disease diagnosis

and the percentage of disease affected in plants are mandatory. Existing system has only

detection with less accuracy since we are using artificial neural network which gives us

accurate result for detection. The proposed system deals with the image processing,

which is used for the detection of plant diseases. Disease detection involves the steps

like image acquisition, image pre-processing, image segmentation, feature extraction

and classification. The feature extraction such as colour, texture are extracted from

diseased leaf image & then compared with normal leaf image. After feature extraction

is done, the learning database images are classified by using neural network. These

feature vectors are considered as neurons in ANN. The output of the neuron is the

function of weighted sum of the inputs. After extraction of features, the diseases are

identified with SVM classifier. Here Multiclass Support vector machines can be used for

classification of features extracted leaf images. In this Approach we have evident one of

the promising approach for the disease identification has been done using image

processing technique and remedy for the identified disease has been implemented. The

obtained results are to cluster the image segments and classify the image defect, and

measure the accuracy of affected areas in plant.

Identification of the plant diseases is the key to preventing the losses in the yield and

quantity of the agricultural product. The studies of the plant diseases mean the studies

of visually observable patterns seen on the plant. Health monitoring and disease

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 51

detection on plant is very critical for sustainable agriculture. It is very difficult to monitor

the plant diseases manually. It requires tremendous amount of work, expertize in the

plant diseases, and also require the excessive processing time. In most of the cases

disease symptoms are seen on the leaves, stem and fruit. The plant leaf for the

detection of disease is considered which shows the disease symptoms. The disease

causing agents in plants will be majorly defined as pathogens of any agent. The

symptoms diseased leaf image & then compared with normal leaf image.

LEAF DISEASE DETECTION USING MATLAB

Dept of ISE, NHCE 2018-2019 Page 52

CHAPTER 9 REFERENCES

[1] XIHAI ZHANG, YUE QIAO, FANFENG MENG, CHENGGUO FAN , AND MINGMING

ZHANG “Identification of Maize Leaf Diseases Using Improved Deep Convolutional

Neural Networks”, 2018 IEEE

*2+ Monzurul Islam, Anh Dinh, Khan Wahid, Pankaj Bhowmik, “Detection of Potato

Diseases Using Image Segmentation and Multiclass Support Vector Machine”, 2017 IEEE

30th Canadian Conference on Electrical and Computer Engineering.

[3] Huu Quan Cap, Katsumasa Suwa, Erika Fujita, Satoshi Kagiwada, Hiroyuki Uga, Hitoshi

Iyatomi, “A Deep Learning Approach for on-site Plant Leaf Detection”, 2018 IEEE 14th

International Colloquium on Signal Processing & its Applications (CSPA 2018), 9 -10

March 2018, Penang, Malaysia.

[4] Wenjiang Huang, Qingsong Guan, Juhua Luo, Jingcheng Zhang, Jinling Zhao, Dong

Liang, Linsheng Huang, and Dongyan Zhang, “New Optimized Spectral Indices for

Identifying and Monitoring Winter Wheat Diseases”, IEEE journal of selected topics in

applied earth observation and remote sensing,Vol. 7, No. 6, June 2014.

*5+ Monica Jhuria, Ashwani Kumar, and Rushikesh Borse, “Image Processing For Smart

Farming: Detection Of Disease And Fruit Grading”, Proceedings of the 2013 IEEE Second

International Conference on Image Information Processing (ICIIP-2013)

https://www.transportation.gov/sites/dot.gov/files/docs/USDOT VOTGuidance

2014.pdf[12]Thao Phan, Anuradha M. Annaswamy, Diana Yanakiev, and Eric

Tseng(2016),” A Model based Dynamic Toll Pricing Strategy for Controlling Highway

Traffic”,from https://www.researchgate.net/publication/282663933