DECLARATION
We hereby declare that this submission is our own work and that, to the best of
our knowledge and belief, it contains no material previously published or
written by another person nor material which to a substantial extent has been
accepted for the award of any other degree of the university or other institute
of higher learning, except where due acknowledgment has been made in the
text.
Name: Aashish Sharma
Roll No.: 2102220100002
Date:
Name: Aditya Sharma
Roll No.: 2102220100016
Date:
Name: Anshika Solanki
Roll No.: 2102220100042
Date:
Name: Avinash Tripathi
Roll No.: 2102220100053
Date:
Name: Hiresh Kumar
Roll No.: 2102220100084
Date:
Project Guide Name: HOD Name:
Mr. Yogesh Sharma Dr. Jaya Sinha
CERTIFICATE
This is to certify that Project Report entitled “Plant Disease Detection using
Machine Learning” which is submitted by in partial fulfillment of the
requirement for the award of degree B. Tech. in Department of ITS
ENGINEERING COLLEGE of Dr. A.P.J. Abdul Kalam Technical University,
Lucknow, is a record of the candidate own work carried out by him under my
supervision. The matter embodied in this thesis is original and has not been
submitted for the award of any other degree.
Date: 15-05-2025
ACKNOWLEDGEMENT
It gives us a great sense of pleasure to present the report of the B. Tech Project
undertaken during B.Tech. (VII- Semester) Final Year. We owe special debt
and gratitude to Mr. Yogesh Sharma for his/her constant support and guidance
throughout the course of our work. His sincerity, thoroughness and
perseverance have been a constant source of inspiration for us. It is only his
cognizant efforts that our endeavors have seen light of the day.
We also take the opportunity to acknowledge the contribution of for his/her full
support and assistance during the development of the project. We also do not
like to miss the opportunity to acknowledge the contribution of all faculty
members of the department for their kind assistance and cooperation during the
development of our project. Last but not the least, we acknowledge our group
members for their contribution in the completion of the project.
Name: Aashish Sharma
Roll No.: 2102220100002
Name: Aditya Sharma
Roll No.: 2102220100016
Name: Anshika Solanki
Roll No.: 2102220100042
Name: Avinash Tripathi
Roll No.: 2102220100053
Name: Hiresh Kumar
Roll No.: 2102220100084
ABSTRACT
Plant diseases significantly impact agricultural productivity and global food
security. Traditional methods of disease detection, including visual inspection,
are often inefficient and prone to error due to subjective judgment and human
limitations. This project implements a machine learning-based solution
leveraging Convolutional Neural Networks (CNNs) to classify plant diseases
from leaf images accurately.
The proposed system utilizes a publicly available dataset, Plant Village, which
contains a diverse set of plant leaf images. A comprehensive preprocessing
pipeline ensures image quality and prepares the data for model training. The
CNN model architecture was optimized to achieve high accuracy while
maintaining computational efficiency.
Experimental results demonstrate that the system achieves a validation
accuracy of 92%, highlighting its potential for real-world applications. By
providing farmers with an accessible tool for early disease detection, this
project aims to reduce crop losses and promote sustainable agriculture.
TABLE OF CONTENTS
DECLARATION ......................................................................................................
.i
CERTIFICATE .........................................................................................................ii
i
ACKNOWLEDGEMENTS.......................................................................................i
v
ABSTRACT...............................................................................................................
v
LIST OF
TABLES....................................................................................................vi
LIST
OFFIGURES..................................................................................................vii
LIST OF
ABBREVIATION.....................................................................................viii
CHAPTER 1: INTRODUCTION........................................................................
1.1. Introduction
1.2. Objective
1.3 Problem Statement
CHAPTER 2: LITERATURE SURVEY
CHAPTER 3: SYSTEM DESIGN
3.1 Overview of existing work
3.2. Implementation work
CHAPTER 4: METHODOLOGY AND TECHNOLOGY
4.1 Dataset details
4.2 Tools and Technologies
4.2.1 Python
4.2.2 NumPy
4.2.3 Compiler Option
4.2.4 Jupiter Notebook
CHAPTER 5: IMPLEMENTATION AND RESULT ANALYSIS
CHAPTER 6: CONCLUSION AND FUTURE WORK
REFERENCE
LIST OF TABLES
TABLE NO. TITLE
1 Summary Table
2 Leaf disease dataset
3 CNN model summary table
4 VGG 16 summary table
5 Transfer learning summary
6 Comparison of CNN vs VGG16
LIST OF FIGURES
FIGURE NO. TITLE
1 leaves with disease part diagram
2 Feature based Approach proposed
3 Workflow
4 Experimental Result
5 VGG16 layered architecture
6 VGG16 architecture
7 Vegetable and fruit leaves
8 Labeled images
9 Split dataset images
10 Train CNN model Test
11 CNN model
12 Chart of CNN vs VGG16
LIST OF ABBREVIATIONS
CNN Convolutional Neural Network
R-CNN Region based Convolutional Neural Network
Fast R-CNN Fast Region based Convolutional Neural Network
VGG16 Visual Geometry Group
ROI Region of Interest
SVM Support Vector Machine
KNN K Nearest Neighbors
PNN Probabilistic Neural Network
GLCM Gray-Level Co-occurrence Matrix
CHAPTER 1
INTRODUCTION
1.1 Introduction
Agriculture is a crucial sector of our country, with approximately 70% of the
population relying on farming for their livelihood. Due to frequent production
losses, many farmers are driven to extreme measures, including suicide—an
issue that demands immediate attention. This crisis can be mitigated through
the integration of modern technologies that assist farmers in improving their
harvest outcomes.
Plants have become an essential source of energy and play a significant role in
addressing various environmental challenges, such as global warming.
However, numerous plant diseases pose a serious threat, potentially leading to
devastating economic, social, and ecological consequences. While several
methods exist to detect these diseases, some are not easily identifiable to the
naked eye or become visible only when it is too late for effective intervention.
Traditional methods of plant disease detection are often laborious and time-
consuming.
A common modern approach involves the use of remote sensing techniques,
particularly multi-spectral and hyper-spectral image capture, along with digital
image processing tools. These technologies have brought substantial
advancements in agricultural research. Plant disease detection, therefore,
emerges as a cutting-edge system designed to help users learn about diseases
and access training resources and updates about local agricultural activities.
This system benefits the local population by keeping them informed about
developments within their towns or regions.
To function effectively, this approach requires the integration of machine
learning and image processing. Users can view diseases relevant to their
towns, although disease entries can be added for any location. If a user inputs
inaccurate or fictitious information, the system's administrator reviews and
takes appropriate action. The user interface allows a 500-word limit for disease
descriptions and supports intuitive swipe transitions for browsing. The design
enhances user engagement with visually appealing disease evaluations.
Farmers in rural regions often face difficulty recognizing diseases that may
affect their crops. Due to infrastructural limitations, they may find it hard to
access agricultural offices for assistance. Our primary objective is to identify
plant diseases based on their morphology using image processing and machine
learning techniques.
Pests and diseases damage crops and plant components, leading to reduced
food production and increased food insecurity. Major contributors to these
issues include toxic pathogens, poor disease management practices, and
dramatic climatic shifts. To address these challenges, a variety of innovative
technologies have been developed to enhance agricultural sustainability,
minimize post-harvest losses, and improve productivity.
Traditional laboratory-based methods such as Polymerase Chain Reaction
(PCR), Gas Chromatography, Mass Spectrometry, Thermography, and
Hyperspectral Imaging have been employed for disease identification.
However, these methods are costly and time-intensive. Recently, mobile, and
server-based solutions have gained traction, offering faster, more accessible
alternatives. High-resolution cameras, along with modern hardware, have
enabled automated disease detection.
The use of machine learning and deep learning algorithms has significantly
improved the accuracy of disease detection. Many studies have employed
techniques such as Random Forests, Artificial Neural Networks (ANNs),
Support Vector Machines (SVMs), Fuzzy Logic, K-Means Clustering, and
Convolutional Neural Networks (CNNs). For image-based detection, features
such as Hu Moments, Haralick Texture, and Colour Histograms are extracted.
Haralick textures help analyse the leaf’s surface texture, while histograms
reveal the distribution of colours in an image.
A mobile-based plant disease detection system can be developed using Android
Studio for the frontend and SQL Server for the backend. This system is fast,
user-friendly, and adheres to Google’s Material Design guidelines to ensure a
seamless user experience. It includes functionalities for disease news,
categories, and notifications, and supports interaction between users and
administrators.
This application aims to provide farmers and agricultural professionals with an
affordable, accessible, and reliable tool for detecting plant diseases. It saves
time and resources and can be customized according to user needs. Ultimately,
the system strives to empower rural communities with timely and accurate
information for crop protection and better agricultural outcomes. common
modern approach involves the use of remote sensing techniques, particularly
multi-spectral and hyper-spectral image capture, along with digital image
processing tools. These technologies have brought substantial advancements in
agricultural research. Plant disease detection, therefore, emerges as a cutting-
edge system designed to help users learn about diseases and access training
resources and updates about local agricultural activities. This system benefits
the local population by keeping them informed about developments within
their towns or regions.
To function effectively, this approach requires the integration of machine
learning and image processing. Users can view diseases relevant to their
towns, although disease entries can be added for any location. If a user inputs
inaccurate or fictitious information, the system's administrator reviews and
takes appropriate action. The user interface allows a 500-word limit for disease
descriptions and supports intuitive swipe transitions for browsing. The design
enhances user engagement with visually appealing disease evaluations.
Farmers in rural regions often face difficulty recognizing diseases that may
affect their crops. Due to infrastructural limitations, they may find it hard to
access agricultural offices for assistance. Our primary objective is to identify
plant diseases based on their morphology using image processing and machine
learning techniques.
Pests and diseases damage crops and plant components, leading to reduced
food production and increased food insecurity. Major contributors to these
issues include toxic pathogens, poor disease management practices, and
dramatic climatic shifts. To address these challenges, a variety of innovative
technologies have been developed to enhance agricultural sustainability,
minimize post-harvest losses, and improve productivity.
Traditional laboratory-based methods such as Polymerase Chain Reaction
(PCR), Gas Chromatography, Mass Spectrometry, Thermography, and
Hyperspectral Imaging have been employed for disease identification.
However, these methods are costly and time-intensive. Recently, mobile, and
server-based solutions have gained traction, offering faster, more accessible
alternatives. High-resolution cameras, along with modern hardware, have
enabled automated disease detection. Agriculture is a crucial sector of our
country, with approximately 70% of the population relying on farming for their
livelihood. Due to frequent production losses, many farmers are driven to
extreme measures, including suicide—an issue that demands immediate
attention. This crisis can be mitigated through the integration of modern
technologies that assist farmers in improving their harvest outcomes.
Plants have become an essential source of energy and play a significant role in
addressing various environmental challenges, such as global warming.
However, numerous plant diseases pose a serious threat, potentially leading to
devastating economic, social, and ecological consequences. While several
methods exist to detect these diseases, some are not easily identifiable to the
naked eye or become visible only when it is too late for effective intervention.
Traditional methods of plant disease detection are often laborious and time-
consuming.
A common modern approach involves the use of remote sensing techniques,
particularly multi-spectral and hyper-spectral image capture, along with digital
image processing tools. These technologies have brought substantial
advancements in agricultural research. Plant disease detection, therefore,
emerges as a cutting-edge system designed to help users learn about diseases
and access training resources and updates about local agricultural activities.
This system benefits the local population by keeping them informed about
developments within their towns or regions.
To function effectively, this approach requires the integration of machine
learning and image processing. Users can view diseases relevant to their
towns, although disease entries can be added for any location. If a user inputs
inaccurate or fictitious information, the system's administrator reviews and
takes appropriate action. The user interface allows a 500-word limit for disease
descriptions and supports intuitive swipe transitions for browsing. The design
enhances user engagement with visually appealing disease evaluations.
Farmers in rural regions often face difficulty recognizing diseases that may
affect their crops. Due to infrastructural limitations, they may find it hard to
access agricultural offices for assistance. Our primary objective is to identify
plant diseases based on their morphology using image processing and machine
learning techniques.
Pests and diseases damage crops and plant components, leading to reduced
food production and increased food insecurity. Major contributors to these
issues include toxic pathogens, poor disease management practices, and
dramatic climatic shifts. To address these challenges, a variety of innovative
technologies have been developed to enhance agricultural sustainability,
minimize post-harvest losses, and improve productivity.
Traditional laboratory-based methods such as Polymerase Chain Reaction
(PCR), Gas Chromatography, Mass Spectrometry, Thermography, and
Hyperspectral Imaging have been employed for disease identification.
However, these methods are costly and time-intensive. Recently, mobile, and
server-based solutions have gained traction, offering faster, more accessible
alternatives. High-resolution cameras, along with modern hardware, have
enabled automated disease detection.
The use of machine learning and deep learning algorithms has significantly
improved the accuracy of disease detection. Many studies have employed
techniques such as Random Forests, Artificial Neural Networks (ANNs),
Support Vector Machines (SVMs), Fuzzy Logic, K-Means Clustering, and
Convolutional Neural Networks (CNNs). For image-based detection, features
such as Hu Moments, Haralick Texture, and Colour Histograms are extracted.
Haralick textures help analyse the leaf’s surface texture, while histograms
reveal the distribution of colours in an image.
A mobile-based plant disease detection system can be developed using Android
Studio for the frontend and SQL Server for the backend. This system is fast,
user-friendly, and adheres to Google’s Material Design guidelines to ensure a
seamless user experience. It includes functionalities for disease news,
categories, and notifications, and supports interaction between users and
administrators.
This application aims to provide farmers and agricultural professionals with an
affordable, accessible, and reliable tool for detecting plant diseases. It saves
time and resources and can be customized according to user needs. Ultimately,
the system strives to empower rural communities with timely and accurate
information for crop protection and better agricultural outcomes. common
modern approach involves the use of remote sensing techniques, particularly
multi-spectral and hyper-spectral image capture, along with digital image
processing tools. These technologies have brought substantial advancements in
agricultural research. Plant disease detection, therefore, emerges as a cutting-
edge system designed to help users learn about diseases and access training
resources and updates about local agricultural activities. This system benefits
the local population by keeping them informed about developments within
their towns or regions.
To function effectively, this approach requires the integration of machine
learning and image processing. Users can view diseases relevant to their
towns, although disease entries can be added for any location. If a user inputs
inaccurate or fictitious information, the system's administrator reviews and
takes appropriate action. The user interface allows a 500-word limit for disease
descriptions and supports intuitive swipe transitions for browsing. The design
enhances user engagement with visually appealing disease evaluations.
Farmers in rural regions often face difficulty recognizing diseases that may
affect their crops. Due to infrastructural limitations, they may find it hard to
access agricultural offices for assistance. Our primary objective is to identify
plant diseases based on their morphology using image processing and machine
learning techniques.
Pests and diseases damage crops and plant components, leading to reduced
food production and increased food insecurity. Major contributors to these
issues include toxic pathogens, poor disease management practices, and
dramatic climatic shifts. To address these challenges, a variety of innovative
technologies have been developed to enhance agricultural sustainability,
minimize post-harvest losses, and improve productivity.
Traditional laboratory-based methods such as Polymerase Chain Reaction
(PCR), Gas Chromatography, Mass Spectrometry, Thermography, and
Hyperspectral Imaging have been employed for disease identification.
However, these methods are costly and time-intensive. Recently, mobile, and
server-based solutions have gained traction, offering faster, more accessible
alternatives. High-resolution cameras, along with modern hardware, have
enabled automated disease detection.
The use of machine learning and deep learning algorithms has significantly
improved the accuracy of disease detection. Many studies have employed
techniques such as Random Forests, Artificial Neural Networks (ANNs),
Support Vector Machines (SVMs), Fuzzy Logic, K-Means Clustering, and
Convolutional Neural Networks (CNNs). For image-based detection, features
such as Hu Moments, Haralick Texture, and Colour Histograms are extracted.
Haralick textures help analyse the leaf’s surface texture, while histograms
reveal the distribution of colours in an image.
A mobile-based plant disease detection system can be developed using Android
Studio for the frontend and SQL Server for the backend. This system is fast,
user-friendly, and adheres to Google’s Material Design guidelines to ensure a
seamless user experience. It includes functionalities for disease news,
categories, and notifications, and supports interaction between users and
administrators.
This application aims to provide farmers and agricultural professionals with an
affordable, accessible, and reliable tool for detecting plant diseases. It saves
time and resources and can be customized according to user needs. Ultimately,
the system strives to empower rural communities with timely and accurate
information for crop protection and better agricultural outcomes.
1.2 Problem Statement
To create a trustworthy and accurate system that can automatically detect and
diagnose plant illnesses in a quick and timely manner is the problem statement
for plant disease detection using machine learning. This system should be able
to generalise to new locations and plant species while processing massive
amounts of data rapidly and accurately. The present methods for identifying
plant diseases, such as visual inspection or laboratory analysis, take time, are
subjective, and frequently need specialised knowledge. Furthermore, these
techniques might not be able to identify diseases in the earliest stages, when
treatments are most efficient.
There is significant potential for machine learning-based methods to overcome
these limitations and offer an automated, objective solution for plant disease
diagnosis. However, the creation of such systems necessitates the accessibility
of sizable and varied datasets, the choice of suitable machine learning
algorithms, and the hyperparameter optimisation for the issue at hand.
1.3 Objectives
1) Early Detection: Preventing the spread of plant diseases requires early
detection. By assisting in the early detection of plant illnesses, machine
learning algorithms enable farmers to respond quickly to limit additional harm.
2) Accuracy: Based on the examination of sizable datasets of plant photos,
machine learning algorithms can precisely diagnose and categorize many
forms of plant diseases. This precision can decrease the possibility of a wrong
diagnosis and improve the management of plant diseases.
3) Efficiency: By automating the process of finding plant diseases, machine
learning algorithms may assist in increasing efficiency by saving time and
effort. This strategy can help farmers and experts in plant diseases swiftly
monitor broad regions of crops and spot possible outbreaks.
4) Cost-effectiveness: Developing cost-effective detection methods is
important for widespread adoption, especially in resource-limited
environments where access to expert diagnostic services may be constrained.
1.4Methodology
The following models have been used and trained for the detection of Plant
Diseases and the datasets have been taken from Kaggle.com, then the models
with the highest accuracy are selected and they undergo an ensemble model.
VGG-16 Model- The Visual Geometry Group (VGG) at the University of
Oxford created the convolutional neural network (CNN) model known as the
VGG16 in 2014. The moniker VGG16 refers to the deep learning architecture's
16 layers. Multiple convolutional layers with tiny 3x3 filters make up the
VGG16 model.
DenseNet201-Researchers at Facebook AI Research presented the
DenseNet201 model, a deep convolutional neural network (CNN)
architecture, in 2017. It is a variation on the Dense Net (Dense Convolutional
Network) model, which was created to deal with the issue of vanishing
gradients in extremely deep neural networks. The DenseNet201 model's
architecture is made up of a number of dense blocks, which are collections of
convolutional layers with a same number of output channels.
InceptionV3- Researchers at Google introduced the InceptionV3 model, a
deep convolutional neural network (CNN) architecture, in 2015. It is an
adaptation of the Inception model, which was created to solve the issue of
computing effectiveness in extremely deep neural networks. The 48 layers of
the InceptionV3 model are organised into many Inception modules, which are
collections of convolutional layers with various filter sizes.
Ensemble learning is a machine learning technique that involves combining
multiple models or learners to make predictions or solve complex problems.
The idea behind ensemble learning is that by combining the predictions of
multiple models, the overall performance and accuracy can be improved
compared to using a single model. The individual models in an ensemble are
often referred to as "base models" or "weak learners." These base models can
be of any type, such as decision trees, neural networks, support vector
machines, or any other machine learning algorithm. Each base model in the
ensemble is trained independently on a subset of the training data or using a
different algorithm variation to introduce diversity. Ensemble learning is a
machine learning technique that involves combining multiple models or
learners to make predictions or solve complex problems. The idea behind
ensemble learning is that by combining the predictions of multiple models, the
overall performance and accuracy can be improved compared to using a single
model. The individual models in an ensemble are often referred to as "base
models" or "weak learners." These base models can be of any type, such as
decision trees, neural networks, support vector machines, or any other machine
learning algorithm. Each base model in the ensemble is trained independently
on a subset of the training data or using a different algorithm variation to
introduce diversity. There are several common techniques for combining the
predictions of the base models in an ensemble. The two most popular methods
are:
1) Voting: In voting-based ensembles, each base model independently predicts
the target variable, and the final prediction is made by aggregating the
individual predictions. This can be done through majority voting (where the
most frequent prediction is selected) or weighted voting (where each model's
prediction is given a specific weight).
2) Averaging: Averaging-based ensembles compute the average or weighted
average of the predictions made by the base models. This approach is
commonly used when dealing with regression problems, where the final
prediction is a continuous value.
Ensemble learning offers several advantages over using a single model. It
helps in reducing overfitting by introducing model diversity and capturing
different aspects of the data. Ensemble models tend to have better
generalization capabilities and can handle complex patterns in the data. They
are also more robust to noise and outliers in the training data.
Some popular ensemble learning algorithms include Random Forest,
AdaBoost, Gradient Boosting, and Bagging. Each algorithm employs a specific
strategy to train and combine the base models effectively. Overall, ensemble
learning is a powerful technique that can significantly improve the
performance and accuracy of machine learning models by leveraging the
collective knowledge of multiple models. Ensemble methods can help reduce
the bias introduced by individual models. If a base model is biased in some
way, combining it with other models that have different biases can lead to a
more balanced and unbiased overall prediction.
The dataset used is the Banana Leaf Dataset from Kaggle.com and it has
2000 images across 2 classes of healthy and unhealthy leaves with
256x256 pixels of each leaf.
1.4.1 Data Augmentation
In machine learning, data augmentation is used to expand the size and
diversity of a training dataset by generating synthetic data from existing
data. This technique is particularly advantageous for detecting plant
diseases, as there may be a limited number of images available for
training.
There are several methods to perform data augmentation in the context
of plant disease detection using machine learning, including:
Image Rotation: Rotating the image at various angles to generate new
images from the existing dataset.
Image Flipping: Flipping the image either horizontally or vertically to
create variations.
Image Scaling: Scaling the image up or down to introduce new
perspectives.
Image Cropping: Cropping the image at different sizes and positions to
extract new image sections.
Image Translation: Shifting the image in different directions (e.g., up,
down, left, or right) to generate new samples.
Colour Augmentation: Altering the brightness, contrast, and saturation
of the image to simulate different lighting conditions and scenarios.
By applying these augmentation techniques, a larger and more varied
training dataset can be created, which helps improve the performance
and accuracy of the machine learning model in detecting plant diseases.
However, it is important to note that data augmentation alone does not guarantee
optimal model performance. The overall effectiveness of the detection system
also depends on other critical factors, such as the selection of appropriate
algorithms, fine-tuning of hyperparameters, and the quality of the original
dataset.
Fig 1.1 Infected leaf
1.4.2 Data Acquisition
Acquiring data is an essential aspect of developing machine learning models
for detecting plant diseases. There are several methods available for data
acquisition, including capturing images of diseased plants using a high-
resolution camera in a greenhouse, field, or laboratory setting. Multiple images
should be taken from different angles and lighting conditions to create a
diverse dataset. Another option is to use existing datasets, such as Plant
Village, Plant Pathology 2020, and Fungi Net, which already contain images of
plants with and without diseases. Crowdsourcing platforms like Zooniverse or
Amazon Mechanical Turk can also be utilized to collect labelled images of
plant diseases from numerous contributors. This approach may require some
supervision to ensure accurate labelling and can be time-consuming.
Engaging with plant pathologists or agronomists who specialize in plant
diseases can offer access to crucial data and expertise. They can advise on the
selection of images to collect, which diseases to prioritize, and how to label
images accurately. After acquiring the data, it's vital to correctly label the
images with the appropriate disease class. This process is typically
accomplished manually by human experts or with the aid of crowdsourcing
platforms. Once the images have been labelled, they are utilized to train a
machine learning model to effectively classify new, unseen images of diseased
plants. Deep learning techniques, and in particular Convolutional Neural
Networks (CNNs), have led to significant progress in image processing. Since
2016, many applications for the automatic identification of crop diseases have
been developed. These applications could serve as a basis for the development
of expertise assistance or automatic screening tools. Such tools could
contribute to more sustainable agricultural practices and greater food
production security. Acquiring data is an essential aspect of developing
machine learning models for detecting plant diseases. There are several
methods available for data acquisition, including capturing images of diseased
plants using a high-resolution camera in a greenhouse, field, or laboratory
setting. Multiple images should be taken from different angles and lighting
conditions to create a diverse dataset. Another option is to use existing
datasets, such as Plant Village, Plant Pathology 2020, and Fungi Net, which
already contain images of plants with and without diseases. Crowdsourcing
platforms like Zooniverse or Amazon Mechanical Turk can also be utilized to
collect labelled images of plant diseases from numerous contributors. This
approach may require some supervision to ensure accurate labelling and can be
time-consuming.
Engaging with plant pathologists or agronomists who specialize in plant
diseases can offer access to crucial data and expertise. They can advise on the
selection of images to collect, which diseases to prioritize, and how to label
images accurately. After acquiring the data, it's vital to correctly label the
images with the appropriate disease class. This process is typically
accomplished manually by human experts or with the aid of crowdsourcing
platforms. Once the images have been labelled, they are utilized to train a
machine learning model to effectively classify new, unseen images of diseased
plants. Deep learning techniques, and in particular Convolutional Neural
Networks (CNNs), have led to significant progress in image processing. Since
2016, many applications for the automatic identification of crop diseases have
been developed. These applications could serve as a basis for the development
of expertise assistance or automatic screening tools. Such tools could
contribute to more sustainable agricultural practices and greater food
production security.
CHAPTER 2
LITERATURE SURVEY
Machine learning approaches offer several advantages over traditional methods
in detecting plant diseases, including the ability to process large amounts of
data quickly and accurately, detect subtle changes in plant health, and provide
standardized diagnoses without subjectivity. Despite significant advancements
in machine learning for plant disease detection, challenges remain, such as the
requirement for large and varied datasets, generalization of models to new
environments, and the interpretation of models for decision-making. However,
the application of machine learning has the potential to create efficient and
effective tools for detecting and managing plant diseases.
1.S. S. Sannakki et al. [1] proposed a "Classification of Pomegranate Diseases
Based on Back Propagation Neural Network," which mainly works on the
method of segmenting the defected area. Colour and texture are used as the
features, and neural networks are employed for classification.
2.P. R. Rothe et al. [2] introduced "Cotton Leaf Disease Identification using
Pattern Recognition Techniques," which uses snake segmentation. Here, Hu’s
moments are used as distinctive attributes, and the Active Contour Model
limits the infection spot. A BPNN classifier handles the multi-class problem,
achieving an average classification accuracy of 85.52%.
3.Aakanksha Rastogi et al. [3] presented "Leaf Disease Detection and Grading
using Computer Vision Technology & Fuzzy Logic," where K-means
clustering is used to segment the defected area. GLCM (Gray Level Co-
occurrence Matrix) is used for extracting texture features, and fuzzy logic is
applied for disease grading. An Artificial Neural Network (ANN) is used as a
classifier to check the severity of the diseased leaf.
4.Godliver Owomugisha et al. [4] developed an "Automated Vision-Based
Diagnosis of Banana Bacterial Wilt Disease and Black Sigatoka Disease,"
where colour histograms are extracted and transformed from RGB to HSV.
Five shape attributes are used, and area under the curve analysis is performed
for classification. They applied several classifiers, such as Nearest Neighbours,
Decision Tree, Random Forest, Extremely Randomized Tree, Naïve Bayes, and
Support Vector Classifier. The Extremely Randomized Tree classifier yielded
the highest score, providing real-time information and flexibility to the
application.
5.Chunjiang Zhao et al. [5] proposed an "SVM-based Multiple Classifier System
for Recognition of Wheat Leaf Diseases." In this study, colour features are
represented in RGB to HIS, and seven invariant moments are used as shape
parameters. An SVM classifier is employed for disease detection, and a web-
based tool is developed for fruit disease identification through image upload.
The system achieved an accuracy of 82% for detecting pomegranate disease.
6.Leaf Disease Detection and Recommendation of Pesticides using Convolution
Neural Network (2018): This paper addresses crop production problems in
India, which severely affect rural farmers and the country’s economy. It
proposes a system for leaf disease detection and pesticide recommendation
using Convolution Neural Networks (CNNs). The system uses image
preprocessing, feature extraction from the Plant Village dataset, and CNN for
classification. The highest accuracy achieved was 95.05% for a 5-layer model
with 15 epochs, and the highest validation accuracy was 89.67% for 20 epochs
using TensorFlow.
7.An Artificial Intelligence and Cloud-Based Collaborative Platform for Plant
Disease Identification, Tracking, and Forecasting for Farmers (2018): This
paper presents an automated, low-cost, and easy-to-use solution to help
farmers with precise, instant, and early diagnosis of crop diseases. It uses deep
Convolutional Neural Networks (CNNs) for disease classification, integrates
social collaborative platforms for accuracy improvement, and utilizes
geocoded images for disease density maps. The high-performing CNN model
"Inception" enables real-time disease classification via a mobile app.
8.CNN-based Leaf Disease Identification and Remedy Recommendation System
(2019): This paper utilizes an open dataset of 5,000 pictures of diseased and
healthy plants. Convolutional neural networks (CNN) and semi-supervised
techniques are employed to characterize crop species and detect the disease
status of four different classes. The system achieved 99.32% classification
accuracy, demonstrating CNN's ability to extract important features in a natural
environment, which is necessary for plant disease classification.
9.Plant Leaf Diseases Detection and Classification Using Image Processing and
Deep Learning Techniques (2020): This paper presents a system for detecting
and classifying plant leaf diseases using deep learning. The images used were
obtained from the Plant Village dataset. The system utilizes Convolutional
Neural Networks (CNNs) to classify 15 disease classes from plants such as
tomatoes, pepper, and potatoes. The system achieved a training accuracy of
98.29% and a testing accuracy of 98.029%.
Chapter 3
System Design
3.1 Overview of Existing Work
Existing work related to leaf disease detection using CNN show to detect and
classify leaf disease using image processing techniques that follow steps like
Fig.2 General Block Diagram of Feature Based Approach [13]
Image Acquisition: image acquisition in the first load the image in digital
picture process and that consist capturing the image through digital
camera and stores it in digital media for additional MATLAB operations
[13][7]. Image Preprocessing: The main aim of image pre-processing is to
enhance the image information contained unwanted distortions or to
reinforce some image features for any processing [7][13]. Preprocessing
technique uses various techniques like dynamic image size and form,
filtering of noise, image conversion, enhancing image and morphological
operations[7][13]. Feature extraction: After clusters are formed texture
features are extracted using GLCM [13] (Gray-Level Co-occurrence
Matrix).
Classification: In classification is used for testing the leaf disease. The
Random forest classifier is used for classification.
3.2 Implementation Work
Apple, grape, potato, and tomato plant leaves which are categorized total 24
types of labels apple label namely: Apple scab, Black rot, Apple rust, and
healthy. Corn label namely: Corn Cercospora Gray spot, Corn rust, Corn
healthy, Corn Blight [11][13]. Grape label namely: Black rot, Esca, healthy,
and Leaf blight. Potato label namely: Early blight, healthy, and Late blight.
Tomato label namely: bacterial spot, early blight, healthy, late blight, leaf
mold, septoria leaf spot, spider mite, target sport, mosaic virus, and yellow leaf
curl virus[11][13].
The dataset consists of 31,119 images of apple, corn, grape, potato, and
tomato, out of 31,119 images 24000 images are used. all Images are resized
into 256 x 256,that images divided into two parts training and testing dataset,
the whole range of the train test split using 80-20 (80% of the whole dataset
used for the training and 20% for the testing)[11][13]. Then train CNN model.
Fig 3: Proposed Workflow [13]
Convolutional neural networks (CNN) can be used for the computational
model creation that works on the unstructured image inputs and converts to
output labels of corresponding classification[13]. They belong to the category
of multi-layer neural networks which can be trained to learn the required
features for classification purposes [13].
Less pre-processing is required in comparison to traditional approaches and
automatic feature extraction is performed for better performance. For leaf
disease detection, the best results could be seen with the use of a variation of the
LeNet architecture [13].
LeNet consists of convolutional, activation, max-pooling, and fully connected
layer also LeNet is simple CNN model. This architecture used for the
classification of the leaf diseases in LeNet model [13]. It consists of an
additional block of convolution, activation, and pooling layers in comparison to
the original LeNet architecture. The model used in this paper been shown in Fig.
2.Each block consists of a convolution, activation, and a max pooling layer.
Three such blocks followed by fully connected layers and soft-max activation
are used in this architecture. Convolution and pooling layers are used for feature
extraction whereas the fully connected layers are used for classification.
Activation layers are used for introducing non-linearity into the network [13].
Convolution layer applies convolution operation for extraction of features. With
the increase in depth, the complexity of the extracted features increases. The
size of the filter is fixed to 5 × 5 whereas number of filters is increased
progressively as we move from one block to another. The number of filters is 20
in the first convolution block while it is increased to 50 in the second and 80 in
the third. This increase in the number of filters is necessary to compensate for
the reduction in the size of the feature maps caused using pooling layers in each
of the blocks. After the application of the convolution operation feature maps
are zero padded, to preserve the size of the image. The max pooling layer is
used for reduction in size of the feature maps, speeding up the training process,
and making the model less variant to minor changes in input. The kernel size for
max pooling is 2×2. Re-LU activation layer is used in each of the blocks for the
introduction of non-linearity. Also, Dropout regularization technique has been
used with a keep probability of 0.5 to avoid overfitting the train set. Dropout
regularization randomly drops neurons in the network during iteration of
training to reduce the variance of the model and simplify the network which
aids in prevention of over fitting. Finally, the classification block consists of two
sets fully connected neural network layers each with 500 and 10 neurons
respectively. The second dense layer is followed by a soft max activation
function to compute the probability scores for the ten classes [13]. Less pre-
processing is required in comparison to traditional approaches and automatic
feature extraction is performed for better performance. For leaf disease
detection, the best results could be seen with the use of a variation of the LeNet
architecture [13].
LeNet consists of convolutional, activation, max-pooling, and fully connected
layer also LeNet is simple CNN model. This architecture used for the
classification of the leaf diseases in LeNet model [13]. It consists of an
additional block of convolution, activation, and pooling layers in comparison to
the original LeNet architecture. The model used in this paper been shown in Fig.
2.Each block consists of a convolution, activation, and a max pooling layer.
Three such blocks followed by fully connected layers and soft-max activation
are used in this architecture. Convolution and pooling layers are used for feature
extraction whereas the fully connected layers are used for classification.
Activation layers are used for introducing non-linearity into the network [13].
Convolution layer applies convolution operation for extraction of features. With
the increase in depth, the complexity of the extracted features increases. The
size of the filter is fixed to 5 × 5 whereas number of filters is increased
progressively as we move from one block to another. The number of filters is 20
in the first convolution block while it is increased to 50 in the second and 80 in
the third. This increase in the number of filters is necessary to compensate for
the reduction in the size of the feature maps caused using pooling layers in each
of the blocks. After the application of the convolution operation feature maps
are zero padded, to preserve the size of the image. The max pooling layer is
used for reduction in size of the feature maps, speeding up the training process,
and making the model less variant to minor changes in input. The kernel size for
max pooling is 2×2. Re-LU activation layer is used in each of the blocks for the
introduction of non-linearity. Also, Dropout regularization technique has been
used with a keep probability of 0.5 to avoid overfitting the train set. Dropout
regularization randomly drops neurons in the network during iteration of
training to reduce the variance of the model and simplify the network which
aids in prevention of over fitting. Finally, the classification block consists of two
sets fully connected neural network layers each with 500 and 10 neurons
respectively. The second dense layer is followed by a soft max activation
function to compute the probability scores for the ten classes [13].
Fig.4 Experimental result(a)input image(b)convolution layer-1(c) convolution layer-2 (d)
convolution layer-3 (e)flatting layer [3].
Further, in every experiment, the overall accuracy over the whole period of
training and testing regular intervals (for every epoch) will be computed. The
overall accuracy score will be used for performance evaluation [3]. Transfer
learning is a knowledge- sharing method that reduces the size of the training data,
contains 224*224 image fix size. To transfer the learning of a pre-trained model
to a new model Transfer learning is useful. Transfer learning has been used in
various applications, such as plant classification, software defect prediction,
activity recognition and sentiment classification [3]. In this, the performance of
the proposed Deep CNN model has been compared with popular transfer learning
approach VGG16.
Fig .5 VGG16 layered architecture [18]
VGG16 is a convolutional neural network. The input to convolution layer size is
224 x 224 RGB fixed image size. The image is passed to convolutional layers,
where the filters used with a very small receptive field which is the smallest
size to capture the notion of left, right, up, and down, centre: 3×3 [18]. Some of
the configurations, it utilizes 1×1 convolution filters, which can be linear
transformation followed by non-linearity of the input channels [18]. The
convolution stride is fixed that is one pixel the spatial padding of convolution
layer input is such that the spatial resolution is preserved after convolution, i.e.
the padding is 1 pixel for 3×3 convolution layers. Five max-pooling layers
carried out spatial pooling, which follow some of the convolution layers (not all
the conv. layers are followed by max-pooling).
Chapter 4
Methodology and Technology
4.1 Dataset Detail
The Plant leaf diseases dataset with augmentation data-set, 39 different classes
of plant leaf and background images are available. The data-set containing
61,486 images. We used six different augmentation techniques for increasing
the data-set size. These techniques are 1)image flipping, 2) Gamma correction,
3) noise injection, 4) PCA colour augmentation, 5) rotation, and 6) Scaling [11]
[13].
We use The Plant leaf diseases dataset with augmentation dataset only 30,052
images with 24 labels. The apple label namely: Apple scab, Black rot, apple
rust, and healthy. Corn label namely: Corn Cercospora spot gray spot, Corn
rust, Corn healthy, Corn Northern Blight[13][11]. Grape label namely: Black
rot, Esca, healthy, and Leaf blight. Potato label namely: Early blight, healthy,
and Late blight. Tomato label namely: bacterial spot, early blight, healthy, late
blight, leaf mold, septoria leaf spot, spider mite, target sport, mosaic virus,
yellow leaf curl virus[13][11].
TABLE 2.LEAF DISEASE DATASET
Apple scab[11] Apple black rot[11] Cader apple rust[11]Apple healthy Corn spot[11] Corn
rust[11]
Corn healthy[11] Corn Blight[11] Grape rot[11] Grape Esca [11] Grape healthy[11] Grape
blight[11]
Potato Early Potato Healthy [11] Potato Late Tomato Blight[11] Tomato Mold[11] Tomato
Spot[11] Blight [11] blight[11]
Tomato Bacterial Tomato Early Tomato Healthy Tomato Two-spotted Tomato Target
Tomato mosaic
Spot[11] blight[11] spider mite[11] spot[11] virus[11]
Fig.7 vegetable and fruits leaves with diseases [11] [13].
The methodology adopted in this project is based on the machine learning workflow,
which consists of multiple steps such as data collection, preprocessing, model
building, evaluation, and deployment. The objective was to build an end-to-end system
that could identify plant diseases from images of leaves using Convolutional Neural
Networks (CNN). The reason for choosing CNN is its ability to learn spatial
hierarchies in visual data, which is essential for image classification tasks.
The entire system was implemented using Python as the core programming language.
The model was built using TensorFlow and Keras, and it was deployed using the Flask
web framework. The data was collected from real-world sources such as farms, fields,
and local gardens to create a diverse dataset for better model generalization. Data plays
a crucial role in the success of any machine learning model. For this project, no
benchmark dataset was used. Instead, we manually captured images of plant leaves
exhibiting various diseases. The dataset includes images from multiple angles, under
different lighting conditions, and with varying backgrounds. The total dataset
comprises over 1200 labeled images, divided into multiple disease categories including
healthy leaves. The methodology adopted in this project is based on the machine
learning workflow, which consists of multiple steps such as data collection,
preprocessing, model building, evaluation, and deployment. The objective was to build
an end-to-end system that could identify plant diseases from images of leaves using
Convolutional Neural Networks (CNN). The reason for choosing CNN is its ability to
learn spatial hierarchies in visual data, which is essential for image classification tasks.
The entire system was implemented using Python as the core programming language.
The model was built using TensorFlow and Keras, and it was deployed using the Flask
web framework. The data was collected from real-world sources such as farms, fields,
and local gardens to create a diverse dataset for better model generalization. Data plays
a crucial role in the success of any machine learning model. For this project, no
benchmark dataset was used. Instead, we manually captured images of plant leaves
exhibiting various diseases. The dataset includes images from multiple angles, under
different lighting conditions, and with varying backgrounds. The total dataset
comprises over 1200 labeled images, divided into multiple disease categories including
healthy leaves. The images were resized to 128x128 pixels for computational
efficiency. The following preprocessing steps were applied:
Resizing: To ensure consistency in input size.
Normalization: Pixel values were scaled to a range of 0 to 1.
Augmentation: Techniques like rotation, zoom, flipping, and brightness
adjustments were applied to artificially increase dataset size and diversity.
Label Encoding: Each image was assigned a categorical label corresponding to a
plant disease. These preprocessing steps helped improve model performance and
reduce overfitting. The technology stack used for the development of this system
includes the following tools and frameworks:
Programming Language: Python 3.9
Machine Learning Libraries: TensorFlow 2.x, Keras
Image Processing: OpenCV, PIL (Python Imaging Library)
Data Handling: NumPy, Pandas
Visualization: Matplotlib, Seaborn
Web Development: Flask (Backend), HTML/CSS (Frontend), Bootstrap (UI
Styling) Python was chosen due to its extensive support for machine learning and
image processing. TensorFlow and Keras were used for building and training the CNN
model. Flask provided the web server capabilities for real-time predictions. The CNN
architecture was designed from scratch to suit the size and complexity of the dataset. It
included the following layers:
Input Layer: Accepts 128x128 RGB images.
Convolutional Layers: Extracts features using kernels.
Activation Layers (ReLU): Adds non-linearity.
Max Pooling Layers: Reduces dimensionality.
Dropout Layers: Prevents overfitting.
Flatten Layer: Converts 2D to 1D.
Fully Connected Layers (Dense): Classifies extracted features.
Softmax Output Layer: Predicts the probability of disease classes.
Model Training Parameters:
Optimizer: Adam
Loss Function: Categorical Crossentropy
Batch Size: 32
Epochs: 50
Validation Split: 20%
The model was trained on a system with 8GB RAM and an Intel i5 processor. GPU
support was optional and used for faster training. The model achieved over 91%
accuracy on the validation dataset. The evaluation metrics used include:
Accuracy: Percentage of correctly classified images.
Precision: Proportion of true positive results.
Recall: Proportion of actual positives that were identified.
F1-Score: Harmonic mean of precision and recall.
Confusion Matrix: Visual representation of predictions vs actuals.
To optimize the model, techniques like dropout regularization and data augmentation
were used. Dropout layers were added after convolution and dense layers to minimize
overfitting. After training and evaluating the model, it was saved using
TensorFlow’s .h5 format. The deployment setup consisted of:
Backend: Flask web server to handle HTTP requests and invoke model
predictions.
Frontend: A simple HTML form where users could upload leaf images.
Prediction Pipeline: Input image is preprocessed, passed to the model, and the
prediction is returned to the user.
This architecture allows for real-time prediction and can be easily deployed on
platforms like Heroku or local servers. The user interface was designed to be minimal
and user-friendly. Features include:
Upload button for leaf image.
Display area for prediction result and confidence score.
Informative layout with clear instructions.
This ensures accessibility even for users who are not tech-savvy, such as farmers.
6.8 Advantages of the Approach
Custom Dataset: Real-world images make the model more practical.
High Accuracy: CNN provided reliable classification.
Accessibility: Web-based app is usable on any device with a browser.
Low Cost: Uses free and open-source tools.
Scalability: Can be expanded to detect more diseases or crops.
6.9 Limitations and Scope for Future Enhancements
Limited Dataset Size: More data would improve accuracy.
Lighting Variations: May affect prediction quality.
Internet Requirement: Future versions can include offline mobile apps.
Treatment Suggestions: Integrating expert-based solutions for treatment can
enhance usability.
Multilingual Interface: Adding local languages will improve accessibility.
4.2 Hardware Requirements
Processor : Any Processor
RAM : more than 2GB
Hard Disk : 10 GB
Input device : Standard Keyboard and Mouse
Output device : High Resolution Monitor
Memory : 1GB
RAM Requirements :Different plant leaf images (healthy and affected)
4.3 Software Requirements
Operating system : Windows XP and above, Windows 7
IDLE : Python IDLE
Data : Leaf Dataset Modules : NumPy, pandas, matplotlib, sklearn Processor :Ip3
processor.
4.3.1 Input Requirement
Functional requirements in software engineering define the function of a software
system or its components. Such requirements specify a set of inputs, behaviour, and
outputs that may include calculations, technical details, data manipulation, processing,
and other functionalities that explain what the system aims to accomplish. Use cases
capture the behavioural requirements that detail how the system uses the functional
requirements. In this case, the system is expected to perform the following tasks: (1)
acquiring simple data in an Excel or CSV format, (2) performing data cleaning or
preprocessing to transform raw data for another processing procedure, (3) generating
visual representations such as charts or images to display information, and (4)
producing predicted output.4.4 Tools & Technologies
4.4.1 PYTHON
Python as a language has a vast community behind it. Any problem which may be
faced is simply resolved with a visit to Stack Overflow. Python is among the foremost
standard language on the positioning that makes it very likely there will be straight
answer to any question
Python has an abundance of powerful tools prepared for scientific computing
Packages like NumPy, Pandas and SciPy area unit freely available and well
documented. Packages like these will dramatically scale back, and change the code
required to write a given program. This makes iteration fast.
Python as a language is forgiving and permits for program that appear as if pseudo
code. This can be helpful once pseudo code given in tutorial papers must be enforced
and tested. Using python this step is sometimes trivial.
However, Python is not without its errors. The language is dynamically written and
packages are area unit infamous for Duck writing. This may be frustrating once a
package technique returns one thing that, for instance, looks like an array instead of
being an actual array. Plus, the fact that standard Python documentation does not
clearly state the return type of a method, this can lead to a lot of trials and error testing
that will not otherwise happen in a powerfully written language. This is a problem that
produces learning to use a replacement Python package or library more difficult than it
otherwise may be. Python was the central language used in the development of this
project due to its simplicity, readability, and a vast ecosystem of libraries and
frameworks specifically designed for data science, machine learning, and web
development. It is a high-level, interpreted programming language known for its clear
syntax and dynamic typing, which makes it ideal for both prototyping and production-
level applications.
4.4.2 NUMPY
NumPy is python package which provide scientific and higher-level mathematical
abstractions wrapped in python. It is [19] the core library for scientific computing,
that contains a strong n- dimensional array object, provide tools for integrating C, C+
+ etc. It is additionally useful in linear algebra, random number capability etc.
NumPy’s array type augments the Python language with an efficient data structure
used for numerical work. NumPy additionally provides basic numerical routines, like
tools for locating Eigenvector. NumPy is a fundamental package for scientific
computing in Python. It provides support for arrays, matrices, and many high-level
mathematical functions. In this project, NumPy was used extensively for image
preprocessing, manipulation of pixel values, and array-based operations during data
augmentation and normalization.
Key Features of NumPy:
Efficient handling of large multi-dimensional arrays.
Mathematical functions such as linear algebra, Fourier transforms, and random
number generation.
Broadcasting capabilities that simplify mathematical operations on arrays of
different shapes.
Integration with other libraries like OpenCV, TensorFlow, and Pandas.
Application in Project:
Conversion of image pixel data into NumPy arrays.
Normalization of pixel values for model input.
Batch processing of training data.
Example:
import numpy as np
image_array = np.array(image)
normalized = image_array / 255.0
Jupyter Notebook: Interactive Development Environment
Jupyter Notebook is an open-source web application that allows users to create and
share documents containing live code, equations, visualizations, and narrative text.
It played a crucial role in the early stages of model building and experimentation in
this project.
Key Features of Jupyter Notebook:
Interactive code execution with immediate visual feedback.
Inline visualization support using Matplotlib and Seaborn.
Markdown support for adding documentation alongside code.
Ideal for iterative development and model debugging.
Application in Project:
Used for writing and testing the CNN model.
Step-by-step analysis and evaluation of training data.
Plotting accuracy and loss graphs for performance evaluation.
Example:
from matplotlib import pyplot as plt
plt.plot(history.history['accuracy'])
plt.plot(history.history['val_accuracy'])
plt.title('Model Accuracy')
plt.ylabel('Accuracy')
plt.xlabel('Epoch')
plt.legend(['Train', 'Validation'], loc='upper left')
plt.show()
By integrating both NumPy and Jupyter Notebook into the workflow, we enhanced
the model's reliability, accelerated experimentation, and improved overall code
readability and reusability.
4.4.3 . TENSORFLOW AND KERAS
TensorFlow is an open-source deep learning framework developed by Google. It is
one of the most widely used platforms for building and deploying machine learning
models due to its flexibility, scalability, and powerful computational graph-based
architecture. TensorFlow supports a wide array of machine learning tasks, including
image and speech recognition, natural language processing, and time-series
forecasting. In this project, TensorFlow was used to design and train a custom
Convolutional Neural Network (CNN) for identifying plant diseases from leaf
images.
Key Features of TensorFlow:
Computational Graphs: Enables efficient operations across multiple CPUs and GPUs.
Automatic Differentiation: Automatically calculates gradients for backpropagation.
TensorBoard: A powerful visualization tool for monitoring training metrics and
debugging.
Deployment Flexibility: Models can be deployed across mobile, web, and embedded
platforms.
Integration with Keras: Allows rapid model building through its high-level API.
Role in This Project: TensorFlow was the backbone of the deep learning model in our
project. It handled all the training and optimization processes. We used TensorFlow
to:
Define the CNN architecture.
Manage the training loop, compute loss and accuracy.
Save and export the trained model.
Load the model during deployment for predictions.
TensorFlow’s built-in functionalities such as ModelCheckpoint, EarlyStopping, and
LearningRateScheduler were also helpful for optimizing training and preventing
overfitting.
Keras is a high-level neural network API, written in Python and capable of running
on top of TensorFlow. It simplifies the development process of deep learning models
by offering an intuitive and user-friendly interface. Keras allows for easy prototyping
through its modular design and makes it easy to write clean, readable, and
manageable code.
Key Features of Keras:
Modularity: Layers, loss functions, optimizers, and metrics are all standalone
components.
User-Friendly API: Allows for quick model development.
Compatibility: Works seamlessly with TensorFlow backend.
Pretrained Models: Provides easy access to models like VGG, ResNet, etc., for
transfer learning.
Extensibility: Custom layers and metrics can be added when needed.
Use in Our Project: In our plant disease detection system, Keras served as the primary
interface for defining and training the CNN model. It allowed us to:
Build a sequential CNN model layer by layer.
Configure and compile the model with chosen optimizers and loss functions.
Train the model on our dataset using simple .fit() methods.
Evaluate performance using .evaluate() and predict results using .predict().
The Jupiter Notebook is an open-source web application that enables you to make
and share documents that contain live code, equations, visualizations, and narrative
text. Uses include: data cleaning and transformation, numerical simulation, statistical
modelling, data visualization, machine learning, and much more [23].
CHAPTER 5
IMPLEMENTATION AND RESULT ANALYSIS
The application of different models for prediction has provided the results in different
forms such as a confusion matrix, a comparison graph, and a bar graph to compare the
Accuracy, Precision, F1- Score and Recall of different models. These values have been
figured out using the formulae given below.
4.1 Formulae
1) St = Tp / (Tp + Fn) Sensitivity (St) = True Positives / (True Positives + False Negatives)
In simple terms, Sensitivity quantifies the proportion of actual positive instances that are
correctly classified as positive by the model, out of all positive instances.
2) Sf = Tn/ (Tn + Fp) Specificity (Sf) = True Negatives / (True Negatives + False Positives)
In simple terms, Specificity quantifies the proportion of actual negative instances that are
correctly classified as negative by the model, out of all negative instances.
3) TPR = Tp/ (Tp + Fn)True Positive Rate is the number of instances that were predicted to
be True and correctly identified as True.
4) FPR = Fp/ (Fp + Tn)False Positive Rate = False Positives / (False Positives + True
Negatives)
5) In simple terms, FPR quantifies the proportion of instances that are truly negative but are
incorrectly classified as positive by the model, out of all actual negative instances.
6) A = (Tp + Tn)/ (Tp + Tn + Fp + Fn)
This is the formula for calculating the accuracy of the model. In simple terms, accuracy
quantifies the proportion of correctly classified instances out of the total number of
instances. It provides an overall measure of how well the model performs in terms of
correctly predicting both positive and negative instances.
7) Precision(P) = Tp/ (Tp + Fp)
Precision = True Positives / (True Positives + False Positives) In simple terms, precision
measures how many of the instances that the model predicted as positive are positive. It
represents the model's ability to avoid false positives and is indicative of its accuracy
when identifying positive instances.
8) Recall(R) = Tp/(Tp + Fn)
Recall = True Positives / (True Positives + False Negatives) In simple terms, recall quantifies
the model's ability to correctly identify positive instances and captures the proportion of
actual positives that were correctly classified as positive. It is a measure of the model's
completeness or the proportion of relevant instances that were successfully retrieved.
9) ERR = (Fp + Fn)/ (Tp + Tn + Fp + Fn)
ERR = (False Positives + False Negatives) / (True Positives + False Positives + True
Negatives + False Negatives) ERR (Error Rate) is a performance metric used in machine
learning and classification tasks to measure the overall classification error of a model. It
represents the proportion of misclassified instances, both false positives and false
negatives, out of the total number of instances.
4.2 Result Analysis
The dataset is the Banana Leaves dataset, taken from Kaggle.com with 2000 different
images, in two classes of Healthy and Unhealthy leaves, and the following models were
applied on the dataset, the results are as follows.
1)VGG-16 Model
In Python, a file is regarded as a module. The module must be imported using the import
keyword before being used. By importing the module, the function or variables existing
in the file can be utilized in another file. Instead of importing the entire module, we can
merely import the necessary functions and variable names from the module. The "from"
keyword can be used to import only certain items when we only want those items
imported. By using import and the module name, i.e., the filename or the library to be
used, we can import the entire module. A Python library is a term that is widely used to
describe a group of linked modules. It contains code bundles that can be used with
many different software.
Fig 4.1 VGG-16 Epoch Results
Overfitting is a major issue when neural networks are trained using sample data. A neural
network model will learn very precise patterns in the sample data if more training epochs
are employed than are necessary. As a result, the model will not fit the new data set
properly. On The training data set (sample data), this model achieves great accuracy;
however, on the test data set, it does not. In other words, by overfitting the training set,
the model loses its capacity to generalize.
Fig 4.2. The results of VGG-16 with an accuracy of 94%
The Accuracy achieved by the VGG-16 model is 94%. When the result might potentially
comprise two or more classes, it is a technique to evaluate how effectively a deep learning
categorization system works. The table contains four possible combinations of predicted
and actual values. This program can be very effectively used to evaluate AUC-ROC
curves, recall, precision, specificity, accuracy, and—most crucially—all the
aforementioned. The dataset was divided into two classes the first being the healthy class
to train the model and the second being unhealthy leaves to check on the accuracy of the
model.
Fig 4.3 The Confusion Matrix for VGG-16 Model
The confusion matrix representing the True Positive, True Negative, False Positive and
False Negative values across the two curves of Predicted values and Actual values. The
True Positive value in this case is 5.0, meaning that of all the values in the dataset the
predicted value was true as well as the actual value. The True Negative value is 53.0
meaning that the model predicted the value to be negative and the actual value was
negative. False Positive value is 0.0 meaning that the predicted no value was predicted to
be false and came out as true. The False Negative value is 4.0 meaning 4 of the values
were predicted to be true but the actual value was false.
2) DenseNet201
Fig 4.4 The epochs for Dense Net Model
The Dense Net Model stopped after 12 epochs due to early stopping. If we let a complex
model train long enough on a given data set it can eventually learn the data exactly. Given
data that is not represented in the training set, the model will perform poorly when
analysing the data (overfitting). Conversely if the model is only trained for a few epochs,
the model could generalize well but will not have a desirable accuracy (underfitting). Hence
the model stops early to prevent it from learning the exact data.
Fig 4.5 The results for the Dense Net Model with an accuracy of 92%
The accuracy of the Dense Net Model is 92% , with the Recall being 1.00, meaning that the
False Negative value was 0, which means that there was no value where the model
predicted the value to be False and the actual value was True. The Precision is 0.91 which
means that the False Positive was greater than 0 meaning that there was a False value that
was predicted to be True. The F1 Score is 0.95 which is the harmonic representation of both
Precision and Recall, being this high means that the model is working well.
3) InceptionV3 Model
Fig 4.6 Architecture of the InceptionV3 Model
Fig 4.7 The epochs running for InceptionV3 Model
The InceptionV3 Model ran all the epochs without stopping early meaning that there
was enough variation in the dataset for the model to run all the way through because the
model stops early if there is not enough variation to prevent overfitting.
Fig 4.8 Confusion Matrix for InceptionV3 Model
The True Positive value for this model is 4.0 which means that there were 4 cases that were
predicted to be True and their actual value was True, there are 53.0 cases of True Negative
meaning they were predicted to be False and the actual value was False. The False Negative
value is 1.0 meaning that one value was predicted to be false but it turned out to be True.
Fig 4.9 The results for InceptionV3 with an accuracy of 90%
The accuracy for the InceptionV3 Model is 90%, with the Precision being 91% and the
Recall being 98% which means neither the False Positive was 0 nor the False Negative,
therefore there were a few cases where the model predicted the wrong value. The F1- Score
is 95% which is the harmonic representation of both the Precision and Recall, meaning that
the model is giving a majority correct prediction. Table 1. Comparison of results between
different models with the Banana Leaf Dataset
The highest accuracy is 94% achieved by the VGG-16 Model.
Table 1. Comparison of results between different models with the Banana Leaf Dataset
Model Precision Recall F1-Score Accuracy
VGG-16 0.93 1.0 0.96 94
DenseNet201 0.91 0.95 0.95 92
InceptionV3 0.91 0.98 0.95 90
Graph 1. Graph showing results on the Banana Leaf Dataset
The above graph compares the Precision, F1- Score and the Recall of all three models
and the precision is the highest for the VGG-16 Model, the Recall is the highest for the
VGG-16 Model, InceptionV3 Model has the highest F1-Score and overall DenseNet201
has the highest accuracy.
Applying Ensemble Learning
In ensemble learning, the averaging technique is a common method used to combine the
predictions of multiple base models. It is primarily employed when dealing with
regression problems, where the goal is to predict a continuous value rather than a class
label. The averaging technique works by taking the average of the predictions made by
each base model in the ensemble. This can be done using a simple arithmetic mean or by
applying weighted averaging, where each model's prediction is assigned a specific
weight.
We have used the two models with the highest accuracy and applied ensemble learning
to it, the models being DenseNet201 and VGG-16 with the Banana Leaf Dataset.
Fig 4.10 The Results of Ensemble Learning on both the classes
Macro average calculates the Precision, F1- Score and Recall for each class and then
finds the average by combining it with the other class and calculating the average of
both. This helps provide a definitive view of both the classes, giving equal weight to
each class. Weighted average Precision is calculated by taking the sum of all True
Positives and then divided it by the sum of all True Positives and False Positives of both
the classes which gives a definite view of the whole dataset. The same happens with
Weighted average recall and F1-Score. The accuracy is 85% for this combined model as
it takes out the redundancies in this previous model and gives a more precise viewpoint
of the situation.
Fig. 4.11 The Confusion Matrix Representing for the Ensemble Learning Model
The confusion matrix representing the True Positive, True Negative, False Positive and
False Negative values across the two curves of Predicted values and Actual values. The
True Positive value in this case is 5.0, meaning that of all the values in the dataset the
predicted value was true as well as the actual value. The True Negative value is 53.0
meaning that the model predicted the value to be negative and the actual value was
negative. False Positive value is 0.0 meaning that the predicted no value was predicted
to be false and came out as true. The False Negative value is 4.0 meaning 4 of the
values were predicted to be true but the actual value was false.
REFERENCE
[1] Robert G. de Luna, Elmer P. Dadios, Argel A. Bandala, “Automated Image Capturing
System for Deep Learning-based Tomato Plant Leaf Disease Detection and
Recognition,” International Conference on Advances in Big Data, Computing and Data
Communication Systems (icABCD) 2019.
[2] Suma VR Amog Shetty, Rishab F Tated, Sunku Rohan, Triveni S Pujar, “CNN based
Leaf Disease Identification and Remedy Recommendation System,” IEEE conference
paper 2019.
[3] Peng Jiang, Yuehan Chen, Bin Liu, Dongjian He, Chunquan Liang, “Real-Time
Detection of Apple Leaf Diseases Using Deep Learning Approach Based on Improved
Convolution Neural Networks,” IEEE ACCESS 2019.
[4] Geetharamani, Arun Pandian, “Identification of plant leaf diseases using a nine- layer
deep convolution neural network,” Computers and Electrical Engineering 76 (2019).
[5] Robert G. de Luna, Elmer P. Dadios, Argel A. Bandala, “Automated Image Capturing
System for Deep Learning-based Tomato Plant Leaf Disease Detection and
Recognition,” Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference.
[6] Omkar Kulkarni, “Crop Disease Detection Using Deep Learning,” IEEE access 2018.
[7] Abirami Devaraj, Karunya Rathan, Sarvepalli Jaahnavi and K Indira, “Identification of
[8] Plant Disease using Image Processing Technique,” International Conference on
Communication and Signal Processing, IEEE 2019.
[9] Velamakanni Sahithya, Brahmadevara Saivihari, Vellanki Krishna Vamsi, Parvathreddy
Sandeep Reddy and Karthigha Balamurugan, “GUI based Detection of Unhealthy
Leaves using Image Processing Techniques,” International Conference on
Communication and Signal Processing 2019.
[10] Balakrishna K Mahesh Rao, “Tomato Plant Leaves Disease Classification Using KNN
and PNN,” International Journal of Computer Vision and Image Processing 2019.
[11] Sladojevic, S., Arsenovic, M., Anderla, A., Culibrk, D., & Stefanovic, D. (2016).
“Deep Neural Networks Based Recognition of Plant Diseases by Leaf Image
Classification,” Computational Intelligence and Neuroscience, Hindawi Publishing
Corporation, 2016.
[12] Mohanty, S. P., Hughes, D. P., & Salathé, M. (2016). “Using Deep Learning for Image-
Based Plant Disease Detection,” Frontiers in Plant Science, 7:1419.
[13] Fuentes, A., Yoon, S., Kim, S. C., & Park, D. S. (2017). “A Robust Deep-Learning-
Based Detector for Real-Time Tomato Plant Diseases and Pests Recognition,” Sensors,
MDPI, 17(9), 2022.
[14] Brahimi, M., Boukhalfa, K., & Moussaoui, A. (2017). “Deep Learning for Tomato
Diseases: Classification and Symptoms Visualization,” Applied Artificial Intelligence,
31(4), 299–315.
[15] Kamilaris, A., & Prenafeta-Boldú, F. X. (2018). “Deep learning in agriculture: A
survey,” Computers and Electronics in Agriculture, 147, 70–90.
[16] Zhang, S., Wu, X., & You, Z. (2021). “Leaf disease recognition based on deep learning
and attention mechanism,” Computers and Electronics in Agriculture, 189, 106383.
DOI: 10.1016/j.compag.2021.106383
[17] Ferentinos, K. P. (2018). “Deep learning models for plant disease detection and
diagnosis,” Computers and Electronics in Agriculture, 145, 311–318.
DOI: 10.1016/j.compag.2018.01.009
[18] Too, E. C., Yujian, L., Njuki, S., & Yingchun, L. (2019). “A comparative study of fine-
tuning deep learning models for plant disease identification,” Computers and
Electronics inAgriculture,161,272–279.
DOI: 10.1016/j.compag.2018.03.032
[19] Hasan, M. M., & Mahmud, M. S. (2020). “Lightweight CNN for detecting plant
diseases from images,” Computer and Information Science, 13(3), 84–90.
DOI: 10.5539/cis.v13n3p84
[20] Liu, B., Zhang, Y., He, D., & Li, Y. (2021). “Identification of apple leaf diseases based
on deep convolutional neural networks,” Symmetry, 13(1), 11.
DOI: 10.3390/sym13010011
[21] Saleem, M. H., Potgieter, J., & Arif, K. M. (2019). “Plant disease detection and
classification by deep learning,” Plants, 8(11), 468.
DOI: 10.3390/plants8110468
[22] Rumpf, T., Mahlein, A.-K., Steiner, U., Oerke, E.-C., Dehne, H.-W., & Plümer, L.
(2010). “Early detection and classification of plant diseases with Support Vector
Machines based on hyperspectral reflectance,” Computers and Electronics in
Agriculture, 74(1), 91–99.
[23] Amara, J., Bouaziz, B., & Algergawy, A. (2017). “A deep learning-based approach for
banana leaf diseases classification,” BTW Workshop on Big Data in Agriculture, 79–88.
[24] Dhaka, V. S., Meena, S. V., Rani, G., Sinwar, D., Rajpurohit, R., & Gandomi, A. H.
(2021). “A survey of deep learning techniques for plant disease detection,” Computers
and Electronics in Agriculture, 187, 106247.
DOI: 10.1016/j.compag.2021.106247
[25] Wang, G., Sun, Y., & Wang, J. (2017). “Automatic image-based plant disease severity
estimation using deep learning,” Computational Intelligence and Neuroscience, 2017.
DOI: 10.1155/2017/2917536
TABLE 5. comparison table of CNN vs. VGG16
Chapter 5: Conclusion and Future work
5.1 Conclusion
We have studied about existing system feature based approach. It’s done by image processing
technique in this we have studied steps like image Acquisition, image preprocessing, Image
Segmentation, features extraction, classification.
Proposed system to achieve this purpose, we have use CNN and get accuracy is 90.23%. We
have also use VGG16 model to detect leaf disease but in our case CNN has better result than
VGG16.
In future we can add more classes of leaves and disease type.
References
[1] Robert G. de Luna, Elmer P. Dadios, Argel A. Bandala, “Automated Image
Capturing System for Deep Learning-based Tomato Plant Leaf Disease Detection and
Recognition,” International Conference on Advances in Big Data, Computing and Data
Communication Systems (icABCD) 2019.
[2] Suma VR Amog Shetty, Rishab F Tated, Sunku Rohan, Triveni S Pujar, “CNN
based Leaf Disease Identification and Remedy Recommendation System,” IEEE
conference paper 2019.
[3] Peng Jiang, Yuehan Chen, Bin Liu, Dongjian He, Chunquan Liang, “Real-
Time Detection of Apple Leaf Diseases Using Deep Learning Approach Based on
Improved Convolution Neural Networks,” IEEE ACCESS 2019.
[4] Geetharamani, Arun Pandian, “Identification of plant leaf diseases using a nine-
layer deep convolution neural network,” Computers and Electrical Engineering 76
(2019).
[5] Robert G. de Luna, Elmer P. Dadios, Argel A. Bandala, “Automated Image
Capturing System for Deep Learning-based Tomato Plant Leaf Disease Detection and
Recognition,” Proceedings of TENCON 2018 - 2018 IEEE Region 10 Conference.
[6] Omkar Kulkarni, “Crop Disease Detection Using Deep Learning,” IEEE access
2018.
[7] Abirami Devaraj, Karunya Rathan, Sarvepalli Jaahnavi and K Indira,
“Identification of
Plant Disease using Image Processing Technique,” International Conference on Communication
and Signal Processing, IEEE 2019.
[8] Velamakanni Sahithya, Brahmadevara Saivihari, Vellanki Krishna Vamsi,
Parvathreddy Sandeep Reddy and Karthigha Balamurugan, “GUI based Detection of
Unhealthy Leaves using Image Processing Techniques,” International Conference on
Communication and Signal Processing 2019.
[9] Balakrishna K Mahesh Rao, “Tomato Plant Leaves Disease Classification Using
KNN and PNN,” International Journal of Computer Vision and Image Processing 2019.
[10] Masum Aliyu Muhammad Abdu, Musa Mohd Mokji, Usman Ullah Sheikh,
Kamal Khalil, “Automatic Disease Symptoms Segmentation Optimized for
Dissimilarity Feature extraction in Digital Photographs of Plant Leaves,” IEEE 15th
International Colloquium on Signal Processing & its Applications 2019.
soft-max layer. The configuration of the fully connected layers is the identify the leaf disease
[18].
Fig 6.VGG16 architecture [18]
All hidden layers are equipped with the rectification Re-Lu Is rectified linear unit is contain
non- linearity on network, and Also noted that none of the networks contain Local Response
Normalization (LRN), such LRN does not improve the performance on the dataset [18].
B.
C. Image Segmentation: In image segmentation is used K-means cluster technique for
partitioning of pictures into clusters during which a minimum of one part of cluster contain
image with major space of unhealthy part [7][13]. The k means cluster algorithmic rule is
applied to classify the objects into K variety of categories per set of features [13][7].