0% found this document useful (0 votes)
342 views97 pages

Projetc R

The document presents a CNN-based approach for leaf disease identification using deep learning to accurately classify leaf images. It proposes a CNN architecture tailored for leaf disease identification, incorporating techniques like data augmentation and transfer learning to improve model performance and assist farmers in timely disease diagnosis.

Uploaded by

opakashi345
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
342 views97 pages

Projetc R

The document presents a CNN-based approach for leaf disease identification using deep learning to accurately classify leaf images. It proposes a CNN architecture tailored for leaf disease identification, incorporating techniques like data augmentation and transfer learning to improve model performance and assist farmers in timely disease diagnosis.

Uploaded by

opakashi345
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

LEAF PATHOGEN IDENTIFICATION USING DEEP

LEARNING

A PROJECT REPORT

Submitted by

JEYAPRIYA S (510120205006)
RAMYA A (510120205011)

In partial fulfilment for the award of the degree

of

BACHELOR OF ENGINEERING

in

INFORMATION TECHNOLOGY

ADHIPARASAKTHI COLLEGE OF ENGINEERING, KALAVAI

ANNA UNIVERSITY::CHENNAI 600 025

MAY 2024

i
ANNA UNIVERSITY :: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report “LEAF PATHOGEN IDENTIFICATION USING


MACHINE LEARNING” is the bonafide work of JEYAPRIYA S (510120205006),
RAMYA A (510120205011) who carried out the project work under my supervision.

SIGNATURE SIGNATURE
[Link].,MCA.,M.E.,(Ph.D) Mrs.S. SHARMILA.,MCA.,M.E.,(Ph.D)
HEAD OF THE DEPARTMENT SUPERVISOR

Department of Information Technology HOD&[Link]


Adhiparasakthi College of Engineering Department of Information Technology
[Link], Kalavai. Adhiparasakthi College of Engineering
[Link], Kalavai.

Submitted for the project and Viva-voce held on

INTERNAL EXAMINER EXTERNAL EXAMINER

ii
ACKNOWLEDGEMENT

With the divine blessings of Goddess Adhiparasakthi, we express our deep


gratitude to his Holiness Arul Thiru Padma Shri Bangaru Adigalar, Founder
President and Thirumathi Lakshmi Bangaru Adigalar, Vice President for providing
an amazing environment for the development and promotion of this under graduate
education in our college under ACMEC Trust.

We are very grateful to Sakthi Thirumathi [Link], Correspondent,


Adhiparasakthi College of Engineering, for her encouragement and inspiration. We are
very grateful to Sakthi Thiru [Link], Secretary for his continuous support.
We are highly indebted to our Principal Prof. [Link] for his valuable
guidance.

We wish to place our sincere gratitude to Prof. [Link], Head of the


Department, Department of Information Technology, for her motivation and
permitting us to do this work.

We wish to extend gratitude to our Project Coordinator &


Supervisor Prof. [Link], HOD & Assistant Professor, Department of
Information Technology for her kind guidance, help and suggestion for completion of
the project successfully.

We are especially indebted to our Supervisor Mrs. S. Sharmila , Head of the


Department, Department of Information Technology for her valuable advise , sustained
interest help extended towards us for the completion of this work successfully.

We are thankful to all teaching and non-teaching staff of our department for
their constant cooperation and encouragement in pursuing our project work.

iv
ABSTRACT
Leaf disease identification plays a crucial role in agricultural management, enabling

early detection and intervention to mitigate crop losses. Traditional methods of disease

diagnosis are time-consuming and often require specialized expertise. In recent years,

advances in machine learning, particularly Convolutional Neural Networks (CNNs),

have shown promise in automating the process of leaf disease identification. This paper

presents a comprehensive review of techniques and methodologies employed in leaf

disease identification using CNNs. We propose a CNN-based approach for leaf disease

identification, leveraging the power of deep learning to accurately classify leaf images

into healthy or diseased categories. Our model is trained on a diverse dataset containing

images of plant leaves affected by various diseases, as well as healthy leaves, enabling

it to learn discriminative features for disease detection. We design and implement a

CNN architecture tailored to the specific requirements of leaf disease identification,

incorporating techniques such as data augmentation, transfer learning, and fine-tuning

to improve model performance and generalization ability. The experimental results

demonstrate the efficacy of our CNN-based approach in accurately classifying leaf

images and its potential for assisting farmers and agricultural experts in timely disease

diagnosis and management. This research contributes to the advancement of automated

techniques for plant disease detection, offering a reliable and efficient solution for

addressing challenges in agricultural sustainability and food security.

v
sTABLE OF CONTENTS

CHAPTER NO. TITLE PAGE


NO.
TABLE OF CONTENTS V
LIST OF FIGURES vii
LIST OF SYMBOLS viii

LIST OF ABBREVATIONS X

1 INTRODUCTION 1
1.1 OBJECTIVE 3
1.2 PURPOSE AND SCOPE 3
2 LITERATURE SURVEY 5

3 EXISTING SYSTEM 6
3.1 EXISTING METHOD 6
3.2 DISADVANTAGES 7
4 PROPOSED SYSTEM 7
4.1 PROPOSED METHOD 7
4.2 ADVANTAGES 8
5 SYSTEM ANALYSIS 9
5.1 HARDWARE REQUIREMENTS 9
5.2 SOFTWARE REQUIREMENTS 9
5.3 DATABASE REQUIREMENTS 10
5.4 SOFTWARE SPECIFICATION 10
5.4.1 PYTHON 10
5.5 TOOLS AND LIBRARIES 13
5.5.1 PANDAS 13
5.5.2 PIL 14
5.5.3 PYTORCH 15
5.5.4 FLASK 16
vi
5.5.5 NUMPY 17
5.5.6 CLICK 18
5.5.7 TORCH VISION 19
6 SYSTEM DESIGN 20
6.1 GENERAL 20
6.2 SYSTEM ARCHITECTURE 20
6.3 USE CASE DIAGRAM 21
6.4 CLASS DIAGRAM 22
6.5 SEQUENCE DIAGRAM 23
6.6 DATA FLOW DIAGRAM 24
6.7 ACTIVITY DIAGRAM
6.8 FLOWCHART
7 MODULES 27
7.1 LIST OF MODULES 27
7.2 MODULES DESCRIPTION 27
7.2.1 DATA COLLECTION & PRE- 27
PROCESSING 27
7.2.2 MODEL CREATION 28
7.2.3 TRAINING AND EVALUATION
7.2.4 DEPLOYMENT
8 SYSTEM TESTING 29
8.1 GENERAL 30
8.2 TYPES OF TESTING
9 IMPLEMENTATION 34
10 CONCLUSION AND FUTURE ENHANCEMENT 36
10.1 CONCLUSION
10.2 FUTURE ENHANCEMENT

vii
APPENDIX 1 SOURCE CODE
APPENDIX 2 SCREENSHOTS
APPENDIX 3 REFERENCES

viii
LIST OF FIGURES

FIGURE NO. NAME OF THE FIGURES PAGE NO.

6.2 System Architecture 18

6.3 Use Case Diagram 19

6.4 Class Diagram 20

6.5 Sequence Diagram 21

6.6 Data Flow Diagram 22

6.5 Activity Diagram 23

6.8 Flow Chart 25

LIST OF SYMBOLS

ix
[Link] NAME NOTATION DESCRIPTION

Class Name
Represents a
+ public
collection of similar
1 Class -attribute
-private entities grouped
-attribute together.

Association
represents static
relationships
Association Class Class between classes.
2
B Roles represent
the way the two
Class Class classes see each
other.

Relation Used for additional


3 User
(user) process
communication.

Extends relationship
Relation is used when one use
4 extends
(extends) case is similar to
another use case but
does a bit more.

Communication
5 between various use
Communication cases.

x
Interaction between
6 Usecase the system and
external
environment.

A circle in DFD
represents a state
7 Data Process/
or process which
State
has been triggered
due to
some event or action.

Represents
external entities
8 Extern such as keyboard,
alentity sensors, etc.

Represents the
vertical
9 Object Lifeline dimensions that
the object
communications.

Represents the
10 Message Message message
exchanged.

1
LIST OF ABBREVATIONS

⮚ SVM - Support Vector Machine

⮚ AI - Artificial Intelligence

⮚ NN - Neural Network

⮚ CNN - Convolution Neural Network

⮚ ANN - Artificial Neural Network

⮚ GUI - Graphical User Interface

2
⮚ DL - Deep Learning

⮚ PIL - Python Image Library

⮚ SQL - Structured Query Language

⮚ CLICK - Command Line Interface Creation Kit

CHAPTER 1

INTRODUCTION

Agribusiness has developed into a significant source of financial


improvement, and in India, 80% of the population is dependent on agriculture.
Depending on the type of soil, local climate, and economic value, the rancher
selects the best yield. The majority of the time, farmers commit suicide as a result
of production loss because they are unable to repay the bank debts they have taken
out for farming. We have seen that the environment is changing steadily right now,
which is bad for the crops and pushes farmers into debt and suicide. When
different mathematical or statistical techniques are used to data, these risks can be

3
reduced, and by doing so, we can tell the farmer about plant diseases that affect his
agricultural area.

The agricultural industries started looking for new ways to enhance food
production as a result of the expanding population, climatic changes, and poor
governance. Researchers are working to create new, capable, and distinctive
technologies for producing outcomes with great efficiency. A huge harvest can be
produced using a variety of approaches in the agricultural sector. Precision
agriculture is the most recent and beneficial of them all. Based on the data
gathered, farmers can use the precision agriculture technology to gain insights for
increasing agricultural yield. Precision agriculture can be utilised for a variety of
purposes, including the identification of plant pests, the detection of weeds, the
production of yield, the detection of plant diseases, etc. The categorization of
agricultural products is done to stop losses in yield and quantity. If the proper
evaluation isn't made of this technique or class, it has major effects on plants and
affects the quality or productivity of the corresponding product. Several problems,
including low productivity and financial losses to ranchers and farmers, are being
caused by illnesses in harvests.

Leaf disease identification is a crucial aspect of plant health management and


agricultural sustainability. It involves the identification and classification of
various diseases that affect the leaves of plants, such as fungi, bacteria, viruses,
and nutrient deficiencies. Early detection and accurate diagnosis of these diseases
are essential for timely intervention and effective control measures. Various
methods, including visual inspection, symptomatology, and advanced diagnostic
tools like molecular techniques and machine learning algorithms, are employed to
identify leaf diseases. Proper identification allows farmers and gardeners to
implement appropriate treatment strategies, including chemical treatments, cultural

4
practices, and biological control methods, to mitigate the spread of disease and
ensure the health and productivity of plants.

In order to automatically diagnose diseases, image processing techniques are


therefore required. Techniques for image processing aid in both accurately
diagnosing diseases and categorising them. It is also feasible to identify the
diseases early and accurately. The productivity and quality of the yield will both
rise as a result. Human labour is greatly decreased by image processing systems.
Many agricultural applications, such as the classification of various diseases and
the identification of plant leaflets, make extensive use of image processing
techniques. In order to automatically diagnose diseases, image processing
techniques are therefore required. Techniques for image processing aid in both
accurately diagnosing diseases and categorising them. It is also feasible to identify
the diseases early and accurately.
In general, image processing techniques have following steps to identify the
diseases:
• Image acquisition

• Image pre-processing

• Segmentation

• Feature Extraction

• Classification.
Different methods have been used for segmentation, feature extraction and for
classification various classifiers are available

1.1 OBJECTIVE

5
The major goal of this study is to develop a model that can distinguish
between healthy and diseased harvest leaves and, in the event that the crop has a
disease, to identify which disease it is. This study used 54,306 photos, including
pictures of ill and healthy plant leaves, to train a convolution neural network model
to identify 14 crop species, 26 diseases, and 38 classes. In a held-out test set, this
trained model has an accuracy of 99.35%. In this process, the collected leaves are
analysed using a number of resnet18 models. These resnet18 models are trained
using the transfer learning approach. The first layer can be used to identify
different leaf kinds, while the supporting layer can be used to screen for potential
plant illnesses. Deep learning produces results with higher accuracy, which may be
used to diagnose crop diseases and analyse down to the smallest pixel-level
component of an image. It is impossible to study this level of detail with the
human eye.

1.2 PURPOSE AND SCOPE

In this methodology, plant diseases are classified and detected using


machine learning techniques and image processing techniques, respectively.
Supervised learning and unsupervised learning are the two main classifications of
machine learning. The label values in the supervised learning method are known.
Regression and classification are two examples of supervised learning techniques.
The label values in the unsupervised learning approach are unknown. An
illustration of an unsupervised learning technique is clustering and association.
Several fields, including computing, biology, marketing, medical diagnosis, game
playing, etc., can benefit from machine learning. Many methods, including naive
bayes, k-means clustering, support vector machines, artificial neural networks,
decision trees, and random forests, among others, are supported by machine
learning. Data collection, dataset organisation, feature extraction, pre-processing,

6
feature selection, selecting and implementing machine learning algorithms, and
execution evaluation are some of the fundamental phases in machine learning.

Beyond the arts, image processing has more utilitarian applications. It now
serves the following specialised functions in agricultural applications:
• To identify sick leaves, stems, and fruits;

• to quantify the disease's impact;

• to identify the form and colour of the infected areas;

• to identify the size and shape of the fruits; etc.

CHAPTER 2

LITERATURE SURVEY

DETECTION AND CLASSIFICATION OF LEAF DISEASE


The author Chittabarni Sarkar (2020) point out the Identification of leaf
disorder plays an important role in the economic prosperity of any country. Many
parts of a plant can be infected by a virus, fungal, bacteria, and other infectious
organisms but here we mainly considered the detection of leaf disease of a plant as a

7
research topic. We have performed an in-depth study of this topic from 2010 to 2022
and found that many researchers use multispectral or hyperspectral imaging to study
crop diseases. Machine learning (ML) and deep learning (DL) models are used to
classify different types of leaf diseases. We made a workflow mechanism to help
researchers in this field. Support vector machine (SVM), Random Forest, and
multiple twin SVM (MTSVM) are popular ML models for predicting leaf disease,
while convolutional neural networks (CNN).

DETECTION OF UNHEALTHY REGION OF PLANT LEAVES AND


CLASSIFICATION OF PLANT LEAF DISEASE.

The author S. Arivazhagan (2020) proposed the color transformation structure


is taken for the input RGB image, and then by means of a specific threshold value,
the green pixels are detected and uninvolved which is followed by segmentation
process, and for obtaining beneficial segments the texture statistics are computed. At
last, classifier is used for the features that are extracted to classify the disease. Plant
diseases pose a significant challenge as they can cause substantial reductions in both
the quality and quantity of agricultural products. Automatic detection of plant
diseases is crucial for monitoring large crop fields and identifying disease symptoms
early. The proposed system provides a software solution for the automatic detection
and classification of plant leaf diseases.

CNN BASED LEAF DISEASE IDENTIFICATION AND REMEDY


RECOMENDATION SYSTEM.

The author Sunku Rohan, Triveni S Pujar, Suma VR Amog Shetty, Rishabh F
Tated(2019) describes about the agriculture field has a high impact on our life.
Agriculture is the most important sector of our Economy. Farmers are difficult to
identify the leaf disease so they produce less production. So that can solve the

8
problem of related to crop disease. Due to the improvement and development in
technology where devices are smart enough to recognize and detect plant diseases. In
this paper focus on plant disease detection using image processing techniques. This
paper access open dataset images that consist 5000 images of healthy and diseased
plant leaves, and there used semi supervised techniques for crop types and detect the
disease of four classes.

CROP DISEASE DETECTION USING DEEP LEARNING

The author Omkar Kulkarni (2018) proposes a deep learning-based model


which is trained using public dataset containing images of healthy and diseased crop
leaves. The model serves its objective by classifying images of leaves into diseased
category based on the pattern of defect. In recent times, drastic climate changes and
lack of immunity in crops has caused substantial increase in growth of crop diseases.
Due to rapid growth in variety of diseases and adequate knowledge of farmer,
identification and treatment of the disease has become a major challenge. The leaves
have texture and visual similarities which attributes for identification of disease type.
Hence, computer vision employed with deep learning provides the way to solve this
problem.

IDENTIFICATION OF PLANT DISEASE USING IMAGE PROCESSING


The author (2019) Karunya Rathan, Abirami Devaraj, K Indira and Sarvepalli
Jaahnavi talks in this paper, agriculture has become far more than simply a method to
feed ever growing populations. It’s important wherever in additional than seventieth
population of an Asian country is depends on agriculture. Leaf disease detection may
be stop agricultural losses. The aim of this is to develop a software system answer

9
that mechanically find and classify disease. That consist steps like image acquisition,
preprocessing, Segmentation, extraction and classification are involves disease
detection. The leaves images are used for detecting the plant diseases. Therefore, use
of image process technique to find and classify diseases in agricultural.

TOMATO PLANT LEAVES DISEASE CLASSIFICATION


The author Balakrishna K Mahesh Rao (2019) talks in this paper, the authors
used two methods for identification and classification of healthy and diseased tomato
leaves. In the first technique, the tomato leaf is classified as healthy or unhealthy
using the k-nearest neighbor approach. Later, in the second technique, they classify
the unhealthy tomato leaf using probabilistic neural network and the k-nearest
neighbor approach. Plant diseases are important in the crops production, which
affects food security and reduces the profit of farmers. Identifying the diseases in
plants is the key to avoiding losses by proper feeding measures to cure the diseases
early and avoiding the reduce in production. The features are like GLCM, Gabor, and
color are used for classification purposes.

CHAPTER 3

SYSTEM ANALYSIS

3.1. EXISTING METHOD

Successful implementation of deep learning techniques for automated leaf


pathogen identification. Demonstrated improvement in disease diagnosis accuracy
and efficiency compared to manual methods. Potential for scalability and adaptation

10
to different crops and regions, enhancing agricultural sustainability. Future
enhancements and optimization strategies to further improve model performance and
accuracy.

3.2 DISADVANTAGES

 High computational complexity – Residual neural networks may not


be appropriate for all jobs and frequently need a lot of computing
power.
 Residual networks are easily able to pick up on the underlying data
patterns, which might result in overfitting and subpar generalisation.
 Large quantities of memory are needed to hold the parameters and
weights that are required by residual networks.
 Identifying plant diseases can be a time-consuming process,
especially when dealing with large-scale crop fields or diverse plant
species. This can delay treatment and increase the risk of disease
spread.

CHAPTER 4
PROPOSED SYSTEM

4.1 PROPOSED METHOD


The main objective of this project is to create a model that can differentiate
between healthy and sick harvest leaves and, in the event that the crop has a disease,

11
to determine which sickness it is. This study examined plant photos, including those
of the tomato, blueberry, orange, peach, corn (maize), potato, raspberry, soy bean,
strawberry, and blueberry. The referenced dataset is taken from the well-known
public source kaggle. The Convolutional Neural Network (CNN) is a type of deep
learning algorithm is used in this project. The initial phase of the system for
identifying and classifying plant diseases is dataset loading. This dataset of plant
photos contains photographs of both healthy and sick plants. The second step in the
approach for identifying and classifying plant diseases is preprocessing. At this
point, only maintain the relevant data and remove irregular and noisy data from the
dataset. The next step in the process of identifying and categorising plant diseases is
feature extraction. Image categorization greatly benefits from feature extraction.
There are several uses for feature extraction. This method has discovered that
morphological outcomes provide preferred results over other aspects. The dataset
can also be used to identify rare plants and rare diseases. The classification
technique is the next phase of the system for recognising and classifying plant
infections. Users can recognise and describe the plant infection at the final stage.
This represents the system's ultimate end stage.

4.2 ADVANTAGES

 Early identification allows for prompt intervention, preventing the spread of


diseases and minimizing crop losses. This can significantly improve crop
yield and quality.
 The suggested system model is more effective.

12
 The suggested method provides an accurate identifying strategy for plant
leaf diseases with good accuracy and leverages auxiliary Classifiers as
regularizers.
 Reduces labor costs and the need for expensive chemical treatments,
enhancing profitability.
 The suggested method provides an accurate identifying strategy for plant
leaf diseases with good accuracy and leverages auxiliary Classifiers as
Regularizers.
 Accurate disease identification enables farmers to select appropriate control
measures, such as specific fungicides or cultural practices, tailored to the
identified pathogen. This reduces the risk of overuse of pesticides and
promotes sustainable agricultural practices.

CHAPTER 5

SYSTEM ANALYSIS

5.1 HARDWARE REQUIREMENTS

The hardware necessities might function the premise for a contract for the
implementation of the system and will thus be an entire and consistent specification
of the total system. They’re utilized by software system engineers because the start
line for the system style. It shows what the system will and not however it ought to
be enforced.

 Intel i3 or equivalent.

13
 4GB RAM (8GB preferred)
 256GB SSD – 10GB available hard disk space.
 Proper internet connection.

5.2 SOFTWARE REQUIREMENTS

The software necessities document is that specification of the system. It ought


to embody each a definition and a specification of necessities. It’s a group of what
the system ought to do instead of however it ought to get laid. The software system
necessities offer a basis for making the software system necessities specification.

 OS: Windows 10 / 11 64 bit.


 Pycharm / VS Code
 Python 3.4 (the latest version is Python 3.7)
 Python 3.4 with framework: TensorFlow or PyTorch.
 Image processing library: PIL (pillow)

5.3 DATABASE REQUIREMENTS

The dataset required for training the model is:

5.4 SOFTWARE SPECIFICATION


5.4.1 PYTHON

Python, conceived by Guido van Rossum in the late 1980s, is a high-level,


interpreted programming language that was officially released in 1991. Guido van
Rossum aimed to create a language that prioritized code readability and simplicity,
making it accessible to both novice and experienced programmers alike. Python's

14
development was influenced by various programming languages, including ABC,
Modula-3, and C. Since its initial release in 1991, Python has undergone significant
evolution, growing in popularity and versatility. Despite its early beginnings, Python
has managed to adapt and thrive, becoming one of the most widely used
programming languages across diverse domains, such as web development, data
science, artificial intelligence, scientific computing, and more. Python's success can
be attributed to several key factors. Firstly, it’s clear and intuitive syntax makes it
easy to learn and understand, even for those new to programming. The language's
readability encourages good coding practices and facilitates collaboration among
developers. Python boasts a rich ecosystem of libraries and frameworks that extend
its functionality and facilitate various tasks. Over the years, developers have created
numerous libraries for specialized purposes, ranging from data analysis and
visualization to machine learning and web development. This extensive library
support enables developers to build complex applications efficiently, without needing
to reinvent the wheel.

In terms of data types and control structures, Python offers a flexible and
powerful set of features. It supports a variety of data types, including integers,
floating-point numbers, complex numbers, strings, lists, tuples, and dictionaries.
These data types allow developers to handle different kinds of data effectively,
whether it's numerical data, text, or structured collections of items. Functions play a
pivotal role in Python programming, allowing developers to encapsulate reusable
blocks of code. By defining functions, developers can write modular and
maintainable code, promoting code efficiency and readability. Python is a general-
purpose, interpreted programming language. It is collected and dynamically typed.
Although compilation is a step, Python is an interpreted language rather than a
compiled one. Before being placed in [Link] [Link] file, byte code created from

15
Python code written [Link] files are first compiled. Python source code was converted
to byte code rather than machine code, like C++. A low-level collection of
instructions known as byte code can be carried out.

SOME FEATURES OF PYTHON

 Free and Open Source: Python language is freely available at the official
website and you can download it from the given download link below click on
the Download Python keyword. Download Python Since it is open-source, this
means that source code is also available to the public. so you can download it,
use it as well as share it.
 Easy to code: Python is a high-level programming language. Python is very
easy to learn the language as compared to other languages like C, C#,
Javascript, Java, etc. It is very easy to code in the Python language and
anybody can learn Python basics in a few hours or days. It is also a developer-
friendly language.
 Object-Oriented Language: One of the key features of Python is Object-
Oriented programming. Python supports object-oriented language and
concepts of classes, object encapsulation, etc.
 GUI Programming Support: Graphical User interfaces can be made using a
module such as PyQt5, PyQt4, wxPython, or Tk in Python. PyQt5 is the most
popular option for creating graphical apps with Python.
 High-Level Language: Python is a high-level language. When we write
programs in Python, we do not need to remember the system architecture, nor
do we need to manage the memory.
 Large Community Support: Python has gained popularity over the
years. Our questions are constantly answered by the enormous Stack Overflow

16
community. These websites have already provided answers to many questions
about Python, so Python users can consult them as needed.
 Easy to Debug: Excellent information for mistake tracing. You will be able to
quickly identify and correct the majority of your program’s issues once you
understand how to interpret Python’s error traces. Simply by glancing at the
code, you can determine what it is designed to perform.
 Python is a Portable language: Python language is also a portable language.
For example, if we have Python code for Windows and if we want to run this
code on other platforms such as Linux, Unix, and Mac then we do not need to
change it, we can run this code on any platform.
 Python is an Integrated Language: Python is also an integrated language
because we can easily integrate Python with other languages like C, C++, etc.
 Interpreted Language: Python is an Interpreted Language because Python
code is executed line by line at a time. like other languages C, C++, Java, etc.
there is no need to compile Python code this makes it easier to debug our code.
The source code of Python is converted into an immediate form
called bytecode.
 Large Standard Library: Python has a large standard library that provides a
rich set of modules and functions so you do not have to write your own code
for every single thing. There are many libraries present in Python such
as regular expressions, unit-testing, web browsers, etc.
 Dynamically Typed Language: Python is a dynamically-typed language.
That means the type (for example- int, double, long, etc.) for a variable is
decided at run time not in advance because of this feature we don’t need to
specify the type of variable.

17
 Large community support: Python has a large and active community of users
and developers. This means that there is a wealth of resources available to help
you learn and use Python
 Frontend and backend development: This will help you do frontend
development work in Python like Javascript. Backend is the strong forte of
Python it’s extensively used for this work cause of its frameworks
like Django and Flask.
 Extensible: A programming language is said to be extensible if it can be
extended to other languages. Python code can also be written in other
languages like C++, making it a highly extensible language.

5.5 TOOLS AND LIBRARIES

5.5.1 PANDAS

Pandas is an open-source, BSD-licensed Python library providing high-


performance, easy-to-use data structures and data analysis tools for the Python
programming language. Pandas is built on top of NumPy and provides high-
performance, easy-to-use data structures and data analysis tools for working with
structured (tabular, multidimensional, potentially heterogeneous) and time series
data. Pandas is a popular tool for data scientists, statisticians, and analysts working
with large and complex datasets. It is also a valuable tool for machine learning
engineers and other data professionals. Pandas is a powerful and versatile library that
can be used for a wide variety of data science tasks. It is a valuable tool for anyone
who works with data in Python. Pandas strengthens Python by giving the popular
programming language the capability to work with spreadsheet-like data enabling
fast loading, aligning, manipulating, and merging, in addition to other key functions.

18
Pandas is prized for providing highly optimized performance when back-end source
code is written in C or Python.
FEATURES OF PANDAS

 Easy handling of missing data (represented as NaN) in both floating point and
non-floating-point data
 Size mutability: columns can be inserted and deleted from DataFrames and
higher-dimensional objects
 Automatic and explicit data alignment: objects can be explicitly aligned to a
set of labels, or the user can simply ignore the labels and let series, DataFrame,
etc. automatically align the data in computations
 Powerful, flexible group-by functionality to perform split-apply-combine
operations on data sets for both aggregating and transforming data
 Making it easy to convert ragged, differently indexed data in other Python and
Numpy data structures into DataFrame objects
 Intelligent label-based slicing, fancy indexing, and subsetting of large data sets

5.5.2 PIL

The Python Imaging Library (PIL) is a free, open-source library that allows
users to open, manipulate, and save images in various formats. PIL is not part of
Python's standard library, but it provides a wide range of capabilities for image
processing tasks, including: Opening and saving image files, manipulating image
data, applying image filters and transformations, Resizing, and Cropping. PIL
supports many different images file formats, including popular formats such as
JPEG. It has been built and tested with Python 2.0 and newer, on Windows, Mac OS
X, and major Unix platforms. To install PIL, you can use the Python package
manager called pip. Open your command prompt or terminal and run the command:

19
`pip install pillow`. It provides a wide range of features for image processing tasks
such as resizing, cropping, applying filters, and more. It’s a powerful library in
python that allows users to open, manipulate, and save various image formats. Pillow
was announced as a replacement for PIL for future usage. Pillow supports a large
number of image file formats including BMP, PNG, JPEG, and TIFF. The library
encourages adding support for newer formats in the library by creating new file.
FEATURES OF PILL
 Development server and debugger.
 Integrated support for unit testing.
 RESTful request dispatching.
 Uses Jinja templating.
 Support for secure cookies (client-side sessions).
 Unicode-based.
 Complete documentation.
5.5.3 PYTORCH

PyTorch is an open-source machine learning framework based on the Torch


library, used for applications such as computer vision and natural language
processing, originally developed by Meta AI and now part of the Linux Foundation
umbrella. It is recognized as one of the two most popular machine learning libraries
alongside TensorFlow, offering free and open-source software released under the
modified BSD license. PyTorch is written in Python and is compatible with popular
Python libraries like NumPy, SciPy, and Cython. It is used in applications like:
Image recognition, Language processing, Reinforcement learning, and Natural
language classification.
PyTorch is known for its flexibility and ease of use. It uses dynamic computation
graphs, which are more flexible than static graphs. Dynamic graphs allow users to

20
interleave construction and valuation of the graph. PyTorch is also known for its
speed. It uses the Torch library's GPU support to accelerate training and inference.

FEATURES OF PYTORCH

 It is easy to debug and understand the code.


 It includes many layers as Torch.
 It includes lot of loss functions.
 It can be considered as NumPy extension to GPUs.
 It allows building networks whose structure is dependent on computation
itself.

5.5.4 FLASK

Flask is a lightweight, open-source Python framework for building web


applications. It's a popular alternative to Django, which is a more complex full-stack
development framework. Flask is known for its simplicity and flexibility, which
makes it suitable for both small projects and larger applications. It's also used in data
science to create web interfaces, APIs, and visualization tools. Flask is a
microframework, which means it doesn't require particular tools or libraries. It
supports extensions that can add application features, such as: Object-relational
mappers, Form validation, Upload handling, Various open authentication
technologies, and several common framework related tools. Flask is based on the
Werkzeg WSGI toolkit and the Jinja2 template engine, which are also Pocoo
projects.

21
FEATURES OF FLASK
 Flask is a lightweight backend framework with minimal dependencies.
 Flask is easy to learn because it’s simple and intuitive API makes it easy to
learn and use for beginners.
 Flask is a flexible Framework because it allows you to customize and extend
the framework to suit your needs easily.
 Flask can be used with any database like SQL and NoSQL and with any
Frontend Technology such as React or Angular.

5.5.5 NUMPY

NumPy is a Python library used for working with arrays. It's perfect for
scientific or mathematical calculations because it's fast and efficient. In addition,
NumPy includes support for signal processing and linear algebra operations. NumPy
arrays are stored at one continuous place in memory unlike lists, so processes can
access and manipulate them very efficiently. This behavior is called locality of
reference in computer science. This is the main reason why NumPy is faster than
lists. Also, it is optimized to work with latest CPU architectures. NumPy is a Python
library and is written partially in Python, but most of the parts that require fast
computation are written in C or C++. NumPy arrays provide an efficient way of
storing and manipulating data. NumPy also includes a number of functions that make
it easy to perform mathematical operations on arrays. This can be really useful for
scientific or engineering applications. And if you’re working with data from a Python
script, using NumPy can make your life a lot easier. The syntax of NumPy functions
generally involves calling the function and passing one or more parameters, such as
the shape of the array, the range of values to generate, or the type of data to use.

FEATURES OF NUMPY

22
● Python NumPy supports arrays with different numbers of dimensions.

● It supports broadcasting, a powerful and robust method for executing


operations to arrays of various shapes and sizes.

● NumPy functions well with other Python scientific computing libraries like
SciPy, Matplotlib, and Pandas.

● NumPy offers a variety of math operations, such as linear algebra functions,


trigonometric functions, and fundamental arithmetic operations.

5.5.6 CLICK

Click is a Python package for creating beautiful command line interfaces in a


composable way with as little code as necessary. It’s the “Command Line Interface
Creation Kit”. It’s highly configurable but comes with sensible defaults out of the
box. It aims to make the process of writing command line tools quick and fun while
also preventing any frustration caused by the inability to implement an intended CLI
API. At its simplest, just decorating a function with this decorator will make it into a
callable script: import click @click. It remembers parsed parameters, what command
created it, which resources need to be cleaned up at the end of the function, and so
forth. It can also optionally hold an application-defined object. The most important
and final step towards making the perfect CLI is to provide documentation to our
code. Click provides a nice and formatted help text in the command line when used
the optional argument help. It uses the docstring specified in the function.

FEATURES OF CLICK

23
● This can save you a lot of time and effort, and it ensures that your help pages
are always up-to-date.
● Click supports nested commands, which allows you to create complex CLIs
with a hierarchical structure
● Click allows you to pass context objects between commands.

● This can help you to prevent errors and make your CLI more user-friendly.

● Click provides a variety of options that you can use to customize your CLI.

● This includes options for specifying input and output files, setting verbosity
levels, and enabling or disabling features
5.5.7 TORCH VISION
The torch vision library is an essential component of the PyTorch ecosystem,
designed to facilitate computer vision tasks with ease and efficiency. Torch vision
offers a rich set of image transformations, such as resizing, cropping, normalization,
and data augmentation. These transformations are crucial for preprocessing and
augmenting image datasets, enhancing the model's performance and generalization
capability. Another significant aspect of torch vision is its collection of pre-trained
models, including renowned architectures like ResNet, VGG, and AlexNet. These
pre-trained models can be effortlessly loaded and fine-tuned for specific tasks,
eliminating the need to train models from scratch and accelerating the development
process. The library also provides utilities for loading and processing images,
simplifying the preparation of image data for training and evaluation in PyTorch.
These implementations streamline the development of complex computer vision
applications, enabling developers to focus on designing innovative solutions rather
than grappling with the intricacies of model implementation. Offers the necessary

24
tools and resources to build, evaluate, and deploy robust computer vision models
efficiently.

FEATURES OF TORCH VISION

 Includes pre-trained models such as ResNet, VGG, and AlexNet that can be
loaded and fine-tuned for specific tasks, accelerating model development.
 Offers utilities for loading and processing images, simplifying the integration
of image data into PyTorch workflows.
 Supports GPU acceleration for faster training and inference, enhancing
performance and scalability.

25
CHAPTER 6

SYSTEM DESIGN

6.1 GENERAL

Designing of systems is the process in which it is used to define the interface,


modules and data for a system to a specified the demand to satisfy

6.2 SYSTEM ARCHITECTURE

26
Fig 6.1 System Architecture

27
6.3 USECASE DIAGRAM

A use case diagram at its simplest is a representation of a user’s interaction with


the system that shows the relationship between the user and the different use case in
which the user is involved. A use case diagram can identify the different types of
users of a system and the different use cases and will often be accompanied by other
types of diagrams as well.

Select Image

Upload Image

Process Image

Train Model

User Predict Output Server

Get Result

Fig 6.2 Use case Diagram

28
6.4 CLASS DIAGRAM

A class diagram in the is a type of static structure diagram that describes the
structure of a system by showing the system's classes, their attributes, operations or
methods, and the relationships among objects. The class diagram is the main building
block of object-oriented modelling. It is used for general conceptual modelling of the
structure of the application, and for detailed modelling translating the models into
programming code. Class diagrams can also be used for data modelling.

Fig 6.3 Class Diagram

29
6.5 SEQUENCE DIAGRAM
A Sequence diagram in the is a type of static structure diagram that
describes the structure of a system by showing the system's classes, their attributes,
operations or methods, and the relationships among objects. The class diagram is
the main building block of object-oriented modelling. It is used for general
conceptual modelling of the structure of the application, and for detailed modelling
translating the models into programming code.

Image Dataset Training Testing

Input image dataset


Send the data to training stage

Pre-processing

Train the image

Extracted feature and send to


testing stage
Give input test image

Predict the Plant Disease

PPPPRE

Fig 6.4 Sequence Diagram

30
6.6 DATA FLOW DIAGRAM

A data-flow diagram (DFD) is a way of representing a flow of a data of a


process or a system (usually an information system). The DFD also provides
information about the outputs and inputs of each entity and the process itself. A
data-flow diagram has no control flow, there are no decision rules and no loops. A
data-flow diagram has no control flow, there are no decision rules and no loops.

LEAF DISEASE DISEASE


USER CLASSIFICATION
RECOGNITION

Fig 6.6.1 Level 0 – Data Flow Diagram

DISEASE DISEASE LEAF


DETECTION CLASSIFY DISEASE
IMAGE
PREDICTION

TRAINING
DATASET

Fig 6.6.2 Level 1 – Data Flow Diagram

31
TEST IMAGE
LEAF
Using CNN
DISEASE
Algorithm
PREDICTION

TRANING
DATASET

Fig 6.6.3 Level 2 – Data Flow Diagram

32
6.7 ACTIVITY DIAGRAM
Activity diagrams are graphical representations of workflows of stepwise
activities and actions with support for choice, iteration and concurrency. In the
Unified Modeling Language, activity diagrams can be used to describe the
business and operational step-by-step workflows of components in a system. An
activity diagram shows the overall flow of control.

Input Dataset

Preprocessing

Training

Get image and Analyse

Predicted disease

Fig 6.5 Activity Diagram

33
6.8 FLOWCHART

A Flow chart is a way of representing a flow of a data of a process or a system


(usually an information system). These also provides information about the outputs
and inputs of each entity and the process itself.

Gather data from various sources such as student records, demographic


information, test scores, attendance records, etc. Clean the data to handle missing
values, outliers, and inconsistencies. Normalize or standardize numerical features.
Encode categorical variables.

Optimize model hyper parameters using techniques like grid search or


randomized search. Compare the performance of different models to select the best-
performing one. Use the trained model to make predictions on the testing dataset.
Compare predicted values with actual values from the testing dataset. Calculate
evaluation metrics to assess the accuracy and effectiveness of the model's
predictions.

Once satisfied with the model's performance, deploy it for practical use.
Integrate the model into an application or system where it can be used to predict
student performance. Continuously monitor the model's performance in real-world
applications. Collect feedback and update the model periodically to ensure its
accuracy and relevance over time.

34
Pre- Model
Plant processing InceptionV3 Predicted Loss
Image and Feature Architecture. Results:Plant &
Dataset Selection Disease Model
classification Accurac
y

Fig 6.6 Flow chart

CHAPTER 7
MODULES
7.1 LIST OF MODULES

● Data Collection and Pre-Processing Module

● Model Creation Module

● Training and Evaluation Module

● Deployment Module

7.2 MODULES DESCRIPTION

7.2.1 DATA COLLECTION AND PREPROCESSING MODULE

The data collection and preprocessing module in leaf disease identification


involves gathering a diverse dataset of plant leaf images this undergo preprocessing
to enhance quality, feature extraction for relevant information.
Data Collection

35
Gather a diverse dataset of leaf images containing both healthy leaves and leaves
affected by various diseases. The dataset should cover different plant species, types
of diseases, and variations in lighting, background, and leaf orientation.
Data Splitting

Split the dataset into training, validation, and test sets. The training set is used to
train the CNN model, the validation set is used to tune hyperparameters and monitor
training progress, and the test set is used to evaluate the model's performance on
unseen data.
7.2.2 MODEL CREATION MODULE

The Model Creation Module in leaf disease identification involves selecting


suitable machine learning algorithms, designing model architecture, and preparing
training data. Using Convolutional Neural Networks (CNNs) involves several steps,
including data preparation, model architecture design, training, and evaluation.

Model Architecture Design

Design a CNN architecture suitable for leaf disease identification. A typical


CNN architecture consists of convolutional layers followed by pooling layers to
extract features, followed by fully connected layers for classification.

Model Training

Split the dataset into training, validation, and test sets. The training set is used to
train the model, the validation set is used to tune hyperparameters and monitor
performance, and the test set is used to evaluate the final model.

36
Train the CNN model using the training data. During training, the model learns
to extract relevant features from the images and classify them into healthy or
diseased categories.

Model Evaluation

Fine-tune the model based on the validation results, adjusting hyperparameters


or model architecture as needed. Finally, evaluate the model's performance on the
test set to obtain an unbiased estimate of its accuracy and generalization ability.

Iterative Improvement

Continuously monitor the model's performance in the production environment


and collect feedback from users. Use the feedback to iteratively improve the model
by retraining it on updated datasets, fine-tuning hyperparameters, or adjusting the
architecture to better address user needs and improve accuracy.

7.2.3 TRAINING AND EVALUATION MODULE

The Training and Evaluation Module in leaf disease identification involves


training machine learning models on labeled data, typically using a subset for
validation.

Data Preparation

Gather a dataset of leaf images, including both healthy leaves and leaves
affected by various diseases. Divide the dataset into training, validation, and test sets.
Typically, you might use around 70-80% for training, 10-15% for validation, and 10-
15% for testing.

Model Selection

37
Convolutional Neural Networks (CNNs) are commonly used for image
classification tasks and are likely to be effective for this application.

Fine-Tuning and Optimization

Experiment with different hyperparameters (e.g., learning rate, batch size) and
model architectures to optimize performance. Consider techniques like transfer
learning, which involves fine-tuning a pre-trained model on your specific dataset to
improve performance with limited data.

7.2.4 DEPLOYEMENT MODULE

The Deployment Module for leaf disease identification employs Flask to create
a user-friendly web application. It includes a visually appealing interface for image
upload and integration. The deployment module in leaf disease identification
involves making the trained model accessible for real-world use, typically through a
web or windows.

Choose Deployment Platform:

Determine the platform on which you want to deploy the leaf disease
identification system. This could be a web application, windows application, or a
standalone service accessible via APIs.

Windows Application Development:

If deploying as a windows application, develop the user interface to allow users


to upload leaf images and receive predictions for disease identification. Integrate the
model loading and inference functionality into the application backend or client-side
code.

38
Monitoring and Logging:

Set up monitoring and logging infrastructure to track the performance and usage
of the deployed system. Monitor metrics such as response time, error rate, and
resource utilization to identify issues and optimize performance.

CHAPTER 8
SYSTEM TESTING
8.1 GENERAL
The purpose of testing is to discover errors. Testing is the process of trying to
discover every conceivable fault or weakness in a work product. It provides a way to
check the functionality of components, sub-assemblies, assemblies and/or a finished
product It is the process of exercising software with the intent of ensuring that the
Software system meets its requirements and user expectations and does not fail in an
unacceptable manner. There are various types of test. Each test type addresses a
specific testing requirement.

39
8.2 TYPES OF TESTING
UNIT TESTING
Unit testing involves the design of test cases that validate that the internal
program logic is functioning properly, and that program inputs produce valid outputs.
All decision branches and internal code flow should be validated. It is the testing of
individual software units of the application .it is done after the completion of an
individual unit before integration. This is a structural testing, that relies on
knowledge of its construction and is invasive. Unit tests perform basic tests at
component level and test a specific business process, application, and/or system
configuration. Unit tests ensure that each unique path of a business process performs
accurately to the documented specifications and contains clearly defined inputs and
expected results.

FUNCTIONAL TESTING
Functional tests provide systematic demonstrations that functions tested
are available as specified by the business and technical requirements, system
documentation, and user manuals.

Functional testing is centered on the following items:

Valid Input : identified classes of valid input must be accepted.

Invalid Input : identified classes of invalid input must be rejected.

Functions : identified functions must be exercised.

Output : identified classes of application outputs.

Systems/Procedures : interfacing systems or procedures must be invoked.

Requirement Analysis

40
Under the functional requirements of the leaf pathogen identification. This
includes defining what constitutes healthy or unhealthy state of the leaf.

Test Scenario Identification

Define specific test scenario based on the functional requirements. For example:
The leaf disease identification involves validating image input, assessing disease
classification accuracy, confirming detection of healthy leaves and providing the
pesticide to the affected leaves. These tests collectively ensure the system's
reliability, accuracy, and usability in real-world scenarios.

Test Case Design

Create detailed test cases for each identified test scenario. Test the system with
various types of input images, including high-resolution images, low-resolution
images, images with varying lighting conditions, and images with different
backgrounds.

Test Execution

Execute the test cases using the prepared test data. Capture images of leaves
using the designated equipment and input them into the leaf disease identification
system. Observe the system's performance in accurately identifying the presence of
diseases and classifying them correctly.

Performance Evaluation

41
Evaluate the performance of the leaf disease identification system in terms of
speed and accuracy. Measure the time taken to process each image and assess the
system's ability to handle large volumes of data efficiently.

INTEGRATION TESTING
Integration tests are designed to test integrated software components to
determine if they actually run as one program. Testing is event driven and is more
concerned with the basic outcome of screens or fields. Integration tests demonstrate
that although the components were individually satisfaction, as shown by
successfully unit testing, the combination of components is correct and consistent.
Integration testing is specifically aimed at exposing the problems that arise from the
combination of components.

PERFORMANCE TESTING

The Performance test ensures that the output be produced within the time limits,
and the time taken by the system for compiling, giving response to the users and
request being send to the system for to retrieve the results.

Performance testing in leaf disease identification aims to evaluate the efficiency


and speed of the system in processing leaf images and identifying diseases.

Define Performance Metrics

Determine the key performance metrics to measure, such as processing time per
image, throughput (number of images processed per unit of time), resource
utilization (CPU and memory usage), and response time.

Identify performance Test Scenarios

42
Define various test scenarios representing different usage patterns and load
conditions. These scenarios may include processing a single image, processing
multiple images concurrently, and handling peak loads.

Set Up Test Environment

Create a test environment that closely resembles the production environment,


including the hardware infrastructure and software configuration. Ensure that the
environment can simulate the expected workload and stress levels.

Generate performance Test Data

Prepare a dataset of leaf images representing a range of conditions, including


healthy leaves and leaves affected by different diseases. The dataset should be large
enough to stress test the system's performance adequately.

Execute performance Tests

Execute performance tests by simulating a high volume of concurrent requests to


process leaf images. Gradually increase the load to determine the system's scalability
and identify its maximum processing capacity.

Analyze Performance Metrics

Analyze the performance metrics collected during testing to identify areas for
optimization and improvement. Look for patterns or trends that indicate scalability
issues, inefficiencies, or bottlenecks in the system.

Tune and Optimize

43
Implement optimizations to improve the system's performance based on the
insights gained from performance testing. This may involve optimizing algorithms,
enhancing parallel processing capabilities, or scaling the infrastructure.

SYSTEM TESTING

System testing ensures that the entire integrated software system meets
requirements. It tests a configuration to ensure known and predictable results. An
example of system testing is the configuration-oriented system integration test.
System testing is based on process descriptions and flows, emphasizing pre-driven
process links and integration points.

VALIDATION TESTING

The final step involves Validation testing, which determines whether the
software function as the user expected. The end-user rather than the system
developer conducts this test most software developers as a process called Alpha and
Beta Testing to uncover that only the end user seems able to find. The compilation of
the entire project is based on the full satisfaction of the end users. In the project,
validation testing is made in various forms. In question entry form, the correct
answer only will be accepted in the answer box. The answers other than the four
given choices will not be accepted.

ACCEPTANCE TESTING

Normally this type of testing is done to verify if system meets the


customer specified requirements. User or customer does this testing to determine
whether to accept application. User Acceptance Testing is a critical phase of any

44
project and requires significant participation by the end user. It also ensures that the
system meets the functional requirements.

Acceptance testing for Data Synchronization:

 The Acknowledgement will be received by the Sender Node after the Packets
are received by the Destination Node.
 The Route add operation is done only when there is a Route request in need.
 The Status of Nodes information is done automatically in the Cache Updating
process.
WHITEBOX TESTING

White Box Testing is a testing in which in which the software tester has
knowledge of the inner workings, structure and language of the software, or at least
its purpose. It is purpose. It is used to test areas that cannot be reached from a black
box level.

BLACKBOX TESTING

Black Box Testing is testing the software without any knowledge of the inner
workings, structure or language of the module being tested. Black box tests, as most
other kinds of tests, must be written from a definitive source document, such as
specification or requirements document, such as specification or requirements
document. It is a testing in which the software under test is treated, as a black box
you cannot “see” into it. The test provides inputs and responds to outputs without
considering how the software works.

TEST CASES

Test cases for leaf disease identification cover a range of scenarios to ensure that
the system accurately identifies diseases in plant leaves under various conditions.

45
These test cases cover various aspects of leaf disease identification, including
accuracy, robustness, usability, and performance, to ensure the reliability and
effectiveness of the system in agricultural applications.

Healthy Leaf Recognition:

 Input: Image of a healthy leaf.


 Expected Output: System correctly identifies the leaf as healthy with high
confidence and provides no disease diagnosis.

Unhealthy Leaf Recognition:

 Input: Image of an unhealthy leaf.


 Expected Output: System correctly identifies the leaf as unhealthy with high
confidence and provides disease diagnosis.

Error Handling:

 Input: Invalid or corrupted image files.


 Expected Output: System detects and appropriately handles errors, providing
informative error messages to the user.

Low-Quality Image Handling:

 Input: Low-resolution or blurry image of a leaf.


 Expected Output: System provides a warning or error message indicating that
the image quality is insufficient for accurate disease identification.

46
CHAPTER 9

IMPLEMENTATION
Implementing a leaf disease identification system using machine learning is a
comprehensive process that requires meticulous planning and execution. The journey
begins with data collection, where you must assemble a diverse and comprehensive

47
dataset. This dataset should include images of both healthy and diseased leaves from
various plant species. Each image should be meticulously labeled to indicate the type
of disease it represents or labeled as a healthy leaf. This labeling process is crucial as
it forms the foundation upon which the machine learning model will be trained to
recognize and differentiate between healthy and diseased leaves.
After assembling the dataset, the next phase is data preprocessing, which is
pivotal for ensuring the quality and relevance of the data. During this phase, you'll
need to resize the images to a uniform dimension to maintain consistency across the
dataset. Data augmentation techniques can also be applied to artificially increase the
dataset's size and diversity. Techniques such as rotation, flipping, and zooming can
be employed to introduce variations in the dataset, which helps the model generalize
better to unseen data. Additionally, normalizing the pixel values of the images to a
standardized range, typically between 0 and 1, can significantly improve the model's
training efficiency and convergence.
Once the data is preprocessed and ready, the subsequent step involves feature
extraction. In this phase, the goal is to identify and extract meaningful patterns or
features from the images that can be used for classification. Various techniques can
be employed for feature extraction, and color histograms to more advanced
approaches using deep learning features. The choice of feature extraction method
largely depends on the nature of the dataset and the complexity of the diseases you're
trying to identify.
With the extracted features in hand, the focus shifts to model selection and
training. Convolutional Neural Networks (CNNs) have emerged as a popular choice
for image classification tasks due to their ability to automatically learn hierarchical
features from the data. However, other machine learning algorithms like Support
Vector Machines (SVMs) or Random Forests can also be effective depending on the
dataset's characteristics. Once the model is selected, it needs to be trained using the

48
preprocessed data. The dataset is typically divided into training, validation, and test
sets to facilitate model training, evaluation, and performance tuning. During training,
the model's hyperparameters can be optimized using techniques like grid search or
random search to enhance its performance.
After the model has been trained and fine-tuned, the next step is to evaluate its
performance rigorously. This involves testing the model on the validation and test
datasets using various performance metrics such as accuracy, precision, recall, and
F1-score. These metrics provide valuable insights into the model's strengths and
weaknesses, helping you assess its ability to generalize to new, unseen data
accurately.
Once the model's performance meets the desired criteria, it can be deployed into
a production environment. This deployment phase involves integrating the trained
model into a user-friendly interface, such as a web application or mobile app. Users
can then upload images of leaves to the interface, and the model will provide
predictions regarding the presence of diseases in the leaves. Post-deployment, it's
crucial to establish a robust monitoring system to continuously track the model's
performance and make necessary updates or improvements as new data becomes
available or as the model encounters new challenges.

CHAPTER 10
CONCLUSION AND FUTURE ENHANCEMENT

10.1 CONCLUSION

49
In this study, a paradigm for evaluating bacterial curse, impact, sheath
deterioration, and black collared spot diseases was developed. To set up the grouping
calculation, image handling techniques like division, feature extraction. Color and
area-aware shape features have been extracted from the element extraction process
and used as a contribution to the classifier. Although the mentioned analysis has
shown the general nature of the anticipated communications.
CNN outperforms all currently used machine learning techniques as well as
conventional methods for detecting plant ailments. It is discovered that the new
method is superior in terms of time unpredictability, precision, and the number of
diseases secured. By leveraging advanced algorithms and computer vision
techniques, machine learning models enable early detection of leaf diseases,
facilitating timely interventions and reducing crop losses.

10.2 FUTURE WORK

The extraction of color and form features has been done in this work.
Moreover, texture features can be added and their effects on an algorithm's
performance can be evaluated. More illnesses exist in addition to the four covered
in this work. The focus of future effort may be on more disorders. Other crops can
use the same methods with only minor adjustments. The job was completed for
one person, but it will be applied to all crops going forward using the same
methodology and will undoubtedly provide positive outcomes. While considering
other crops, look just at the disease signs. Furthermore, the incorporation of
explainable AI techniques could foster trust and adoption among users by
enhancing model interpretability. Developing transparent and interpretable
machine learning models that provide insights into the decision-making process
can enable users to understand and validate the model's predictions effectively,
fostering confidence in its capabilities. Optimizing model scalability and

50
deployment, particularly on edge devices with limited computational resources, is
another area ripe for exploration. Efforts to develop lightweight models and
efficient algorithms tailored for edge computing environments could facilitate
broader adoption and implementation of machine learning-based leaf disease
identification systems in diverse agricultural settings. By addressing these areas of
focus through interdisciplinary collaboration, research, and innovation, we can
unlock new opportunities to improve crop health, productivity, and resilience,
ultimately contributing to global food security, environmental sustainability, and
economic prosperity.

APPENDIX 1
SOURCE CODE
[Link]

51
import os

from flask import Flask, redirect, render_template, request

from PIL import Image

import [Link] as TF

import CNN

import numpy as np

import torch

import pandas as pd

disease_info = pd.read_csv('C:/Users/Sathiyapriya/source/repos/Plant-Disease-
Detection/Flask Deployed App/disease_info.csv' , encoding='cp1252')

supplement_info = pd.read_csv('C:/Users/Sathiyapriya/source/repos/Plant-
Disease-Detection/Flask Deployed App/supplement_info.csv',encoding='cp1252')

model = [Link](39)

model.load_state_dict([Link]("plant_disease_model_1_latest.pt"))

[Link]()

def prediction(image_path):

52
image = [Link](image_path)

image = [Link]((224, 224))

input_data = TF.to_tensor(image)

input_data = input_data.view((-1, 3, 224, 224))

output = model(input_data)

output = [Link]().numpy()

index = [Link](output)

return index

app = Flask(__name__)

@[Link]('/')

def home_page():

return render_template('[Link]')

@[Link]('/contact')

def contact():

return render_template('[Link]')

53
@[Link]('/index')

def ai_engine_page():

return render_template('[Link]')

@[Link]('/mobile-device')

def mobile_device_detected_page():

return render_template('[Link]')

@[Link]('/submit', methods=['GET', 'POST'])

def submit():

if [Link] == 'POST':

image = [Link]['image']

filename = [Link]

file_path = [Link]('static/uploads', filename)

[Link](file_path)

print(file_path)

pred = prediction(file_path)

title = disease_info['disease_name'][pred]

description =disease_info['description'][pred]

prevent = disease_info['Possible Steps'][pred]

54
image_url = disease_info['image_url'][pred]

supplement_name = supplement_info['supplement name'][pred]

supplement_image_url = supplement_info['supplement image'][pred]

supplement_buy_link = supplement_info['buy link'][pred]

return render_template('[Link]' , title = title , desc = description ,


prevent = prevent ,

image_url = image_url , pred = pred ,sname =


supplement_name , simage = supplement_image_url , buy_link =
supplement_buy_link)

@[Link]('/market', methods=['GET', 'POST'])

def market():

return render_template('[Link]', supplement_image =


list(supplement_info['supplement image']),

supplement_name = list(supplement_info['supplement name']),


disease = list(disease_info['disease_name']), buy = list(supplement_info['buy
link']))

if __name__ == '__main__':

[Link](debug=True)

55
[Link]

import pandas as pd

import [Link] as nn

class CNN([Link]):

def __init__(self, K):

super(CNN, self).__init__()

self.conv_layers = [Link](

# conv1

nn.Conv2d(in_channels=3, out_channels=32,

kernel_size=3, padding=1),

[Link](),

nn.BatchNorm2d(32),

nn.Conv2d(in_channels=32, out_channels=32,

kernel_size=3, padding=1),

[Link](),

nn.BatchNorm2d(32),

nn.MaxPool2d(2),

# conv2

nn.Conv2d(in_channels=32, out_channels=64,

56
kernel_size=3, padding=1),

[Link](),

nn.BatchNorm2d(64),

nn.Conv2d(in_channels=64, out_channels=64,

kernel_size=3, padding=1),

[Link](),

nn.BatchNorm2d(64),

nn.MaxPool2d(2),

# conv3

nn.Conv2d(in_channels=64, out_channels=128,

kernel_size=3, padding=1),

[Link](),

nn.BatchNorm2d(128),

nn.Conv2d(in_channels=128, out_channels=128,

kernel_size=3, padding=1),

[Link](),

nn.BatchNorm2d(128),

nn.MaxPool2d(2),

# conv4

nn.Conv2d(in_channels=128, out_channels=256,

57
kernel_size=3, padding=1),

[Link](),

nn.BatchNorm2d(256),

nn.Conv2d(in_channels=256, out_channels=256,

kernel_size=3, padding=1),

[Link](),

nn.BatchNorm2d(256),

nn.MaxPool2d(2),

self.dense_layers = [Link](

[Link](0.4),

[Link](50176, 1024),

[Link](),

[Link](0.4),

[Link](1024, K),

def forward(self, X):

out = self.conv_layers(X)

58
# Flatten

out = [Link](-1, 50176)

# Fully connected

out = self.dense_layers(out)

return out

idx_to_classes = {0: 'Apple___Apple_scab',

1: 'Apple___Black_rot',

2: 'Apple___Cedar_apple_rust',

3: 'Apple___healthy',

4: 'Background_without_leaves',

5: 'Blueberry___healthy',

6: 'Cherry___Powdery_mildew',

7: 'Cherry___healthy',

8: 'Corn___Cercospora_leaf_spot Gray_leaf_spot',

9: 'Corn___Common_rust',

59
10: 'Corn___Northern_Leaf_Blight',

11: 'Corn___healthy',

12: 'Grape___Black_rot',

13: 'Grape___Esca_(Black_Measles)',

14: 'Grape___Leaf_blight_(Isariopsis_Leaf_Spot)',

15: 'Grape___healthy',

16: 'Orange___Haunglongbing_(Citrus_greening)',

17: 'Peach___Bacterial_spot',

18: 'Peach___healthy',

19: 'Pepper,_bell___Bacterial_spot',

20: 'Pepper,_bell___healthy',

21: 'Potato___Early_blight',

22: 'Potato___Late_blight',

23: 'Potato___healthy',

24: 'Raspberry___healthy',

25: 'Soybean___healthy',

26: 'Squash___Powdery_mildew',

27: 'Strawberry___Leaf_scorch',

28: 'Strawberry___healthy',

29: 'Tomato___Bacterial_spot',

60
30: 'Tomato___Early_blight',

31: 'Tomato___Late_blight',

32: 'Tomato___Leaf_Mold',

33: 'Tomato___Septoria_leaf_spot',

34: 'Tomato___Spider_mites Two-spotted_spider_mite',

35: 'Tomato___Target_Spot',

36: 'Tomato___Tomato_Yellow_Leaf_Curl_Virus',

37: 'Tomato___Tomato_mosaic_virus',

38: 'Tomato___healthy'}

Flask development app


[Link]
<!doctype html>
<html lang="en">

<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Bootstrap CSS -->


<link href="[Link]
[Link]" rel="stylesheet"

61
integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0
h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<link rel="stylesheet"
href="[Link]

<link rel = "stylesheet" href =


"[Link]

<title> {% block pagetitle %}

{% endblock pagetitle %}</title>


<style>
.bg {

background-image: url("images/[Link]");

height: 100%;

/* Center and scale the image nicely */


background-position: center;
background-repeat: no-repeat;
background-size: cover;
}

.file-upload input[type='file'] {
display: none;

62
}

body {
background-color: #4ECC5A;
/* background: -webkit-linear-gradient(to right, #66a776, #043610);
background: linear-gradient(to right, #5d9c6a, #059b0d); */
height: 100vh;
}

.rounded-lg {
border-radius: 1rem;
}

.[Link]-pill {
border-radius: 50rem;
}

.[Link]-pill::after {
border-radius: 0 50rem 50rem 0;
}

label {
background-color: rgb(2, 46, 15);
color: white;
padding: 0.5rem;
font-family: sans-serif;

63
border-radius: 0.3rem;
cursor: pointer;
margin-top: 1rem;
}

#file-chosen {
margin-left: 0.3rem;
font-family: sans-serif;
}

.footer-basic {
padding: 40px 0;
background-color: #042908;
color: #f1f3f5;
}

.footer-basic ul {
padding: 0;
list-style: none;
text-align: center;
font-size: 18px;
line-height: 1.6;
margin-bottom: 0;
}

.footer-basic li {

64
padding: 0 10px;
}

.footer-basic ul a {
color: inherit;
text-decoration: none;
opacity: 0.8;
}

.footer-basic ul a:hover {
opacity: 1;
}

.footer-basic .social {
text-align: center;
padding-bottom: 25px;
}

.footer-basic .social>a {
font-size: 24px;
width: 40px;
height: 40px;
line-height: 40px;
display: inline-block;
text-align: center;
border-radius: 50%;

65
border: 1px solid #ccc;
margin: 0 8px;
color: inherit;
opacity: 0.75;
}

.footer-basic .social>a:hover {
opacity: 0.9;
}

.footer-basic .copyright {
margin-top: 15px;
text-align: center;
font-size: 13px;
color: #aaa;
margin-bottom: 0;
}
</style>
</head>

<body>
<nav class="navbar navbar-expand-lg navbar-dark " style="background-
color:#05380b;">
<!-- <a class="navbar-brand" href="#">Navbar</a>

66
<button class="navbar-toggler" type="button" data-toggle="collapse" data-
target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-
expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button> -->
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="navbar-brand active">
<a class="nav-link" href="/" style="color: white;">Home</a>
</li>
<li class="navbar-brand active">
<a class="nav-link" href="/index" style="color: white;">AI
Engine</a>
</li>
<li class="navbar-brand">
<a class="nav-link" href="/market" style="color:
white;">Supplements</a>
</li>
<li class="navbar-brand">
<a class="nav-link" href="/contact" style="color: white;">Contact-
Us</a>
</li>
</ul>
</div>
</nav>
{% block body %}

67
{% endblock body %}
<div class="footer-basic">
<footer>
<center>
<div style="padding: 5;">
<a target="_blank" href='[Link]
src="data:image/jpeg;base64d592BvK5IzxnTwhPnXySevoetfc8smCLcY5pmk8R
vh+W3Gv8w12tSlCThOL" height="40" width="40"></a>&nbsp
<a target="_blank"href="[Link]
809232289"><img src="data:image/png;base64,iVBORw" height="40"
width="40"></a>&nbsp
</div>
</center>
<br>
<ul class="list-inline">
<li class="list-inline-item"><a href="/">Home</a></li>
<li class="list-inline-item"><a target="_blank"
href="[Link]
<li class="list-inline-item"><a target="_blank"
href="[Link]
<li class="list-inline-item laptop"><a href="/index">AI Engine</a></li>
</ul>
<p class="copyright">Created by Jeyapriya Selvaganapathy and Ramya
Anbalagan</p>
</footer>
</div>

68
<script
src="[Link]
<script src="[Link]
[Link]"></script>
</body>
<!-- <script>
if ([Link]("(max-width: 767px)").matches)
{
// The viewport is less than 768 pixels wide
[Link]("This is a mobile device.");
[Link]('/mobile-device');

} else {

// The viewport is at least 768 pixels wide


[Link]("This is a tablet or desktop.");
}
</script> -->
<!-- <script>
if([Link] <= 700){
[Link] = '[Link]';
}
</script> -->
</html>

[Link]:

69
{% extends '[Link]' %}
{% block pagetitle %}
Contact Us
{% endblock pagetitle %}

{% block body %}

<div class="row mb-5 text-center text-white laptop">


<div class="col-lg-10 mx-auto">
<h1 class="display-4" style="padding-top: 2%;font-weight: 400;color: rgb(4,
54, 4);"><b>📞Contact-Us📞</b></h1>
<p class="lead" style="font-weight: 500;color: black;">For Any Queries &
Suggestions Contact Us. We Are Happy To
Help.</p>
</div>
</div>

<div class="row p-3">


<div class="col">
<div class=" p-5 bg-white shadow rounded-lg" style="height: 95%;">
<center>
<h3>Jeyapriya Selvaganapathy</h3>
<p class="lead" style="font-weight: 350;">Hi, I am Jeyapriya
Selvaganapathy. Currently Pursuing Bachelors in
Information

70
[Link] Main Focus is on Machine Learning, Deep Learning
and Artificial Intelligence.
</p>
</center>
<div>
<h5>Social Media Handles :</h5><br>
<a target="_blank" href='[Link]
src="data:image/png;base64EnyrKjxbWTxe3TyxMHxSDvxdGzyn
pn+9vX6xsPxhX7829n5ubX0bGLxfnfy" height="40" width="40"></a> :
jaya1332003@[Link]<br><br>

<a target="_blank" href='[Link]


src="data:image/png;base64,iVBORw0KGgYII=" height="40"
width="40"></a> :
Jeyapriya843<br><br>
<a target="_blank" href='[Link]
809232289'><img
src="data:image/png;base64 height="40" width="40"></a> :
ramya.anbu2003@[Link]<br><br>
<a target="_blank" href='[Link]
src="data:image/png;base64,iVBORw0KSUVORK5CYII="
height="44" width="44"></a> :
ramyanbalagan<br><br>
<a target="_blank" href='[Link]
anbalagan'><img
src="data:image/png;base64,AGVwtGamRw9dAAAAAElFTkSuQ
mCC" height="40" width="40"></a> :

71
ramya-anbalagan<br>
</div>
</div>
</div>
</div>

{% endblock body %}
[Link]
{% extends '[Link]' %}
{% block pagetitle %}
Plant Disease Detection
{% endblock pagetitle %}
{% block body %}
<style>
body{
overflow-x: hidden;
}
@media only screen and (max-width: 830px) {
.laptop{
display: none;
}
}
@media (min-width:830px) and (max-width: 1536px){
.mobile{
display: none;
}

72
}
</style>
<div class='mobile p-5'>
<div class="row mb-5 text-center text-white">
<div class="col-lg-10 mx-auto">
<h1 class="display-4" style="padding-top: 2%;font-weight:
400;color:red;"><b></b></h1>
<p class="lead" style="font-weight: 500;color: black;"></p>
<p class="lead" style="font-weight: 500;color: black;"></p>
</div>
</div>
</div>

<div class="row mb-5 text-center text-white laptop">


<div class="col-lg-10 mx-auto">
<h1 class="display-4" style="padding-top: 2%;font-weight: 400;color: rgb(4,
54, 4);"><b>🍁Plant Disease
Detection🍁 </b></h1>
<p class="lead" style="font-weight: 500;color: black;">This AI Engine Will
Help To Detect Disease From Following Fruites And Veggies</p>
</div>
</div>

<center class="laptop">
<a href="/index">

73
<button class = "bttn-pill bttn-lg btn-success"><b style="color: black;">AI
Engine</b></button>
</a>
</center>
<div class="row p-5 laptop">
<div class=" col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">
<img
src="[Link]
Diabetes_and_Blood_Sugar_Levels-[Link]"
width="250" height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Apple</p></center>
</div>
</div>
<div class="col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">

<img src="[Link]
[Link]?t=1588260305&width=1080" width="250" height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Blueberry</p></center>
</div>
</div>
<div class=" col">

74
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">

<img
src="[Link]
article_thumbnails/slideshows/health_benefits_of_cherries_slideshow/
1800x1200_health_benefits_of_cherries_slideshow.jpg" width="250"
height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Cherry</p></center>
</div>
</div>
<div class=" col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">

<img src="[Link]
q=tbn:ANd9GcSqDgbUxygF6qCLo-Q6Kkz-nOOlFONGl5CIgw&s" width="250"
height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Corn</p></center>
</div>
</div>
</div>

<div class="row p-5 laptop">


<div class=" col">

75
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">
<img
src="[Link]
width="250" height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Grape</p></center>
</div>
</div>
<div class="col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">

<img
src="[Link]
image.jpg_gen/derivatives/ratio_1x1_w1200/[Link]" width="250"
height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Orange</p></center>
</div>
</div>
<div class=" col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">

<img
src="[Link]

76
articles/health_tools/the_health_benefits_of_peaches_slideshow/
thinkstock_rf_peaches.jpg?resize=650px:*" width="250" height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Peach</p></center>
</div>
</div>
<div class=" col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">

<img
src="data:image/jpeg;base64VvsOnJLUjLu6xjBpYZjbq7ySQMFnReSJEBvrA6ko
nzVPn7KrfVzOAA7o8pO9hoE2aR6ev8ACDCf/9k=" width="250"
height="250">
<center><p class="lead" style="font-weight: 500;color: black;">Pepper
Bell</p></center>
</div>
</div>
</div>

<div class="row p-5 laptop">


<div class=" col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">

77
<img src="[Link]
600,imgsize-111140,msid-72862126/[Link]" width="250"
height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Potato</p></center>
</div>
</div>
<div class="col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">

<img
src="[Link]
326/326272/[Link]?w=1155&h=1541"
width="250" height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Raspberry</p></center>
</div>
</div>
<div class=" col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">

<img src="[Link]
1200,height-900,resizemode-4,imgsize-211276/[Link]"
width="250" height="250">

78
<center><p class="lead" style="font-weight: 500;color:
black;">Soybean</p></center>
</div>
</div>
<div class=" col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 90%;height:
92%;">

<img src="[Link]
[Link]" width="250" height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Squash</p></center>
</div>
</div>
</div>

<center class="laptop">
<div class="row p-5">
<div class=" col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 45%;height:
92%;">
<img src="[Link]
width="250" height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Strawberry</p></center>
</div>
</div>

79
<div class="col">
<div class="p-3 bg-white shadow rounded-lg" style="width: 45%;height:
92%;">

<img
src="[Link]
[Link]" width="250" height="250">
<center><p class="lead" style="font-weight: 500;color:
black;">Tomato</p></center>
</div>
</div>
</div>
</center>

{% endblock body %}
[Link]:
<html>
{% extends '[Link]' %}
{% block pagetitle %}
AI Engine
{% endblock pagetitle %}

{% block body %}
<div>
<div class="container">
<!-- For demo purpose -->

80
<div class="row mb-5 text-center text-white">
<div class="col-lg-10 mx-auto">
<h1 class="display-4" style="padding-top: 2%;font-weight: 400;color:
rgb(4, 54, 4);"><b>🍀AI Engine🍀</b></h1>
<p class="lead" style="font-weight: 500;color: black;">Let AI Engine
Will Help You To Detect Disease</p>
</div>
</div>
<!-- End -->
<div class="row ">
<div class="col mx-auto">
<div class="p-5 bg-white shadow rounded-lg" style="height: 95%;">

<h5><b>Why is it necessary to detect disease in plant ?</b></h5>


<p>Plant diseases affect the growth of their respective species. In
addition, some research gaps are
identified from which to obtain greater transparency for detecting
diseases in plants, even
before their symptoms appear clearly.
diagnosis is one of the most important aspects of a plant
pathologist's training. Without proper
identification of the disease and the disease-causing agent, disease
control measures can be a
waste of time and money and can lead to further plant losses.
Proper disease diagnosis is
necessary.
</p>

81
</div>
</div>
<div class="col mx-auto">
<div class="p-5 bg-white shadow rounded-lg" style="height:
95%;"><img
src="[Link]
q=tbn:ANd9GcSo5s2yBbhFWG3P32D1shJ76bP0rsoZlF1USw4elmILmRNCELM
g"
height="300" alt="" width="200" class="d-block mx-auto mb-4
rounded-pill">

<!-- Default bootstrap file upload-->

<form action="/submit" method="POST" enctype="multipart/form-


data">
<div class="custom-file overflow-hidden mb-4">
<input type="file" id="actual-btn" hidden name="image" />
<label for="actual-btn">Choose File</label>
<span id="file-chosen">No file chosen</span>
</div>

<!-- End -->

<h6 class="text-center mb-4 text-muted">


Simply upload your plant's leaf image and then see the magic of
AI.
</h6>

82
<!-- Custom bootstrap upload file-->
<center>
<a class="mx-2"><button type="submit" class="btn btn-outline-
success">Submit</button></a>
</center>
</form>
<!-- End -->

</div>
</div>
<div class="col mx-auto">
<div class="p-5 bg-white shadow rounded-lg" style="height: 95%;">
<h5><b>Prevent Plant Disease follow below steps:</b></h5>
<ol>
<li>Follow Good Sanitation Practices.</li>
<li>Fertilize to Keep Your Plants Healthy.</li>
<li>Inspect Plants for Diseases Before You Bring Them
Home.</li>
<li>Allow the Soil to Warm Before Planting.</li>
<li>Ensure a Healthy Vegetable Garden By Rotating Crops.</li>
<li>Provide Good Air Circulation</li>
<li>Remove Diseased Stems and Foliage</li>
</ol>
<a target="_blank" href="[Link]
diseases-in-your-garden-2539511"

83
class="mx-2"><button type="button" class="btn btn-outline-
success">More info</button></a>
</div>
</div>
</div>
</div>
</div>

<script>
const actualBtn = [Link]('actual-btn');

const fileChosen = [Link]('file-chosen');

[Link]('change', function () {
[Link] = [Link][0].name
})
</script>

{% endblock body %}
APPENDIX 2
SCREENSHOTS
HOME PAGE

84
85
SUBMIT PAGE

DISEASE IDENTIFICATION

86
CONTACT

87
APPENDIX 3

REFERENCES

88

You might also like