0% found this document useful (0 votes)
5 views44 pages

Final Major Project

The document outlines a major project focused on the detection and classification of mango leaf diseases using Convolutional Neural Networks (CNNs), submitted by a group of students for their Master of Computer Application degree. It details the project's objectives, methodology, and the development of a publicly available dataset of mango leaves, which includes 4000 images representing various diseases. The project aims to enhance early disease detection to improve crop yield and quality in the South Indian mango industry.

Uploaded by

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

Final Major Project

The document outlines a major project focused on the detection and classification of mango leaf diseases using Convolutional Neural Networks (CNNs), submitted by a group of students for their Master of Computer Application degree. It details the project's objectives, methodology, and the development of a publicly available dataset of mango leaves, which includes 4000 images representing various diseases. The project aims to enhance early disease detection to improve crop yield and quality in the South Indian mango industry.

Uploaded by

rahulsen171123
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

MAJOR PROJECT ON:

MANGO LEAF DISEASE DETECTION AND


CLASSIFICATION

Major project Submitted in Partial Fulfilment of the


Requirements for the degree of Master of Computer
Application

Submitted By:
Sandip Mandal (13071022023)
Sovon Chanda (13071022051)
Amogh Pal (13071022034)
Biswarup Mukherjee (13071022024)
Tanmoy Chatterjee (13071022046)

Under the Supervision of


Prof. Shauvik Paul

Techno Main, Salt Lake


Kolkata -700091
(Maulana Abul Kalam Azad University of Technology)

1
Techno Main, Salt Lake
FACULTY OF MCA DEPARTMENT

CERTIFICATE OF RECOMMENDATION

This is to certify that we have completed my Major


project (MCAN-482) work titled “Major project on:
“MANGO LEAF DISEASE DETECTION AND
CLASSIFICATION”
under the direct supervision and guidance of Asst.
Prof. Shauvik Paul. I am satisfied with my work,
which is being presented for the partial fulfilment of
the degree of Master of Computer Application
(MCA), Techno Main Salt Lake, Kolkata.

_______________________
Prof. Shauvik Paul
Dept. of MCA
Techno Main Salt Lake, Kolkata: 700091

Date:

2
BONAFIDE CERTIFICATE

Certified that this report for the Data Science project titled

“MANGO LEAF DISEASE DETECTION AND CLASSIFICATION”

is a part of the fourth semester project work being carried out by

“SANDIP MANDAL, SOVON CHANDA, AMOGH PAL, BISWARUP

MUKHERJEE, TANMOY CHATTERJEE” as partial fulfilment for the

degree of Master of Computer Application, Maulana Abul Kalam

University of Technology, West Bengal, under my supervision.

Full Signature of the Candidates (with date)

1.

2.

3.

4.

5.

Prof. Shauvik Paul Prof. Dr. Shiladitya Chowdhury


Mentor Head of the Department

3
[Under Maulana Abul Kalam Azad University of Technology (MAKAUT)]

CERTIFICATE OF APPROVAL

The Major Project of Sandip Mandal (13071022023), Sovon Chanda


(13071022051), Amogh Pal (13071022034), Biswarup Mukherjee
(13071022024) and Tanmoy Chatterjee (13071022046) on the topic
‘MANGO LEAF DISEASE DETECTATION AND CLASSIFICATION’ is
hereby approved as a creditable project and study in the field and degree of
Master of Computer Application (MCA) and presented in the manner,
satisfactory to warrant its acceptance as a pre-requisite to the degree for
which it has been submitted. It is understood that, by this approval, the
undersigned does not necessarily endorse any statement made, opinion
expressed, or conclusion there but approves this Major Project only for the
purpose, for which it is submitted to the respected authority.

Examiner Examiner Examiner

4
ACKNOWLEDGEMENT

We take this occasion to thank God, almighty for blessing us with his
grace and taking our endeavour to a successful culmination. We extend
our sincere and heartfelt thanks to our esteemed guide, Prof. Shauvik
Paul, for providing us with the right guidance and advice at the crucial
junctures and for showing us the right way. We also take this
opportunity to express a deep sense of gratitude to our teachers and
staff for their kind-hearted support, guidance and utmost endeavor to
groom and develop our academic skills.

At the end we would like to express our sincere thanks to all our friends
and others who helped us directly or indirectly during the effort in
shaping this concept till now.

SANDIP MANDAL
BISWARUP MUKHERJEE
SOVON CHANDA
TANMOY CHATTERJEE
AMOGH PAL

5
TEAM STRUCTURE

In this project, Democratic Team Structure is followed, as the name implies,


does not enforce any formal team hierarchy. This team structure is appropriate for
this project since by following this model, the group of engineers can invent better
solutions than a single individual as in a chief programmer team. This team
structure is suitable for projects requiring less than five or six engineers as for
yours.
This team organization encourages egoless programming as programmers can
share their view and review one another's work.

6
TABLE OF CONTENTS

1. ABSTRACT

2. INTRODUCTION

3. PROJECT OVERVIEW

4. LITERATURE RIVIEW

5. METHODOLOGY

6. LOADING AN IMAGE FOR PREPARING IT

FOR PREDICTION

7. DISPLAY DISEASE PREDICTION

8. SUMMARY OF KEY FINDING

9. RECOMMENDATION FOR FUTURE WORK

10. REFERANCE

7
1. ABSTRACT
Agriculture is of one of the few remaining sectors that is yet to receive proper
attention from machine learning community. The importance of dataset in
machine learning discipline cannot be overemphasized. The lack of standard and
publicly available datasets related to agriculture impedes practitioners of this
discipline to harness full benefit of these powerful computational predictive tools
and techniques. To improve this scenario, we develop, to the best of our
knowledge, the first-ever standard, ready-to-use, and publicly available dataset of
mango leaves. The images are collected from four mango orchards of
Bangladesh, one of the top mango-growing countries of the world. The dataset
contains 4000 images of about 1800 distinct leaves covering seven diseases. We
also report accuracy metrics, namely precision, recall and F1 score of three deep
learning models. Although the dataset is developed using mango leaves of
Bangladesh only, since we deal with diseases that are common across many
countries, this dataset is likely to be applicable to identify mango diseases in other
countries as well, thereby boosting mango yield. This dataset is expected to draw
wide attention from machine learning researchers and practitioners in the field of
automated agriculture.
The South Indian mango industry is confronting severe threats due to various leaf
diseases, which significantly impact the yield and quality of the crop. The
management and prevention of these diseases depend mainly on their early
identification and accurate classification. The central objective of this research is
to propose and examine the application of Deep Convolutional Neural Networks
(CNNs) as a potential solution for the precise detection and categorization of
diseases impacting the leaves of South Indian mango trees. Our study collected a
rich dataset of leaf images representing different disease classes, including
Anthracnose, Powdery Mildew, and Leaf Blight. To maintain image quality and
consistency, pre-processing techniques were employed. We then used a
8
customized deep CNN architecture to analyze the accuracy of South Indian mango
leaf disease detection and classification. This proposed CNN model was trained
and evaluated using our collected dataset. The customized deep CNN model
demonstrated high performance in experiments, achieving an impressive 93.34%
classification accuracy. This result outperformed traditional CNN algorithms,
indicating the potential of customized deep CNN as a dependable tool for disease
diagnosis. Our proposed model showed superior accuracy and computational
efficiency performance compared to other basic CNN models. Our research
underscores the practical benefits of customized deep CNNs for automated leaf
disease detection and classification in South Indian mango trees. These findings
support deep CNN as a valuable tool for real-time interventions and improving
crop management practices, thereby mitigating the issues currently facing the
South Indian mango industry

9
2. INTRODUCTION

Mango, sometimes called the “King of Fruits,” is a precious fruit crop grown
in many nations. It is widely consumed and valued for its economic and
nutritional significance. India is a major producer; approximately 40% of
the world’s mangoes come from India, making it the leading country.
However, mango crops face significant challenges due to pests and
diseases, which result in substantial yield losses estimated at around 30%–
40%. Mango leaves, in particular, are susceptible to various diseases that
significantly impact mango production. Mango cultivation is a vital
agricultural activity in South India, contributing significantly to the
region’s economy. However, the growth and productivity of mango trees
are often hampered by various leaf diseases. These diseases can lead to
significant crop losses and reduced fruit quality if not detected and managed
promptly. Manual inspection and diagnosis of leaf diseases are time-
consuming, labor-intensive, and prone to errors, necessitating the
development of automated and accurate disease detection systems. Thus, the
need for autonomous, precise, rapid, and cost-effective plant disease
identification technology is developing. Image processing and machine
learning classify leaf diseases. Deep learning, a machine learning branch, has
garnered attention and found practical applications. It uses deep neural
networks to provide a helpful tool for diagnosing and categorizing plant
diseases. Deep learning, especially Deep Convolutional Neural Networks
(CNNs), has benefited image analysis tasks like disease diagnosis and plant
categorization. CNNs can automatically learn the discriminative features
required for complex pattern recognition tasks from the raw input images.

10
Significance of Early Mango Disease Detection

Mangoes are a vital agricultural crop, but their yield and quality can be
significantly impacted by various diseases. Early detection of these diseases is
crucial for several reasons:

Reduced Crop Loss: Early detection allows farmers to take timely action, such
as applying fungicides or removing infected plants, minimizing the spread of the
disease and saving a significant portion of the crop.

Improved Fruit Quality: Diseases can affect the appearance, taste, and
nutritional value of mangoes. Early detection helps ensure that only healthy fruits
reach the market, enhancing consumer experience and potentially fetching higher
prices.

Lower Treatment Costs: When diseases are detected early, the interventions
required are usually less intensive and expensive compared to situations where
the disease has progressed significantly.

Sustainable Farming Practices: Early detection promotes targeted application


of treatments, minimizing the use of pesticides and fungicides, which can have
negative environmental and health impacts.

Introduction to Convolutional Neural Networks (CNNs)

Convolutional Neural Networks (CNNs) are a powerful type of artificial neural


network architecture specifically designed for analyzing visual imagery. They are
loosely inspired by the structure and function of the visual cortex in the animal
brain, which processes visual information in a hierarchical manner.

CNNs consist of multiple layers of interconnected nodes, often arranged in a


three-dimensional grid. These layers work together to progressively extract
features from an image, starting with low-level edges and lines to more complex
shapes and objects in the higher layers.

Here's a breakdown of the key characteristics of CNNs:

Convolutional layers: These layers apply filters (also called kernels) that slide
across the image, extracting features like edges and shapes. The filters learn
weights and biases during the training process, allowing them to identify specific
patterns within the image.

11
Pooling layers: These layers down sample the output of the convolutional layers,
reducing the dimensionality of the data while preserving important information.
This helps to control computational cost and prevent overfitting.

Activation functions: These functions introduce non-linearity into the network,


allowing it to learn complex relationships between the features.

Common activation functions used in CNNs include ReLU (Rectified Linear


Unit) and sigmoid.

By applying these layers sequentially, CNNs can learn to represent images in a


hierarchical way, ultimately enabling them to perform tasks like image
classification, object detection, and image segmentation.

CNNs have revolutionized the field of computer vision due to their ability to
achieve high accuracy in various image recognition tasks. They are a cornerstone
of many applications, including:

Self-driving cars: CNNs are used to identify objects like vehicles, pedestrians,
and traffic signs, enabling autonomous vehicles to navigate their surroundings.

Medical image analysis: CNNs can be trained to detect abnormalities in X-ray,


MRI, and CT scan images, aiding in medical diagnosis.

Facial recognition: CNNs are adept at recognizing faces in images and videos,
with applications in security and social media

12
3.PROJECT OVERVIEW

This research project aims to develop a system for classifying diseased and
healthy mango leaves using Convolutional Neural Networks (CNNs). Early and
accurate detection of mango diseases is crucial for minimizing crop loss,
improving fruit quality, and promoting sustainable farming practices. As we saw
in section 1.1, early intervention can significantly benefit farmers and the
environment.

We will harness the power of CNNs, as explained in section 1.3, to analyze


images of mango leaves and automatically categorize them as healthy or diseased.
This project will involve the following steps:

Data Collection: We will collect a dataset of mango leaf images representing a


variety of healthy and diseased leaves. This dataset will serve as the foundation
for training and evaluating our CNN models.

Preprocessing: The collected images will undergo preprocessing steps to ensure


consistency and quality. This may involve resizing images to a standard
dimension, normalizing pixel values, and potentially applying other techniques
to enhance the data for the CNNs.

Model Selection and Customization: We will explore pre-trained CNN


architectures that have proven successful in image classification tasks. Some
potential candidates include EfficientNet, VGG16, and ResNet. These models
will be customized by adding new top layers specifically designed for classifying
mango leaf diseases in the categories.

Training: The customized CNN models will be trained on the prepared mango
leaf image dataset. During training, the models will learn to identify patterns and
features within the images that differentiate healthy from diseased leaves.

Evaluation: Once trained, the performance of each model will be evaluated on a


separate testing dataset. We will employ metrics like accuracy, precision, recall,
and F1-score to assess how effectively each model can classify the mango leaf
diseases.

Optimization: Based on the evaluation results, we will identify the most effective
CNN model for mango leaf disease classification. We may also explore
techniques for further optimizing the chosen model's performance.

13
4. LITERATURE REVIEW

CNN-based Plant Disease Detection Research

Building upon the foundation set in the literature review (Section 1.2), section 2.1
can delve deeper into specific research related to CNN-based plant disease
detection. Here's a possible structure:

Focus on Pre-trained CNN Architectures:

Discuss the advantages of using pre-trained CNN models (e.g., EfficientNet,


VGG16, ResNet) for plant disease detection tasks. These models come pre-
trained on vast image datasets, allowing them to learn general image recognition
features that can be fine-tuned for specific tasks like disease classification.

Briefly explain the chosen pre-trained models (EfficientNet, VGG16, ResNet)


you'll be using in your project. You can mention their architectural characteristics
(number of layers, filter sizes) at a high level.

Customization for Mango Leaf Disease Classification:

Explain how you'll customize these pre-trained models for the task of classifying
mango leaf diseases. This typically involves adding new top layers (fully
connected layers) to the pre-trained model. These new layers are trained on your
specific mango leaf disease image dataset to learn the features that differentiate
healthy from diseased leaves and distinguish between different disease
categories.

Comparison of Architectures (Optional):

If you plan to explore and compare multiple pre-trained models (EfficientNet,


VGG16, ResNet), consider including a table here. This table can summarize their
key architectural features (number of layers, filter sizes) for easy comparison.

Existing Approaches for Mango Leaf Disease Detection

Building on the foundation laid in section 2.1, which explores CNN architectures
for plant disease detection in general, section 2.2 can delve specifically into
existing research on applying CNNs to mango leaf disease classification. Here's
a possible structure:

14
Focus on Recent CNN Applications in Mango Leaf Disease Detection:

Conduct a literature search to identify relevant research articles published within


the last 3-5 years that explore CNN-based mango leaf disease detection. Look for
reputable sources in peer-reviewed journals and conferences related to computer
science, agriculture, or image processing.

Summarize the key findings of these studies. This could include:

The specific CNN architectures employed (e.g., pre-trained models like


EfficientNet, VGG16, ResNet, or custom architectures).

The disease categories included in the datasets used for training and testing the
models.

Any pre-processing techniques applied to the mango leaf images (e.g., resizing,
normalization).

Highlight the performance metrics used in these studies to evaluate the


effectiveness of the CNN models. Common metrics include accuracy, precision,
recall, and F1-score.

Comparative Analysis (Optional):

If you find multiple relevant studies, consider including a table summarizing their
key findings. This table can provide a quick comparison of aspects like:

CNN Architecture: Specify the type of CNN model used (pre-trained or custom)
and its variant (e.g., EfficientNet-B0, VGG16).

Disease Categories: List the specific mango leaf diseases the model was trained
to classify.

Performance Metrics: Include the reported accuracy or other relevant metrics


(e.g., F1-score) for each study.

Performance Comparisons and Limitations of Prior Work

Following the exploration of existing CNN applications in mango leaf disease


detection can analyze the performance comparisons and limitations identified in
the reviewed research. Here's how you can structure this section:

15
Analysis of Performance Variations:

Discuss the variations in accuracy and other performance metrics reported across
different studies in section 2.2. Consider factors that might contribute to these
variations:

Disease Category Scope: Some studies might focus on a limited set of common
diseases, while others aim for a broader range. Classifying a wider variety of
diseases can be inherently more challenging.

Dataset Size and Quality: The size and quality of the image datasets used for
training can significantly impact model performance. Larger and more diverse
datasets often lead to better generalization.

CNN Architecture Selection: The choice of CNN architecture (e.g., EfficientNet


vs. VGG16) can influence performance. Some architectures may be better suited
for specific tasks or image characteristics.

Impact of Pre-processing Techniques:

Analyze how pre-processing techniques employed in the reviewed studies might


affect model performance.

Techniques like image resizing, normalization, or noise reduction can improve


model training efficiency and potentially enhance accuracy.

Discuss any studies that compared the effectiveness of different pre-processing


methods for mango leaf disease classification tasks.

Limitations of Prior Work:

Identify limitations or areas for improvement in the reviewed research. This could
include:

Restricted Scope of Disease Classes: If prior studies focused on a limited set of


diseases, highlight the need for models that encompass a wider range of mango
leaf diseases relevant to real-world scenarios.

Challenges in Real-World Deployment: Discuss any potential challenges in


deploying these CNN models in real-world agricultural settings. This might
involve considerations like computational resources required or the need for user-
friendly interfaces for farmers.

16
5. METHODOLOGY

The role of data is tremendously important in machine learning to the extent that
it is believed by the practitioners that it is the quality and quantity of the data, and
not the mathematical model, that plays the pivotal role in performance of modern
machine learning systems. That is why researchers must follow the standard
practices from the beginning to the end of dataset preparation procedure. In this
section, firstly, we describe the steps we take in our dataset prepa- ration task.
Secondly, we analyze the visual characteristics of leaf images pertaining to
different diseases. Thirdly, we list the key challenges we faced during the dataset
development.

Data Collection and Preprocessing

This section outlines the crucial steps involved in preparing your dataset for
training and evaluating the CNN models for mango leaf disease classification.
Here's a breakdown of the key elements you can include:

Data Source:

Specify how you will acquire the mango leaf images for your dataset. There are
two main options:

Field Collection: You can collect images directly from mango trees in orchards
or fields. This allows you to capture a variety of disease conditions and
environmental variations that might be present in real-world scenarios. However,
field collection requires more time, resources, and potentially controlled settings
to ensure consistent image quality.

Publicly Available Datasets: If field collection is not feasible, you can explore
publicly available datasets containing images of healthy and diseased mango
leaves. These datasets are often curated by research institutions or organizations
and can be a good starting point. Be sure to check the licensing terms associated
with any publicly available datasets you plan to use.

Disease Classes of Interest:

Define the specific mango leaf diseases your CNN models will be trained to
classify. This decision will influence the data collection process and the overall
effectiveness of your system. Here are some factors to consider:

17
Prevalence: Focus on diseases that are economically important or widespread in
your target region.

Data Availability: If using a publicly available dataset, ensure it covers the


disease classes you're interested in.

Number of Classes: While including a wider range of diseases can be beneficial,


it also increases the complexity of the classification task. Start with a manageable
number of classes and consider expanding it later.

Image Acquisition and Annotation (if field collection):

If collecting images in the field, describe the process of capturing the images.
This might involve details like:

The type of camera or imaging device used.

Techniques for ensuring consistent lighting, background, and image resolution.

The process of collecting leaves with different disease severities (if applicable).

Following image capture, you'll need to annotate each image with the
corresponding disease class (healthy or specific disease type). This annotation
process can be done manually by experts or through crowdsourcing platforms.

Data Preprocessing:

Regardless of the data source, some preprocessing steps are essential to ensure
the quality and consistency of your dataset for training the CNN models. Here are
some common techniques you might employ:

Resizing: Resize all images to a standard dimension. This ensures that the CNN
model receives inputs of uniform size.

Normalization: Normalize the pixel values in the images to a specific range (e.g.,
0-1 or -1 to 1). This helps the CNN model converge faster during training.

Data Augmentation (Optional): This technique can be used to artificially


increase the size and diversity of your dataset. It involves creating new images
from existing ones through techniques like random cropping, rotation, flipping,
or adding noise. Data augmentation can help improve the model'sgeneralizability
by exposing it to a wider range of variations.

18
Data Splitting:

Once the data is pre-processed, split it into three sets: training, validation, and
testing sets. The training set (largest portion) is used to train the model. The
validation set (smaller portion) is used to monitor the model's performance during
training and prevent overfitting. The testing set (another smaller portion) is used
for final evaluation of the model's generalizability on unseen data. Common splits
are 80% for training, 10% for validation, and 10% for testing.

Mango Leaf Image Dataset Acquisition

This subsection delves deeper into the specific details of collecting mango leaf
images directly from orchards or fields, as outlined in section 3.1. Here's a
breakdown of the key aspects you can cover:

Image Acquisition Equipment:

Describe the type of camera or imaging device you will use to capture the mango
leaf images. Consider factors like:

Resolution: High-resolution cameras (e.g., DSLR cameras with macro lenses)


are ideal for capturing detailed features of the leaves. However, lower resolution
options (e.g., smartphone cameras) might be acceptable if computational
resources for training the CNN models are limited.

Portability: If collecting images across multiple locations, consider the


portability of the camera equipment.

Image Capture Process:

Explain the process for capturing consistent and high-quality images of mango
leaves. Here are some details to consider:

Lighting Conditions: Aim for consistent lighting conditions, preferably natural


daylight with minimal shadows. Avoid harsh sunlight that can create glare or
washed-out colors.

Background: Use a uniform background (e.g., white sheet, colored cloth) to


isolate the leaf image and improve segmentation during preprocessing.

Image Capture Technique: Develop a consistent technique for capturing


images. This might involve maintaining a specific distance from the leaf, ensuring
the entire leaf is in frame, and capturing multiple images of each leaf with varying
severities of the targeted diseases.

19
Data Collection Strategy:

Outline your strategy for collecting a diverse and representative dataset of mango
leaf images. Here are some considerations:

Disease Representation: Ensure the dataset includes a sufficient number of


images for each disease class you plan to train the CNN model on. This might
involve collecting leaves with varying stages of disease progression.

Healthy Leaf Collection: Include a significant portion of healthy leaves in the


dataset to provide a baseline for comparison with diseased leaves.

Variety of Mango Trees: If possible, collect images from different mango tree
varieties to account for potential variations in leaf morphology that might affect
image recognition.
20
Geographic Locations (Optional): Consider collecting images from multiple
geographic locations if the prevalence of certain diseases varies regionally.

Data Labeling and Annotation:

Explain the process for labeling and annotating the collected images. This
involves assigning a specific class label (e.g., healthy, disease A, disease B) to
each image based on the presence or absence of disease and its type. Here are
some options:

Expert Annotation: Collaborate with agricultural experts or plant pathologists


to ensure accurate labeling of the disease classes in the images.

Manual Labeling: If expertise is limited, you might manually label the images
yourself, but ensure proper training to identify the targeted diseases accurately.

Crowdsourcing Platforms (Optional): Consider using crowdsourcing


platforms where tasks are distributed to a large group of people for labeling.
However, implementing quality control measures is crucial in this approach.

Data Preprocessing: Techniques and Considerations

Following data collection (Section 3.1), this subsection focuses on the various
data preprocessing techniques you'll employ to prepare your mango leaf image
dataset for training the CNN models. Here's a breakdown of the key elements you
can include:

Essential Preprocessing Steps:

Describe the essential preprocessing techniques you will apply to all images in
the dataset, regardless of their source (field collection or publicly available
datasets). These techniques ensure consistency and improve the training process
for the CNN models.

Resizing: Resize all images to a standard dimension (e.g., 224x224 pixels). This
ensures the CNN model receives inputs of uniform size, simplifying
computations.

Normalization: Normalize the pixel values in the images to a specific range (e.g.,
0-1 or -1 to 1). Normalization helps the CNN model converge faster during
training by scaling the data to a common range.

21
Additional Preprocessing Techniques (Optional):

Discuss any additional preprocessing techniques you might consider depending


on the characteristics of your dataset and the chosen CNN model architecture.
Here are some examples:

Color Space Conversion: If the model performs better with specific color
information (e.g., grayscale for texture analysis), you might convert the images
from RGB to grayscale.

Data Augmentation: This technique can be particularly beneficial for smaller


datasets. It involves artificially increasing the size and diversity of your dataset
by creating new images from existing ones. Techniques like random cropping,
rotation, flipping, or adding noise can be used for augmentation. Data
augmentation helps improve the model'sgeneralizability by exposing it to a wider
range of variations in the image data.

Image Segmentation (Optional):

Briefly discuss image segmentation as a potential preprocessing step, especially


if the images contain background clutter or overlapping leaves. Segmentation
techniques can isolate the regions of interest (leaves) from the background before
feeding them into the CNN model. However, explore the trade-offs involved in
adding this step, as accurate segmentation algorithms can be complex and
computationally expensive.

Quality Control Measures:

Explain how you will ensure the quality of your preprocessed data. Here are some
considerations:

Manual Inspection: Visually inspect a subset of preprocessed images to identify


any anomalies or inconsistencies.

Data Validation Tools: Utilize data validation tools to check for missing values,
corrupted images, or incorrect labels after preprocessing.

Model Selection and Customization

In this section, we'll discuss the process of selecting and customizing pre-trained
Convolutional Neural Network (CNN) models for classifying diseased mango
leaves in our image dataset.

22
Rationale for Choosing EfficientNet, VGG16, and ResNet

We've chosen to explore three well-established pre-trained CNN architectures for


this project:

EfficientNet: EfficientNet is a family of CNN models known for achieving high


accuracy while maintaining computational efficiency. This is particularly
advantageous for resource-constrained environments where deploying large
models might not be feasible.

VGG16: VGG16 is a classic CNN architecture that has proven successful in


various image classification tasks. Its relatively simple design with stacked
convolutional layers makes it a good baseline for comparison with other models.

ResNet: ResNet architectures address the vanishing gradient problem that can
hinder training in deep neural networks. By introducing skip connections that
allow gradients to flow directly through the network, ResNets can effectively
train deeper models and potentially achieve better performance on complex
image classification tasks like disease detection.

By evaluating these three diverse architectures, we can gain insights into the
trade-offs between model complexity, accuracy, and computational efficiency for
our specific mango leaf disease classification problem.

23
Comparison of EfficientNet, VGG16, and ResNet for
Mango Leaf Disease Classification

24
EfficientNetB7 architecture

Layer (type): This column lists the type of each layer in the network, such as
"Conv2D" (convolutional layer), "MaxPooling2D" (pooling layer), "Flatten"
(flattens the data), "Dense" (fully-connected layer).

Output Shape : This column shows the output shape of each layer, typically
represented as a tuple (height, width, channels).

Param # : This column indicates the number of trainable parameters in each


layer. The total number of parameters is often displayed at the bottom of the
summary.

VGG16 architecture

Layer (type): This column lists the layer type in the network (e.g., Conv2D,
MaxPooling2D, Flatten, Dense).

Output Shape : This column shows the output shape of each layer, typically
represented as a tuple with dimensions (height, width, channels).

Param # : This column indicates the number of trainable parameters (weights


and biases) in each layer.

25
Total Params : This value, usually shown at the bottom, represents the total
number of trainable parameters in the entire VGG16 model.

ResNet50 architecture

Layer (type): This column specifies the layer type (e.g., Conv2D,
MaxPooling2D, Flatten, Dense).

Output Shape: This column shows the output shape of each layer, typically
represented as a tuple indicating the number of filters (channels), height, and
width of the feature maps.

Param #: This column indicates the number of trainable parameters in each layer.

Total Params: This value, usually displayed at the bottom, represents the total
number of trainable parameters in the entire ResNet50 model.

26
Customization of Pre-trained Models with New Top Layers

While we leverage the pre-trained weights of these CNN architectures, we will


customize them for our specific task. Pre-trained models are typically trained on
large datasets with thousands of object categories. We'll replace the final
classification layers of these models with new layers designed for classifying
healthy and diseased mango leaves in our dataset.

These new top layers will typically consist of a few fully-connected layers with
appropriate activation functions like ReLU or softmax. The final layer will have
the number of neurons corresponding to the number of disease classes we aim to
identify (e.g., two neurons for healthy and diseased).

This approach allows us to benefit from the powerful feature extraction


capabilities learned by the pre-trained models on generic image datasets, while
fine-tuning them for the specific task of mango leaf disease classification.

Here's a table summarizing the key steps involved in customizing the pre-trained
models:

27
Comparison of Model Architectures
Here, you can optionally include a table comparing the key architectural features
of EfficientNet, VGG16, and ResNet. This table might include details like:

Training Process

This section will delve into the specifics of how you trained your CNN models
for mango leaf disease classification. Here's a breakdown of what you can
include:

Training Configuration

Explain the hyperparameters you tuned during training, such as:

Learning Rate: The rate at which the model updates its weights based on
errors.

Optimizer: The algorithm used to update the weights (e.g., Adam, SGD).

Batch Size: The number of images processed by the model before weight
updates.

28
Epochs: The number of times the entire dataset is passed through the model
during training.

Briefly mention any techniques used to improve training efficiency, like


learning rate scheduling or early stopping.

Validation Strategy to Prevent Overfitting

the validation strategy to prevent overfitting. This could involve techniques like:

Splitting the dataset: Dividing the data into training, validation, and (ideally)
test sets. The model is trained on the training set, evaluated on the validation set,
and final performance is assessed on the unseen test set.

Regularization: Techniques like L1/L2 regularization or dropout can be used to


penalize complex models and discourage overfitting.

By outlining these details, you provide transparency into the training process and
allow readers to understand how you optimized model performance.

Evaluation Metrics

To assess the performance of our CNN models in classifying diseased mango


leaves, we'll employ a set of evaluation metrics that measure their effectiveness
in distinguishing healthy from diseased leaves. Choosing appropriate metrics
allows for a comprehensive understanding of the models' strengths and
weaknesses.

Here, we'll focus on four commonly used classification metrics:

Accuracy: Accuracy is the most basic metric, representing the overall percentage
of correctly classified images. It's calculated by dividing the number of images
classified correctly (True Positives and True Negatives) by the total number of
images in the dataset.

Precision: Precision focuses on the positive predictive value. It tells us the


proportion of images classified as positive (diseased) that actually are diseased
(True Positives). A high precision indicates the model rarely classifies healthy
leaves as diseased.

Recall: Also known as Sensitivity, Recall tells us the proportion of actual


diseased leaves (positives) that were correctly identified by the model (True
Positives). A high Recall indicates the model effectively identifies most diseased
leaves.

29
Choosing the Right Metric:

The most suitable metric depends on the specific problem and its priorities. In our
case, where accurately identifying diseased leaves is crucial, high Recall might
be more important than high Accuracy. A model with high Recall would
minimize the number of missed diseased leaves (False Negatives).

We'll report the Accuracy, Precision, Recall, and F1-score for each model in the
Results and Discussion section (Section 4). Analyzing these metrics will allow us
to compare the performance of EfficientNet, VGG16, and ResNet in classifying
diseased mango leaves.

30
Model Training –
EfficientNetB7

31
Model Training –
VGG16

32
Model Training -
ResNet50

33
Classification Performance of Each Model
In this section, we'll present the classification performance achieved by each of
the pre-trained CNN models (EfficientNet, VGG16, and ResNet) on the mango
leaf disease classification task. Here, we'll showcase the results using a
combination of tables and graphs to effectively communicate the model
performance.

Tables:

We can create separate tables for each evaluation metric (Accuracy, Precision,
Recall, F1-score). Each table should include columns for:

Model Name: (EfficientNet, VGG16, ResNet)

Metric Value: (e.g., Accuracy percentage, Precision percentage)

For example, the Accuracy table might look like this:

Model Name Accuracy


EfficientNet 100%
VGG16 98.7%
ResNet 98.2%

This table provides a quick comparison of the overall classification accuracy


achieved by each model. Similarly, you can create tables for Precision, Recall,
and F1-score.

Choosing the Right Visualization:

The most suitable visualization approach depends on the specific information you
want to emphasize. If you want to focus on the overall performance comparison
across all metrics, a bar chart might be a good choice. Line charts can be useful
for detailed analysis of how each model's performance evolves during training (if
you trained from scratch or fine-tuned the pre-trained models).By presenting the
results in both tables and graphs, you can provide a clear and comprehensive
understanding of how each CNN model performed in classifying diseased mango
leaves.

34
Analysis of EfficientNet's Superior Performance
In the previous section (4.1), we presented the classification performance of
EfficientNet, VGG16, and ResNet on the mango leaf disease classification task.
We observed that EfficientNet achieved the highest accuracy and potentially
outperformed the other models on other metrics like Precision, Recall, or F1-
score (depending on the reported results).

In this section, we'll delve deeper and analyze the potential reasons behind
EfficientNet's superior performance. Here are some key factors to consider:

1. EfficientNet Architecture:

EfficientNet is specifically designed to achieve high accuracy while maintaining


computational efficiency. It utilizes a compound scaling approach that balances
the expansion of depth, width, and image resolution during model growth. This
approach might have led to a more expressive model capable of capturing
complex features in the mango leaf images compared to VGG16 and ResNet
architectures.

EfficientNet also incorporates squeeze-and-excitation techniques that selectively


emphasize informative features within the network. This can potentially improve
the model's ability to focus on relevant patterns in the diseased leaf images,
leading to better classification accuracy.

2. Training Configuration:

The hyperparameter settings used during training, such as learning rate and
optimizer choice, could have played a role. EfficientNet training might have
benefited from a more optimal hyperparameter configuration that facilitated
better convergence and learning of disease-discriminative features from the
mango leaf dataset.

Dataset Characteristics:

The specific characteristics of the mango leaf image dataset, such as the number
of images, disease classes present, and image quality, could have influenced the
results. EfficientNet might be inherently more suited for the dataset's properties
compared to VGG16 and ResNet.

35
Further Investigation:

To gain a more conclusive understanding of the reasons behind EfficientNet's


performance, we can consider:

Visualizing the learned filters or feature maps at different layers of each model.
This can provide insights into what kind of features each model is capturing from
the images.

Performing ablation studies, where we disable specific components of


EfficientNet (e.g., squeeze-and-excitation) and observe the impact on
performance. This can help isolate the contribution of these elements to the
model's effectiveness.

Potential Reasons Related to Model Architectures or Training

Building upon the analysis of EfficientNet's superior performance in section 4.2,


let's delve deeper into potential reasons related to the model architectures or
training configurations that might explain its success.

1. Architectural Advantages of EfficientNet:

Compound Scaling: Compared to VGG16's simple stacking of convolutional


layers and ResNet's focus on residual connections, EfficientNet's compound
scaling approach offers a more balanced and potentially more effective strategy
for feature extraction. By scaling depth, width, and image resolution
proportionally, EfficientNet might capture a wider range of features from the
mango leaf images, leading to better disease classification.

Squeeze-and-Excitation (SE) Blocks: These blocks within EfficientNet act as


an attention mechanism, dynamically emphasizing informative features within
the network. This selective focus on relevant patterns in the diseased leaves could
be crucial for accurate classification, particularly if subtle visual cues differentiate
healthy from diseased leaves.

2. Training Optimization:

Hyperparameter Tuning: The choice of learning rate, optimizer, and other


training hyperparameters can significantly impact model performance.
EfficientNet training might have benefited from a more optimal hyperparameter

36
configuration compared to VGG16 and ResNet. This could have led to faster
convergence, better feature learning, and ultimately, higher classification
accuracy for mango leaf diseases.

3. Potential Impact of Dataset Characteristics:

While the specific characteristics of the mango leaf dataset are unknown, here are
some considerations:

Image Complexity: If the images contain complex disease patterns or subtle


variations, EfficientNet's architecture, with its emphasis on balanced scaling and
feature attention, might be better suited to learn these intricate features compared
to VGG16 or ResNet.

Dataset Size: With a limited dataset, EfficientNet's potentially more efficient


architecture might have learned disease-discriminative features more effectively
compared to the larger and potentially more complex arc hitectures of VGG16 and
ResNet

37
6. Loading an Image and Preparing it for Prediction
using a Saved TensorFlow Model

Purpose:
This code snippet aims to load an image from a specified path and prepare it for
prediction using a pre-trained TensorFlow model.
Code Explanation:
import tensorflow as tf, import numpy as np, from tensorflow import keras,
from tensorflow.keras.preprocessing import image, from
tensorflow.keras.applications.imagenet_utils import decode_predictions:
Imports necessary TensorFlow and NumPy modules for image processing and
model loading.
image_path = '/content/drive/MyDrive/gal.png': Specifies the path to the image
file.
img = tf.keras.preprocessing.image.load_img(image_path, target_size=(224,
224)): Loads the image from the specified path, resizing it to the target size of
224x224 pixels.
input_arr = tf.keras.preprocessing.image.img_to_array(img): Converts the
image to a NumPy array.
input_arr = np.array([input_arr]): Reshapes the array to match the input shape
expected by the model.
Usage:
This code snippet is useful for preparing images to be fed into a pre-trained
TensorFlow model for prediction, such as image classification or object
detection models.
Dependencies:
This code relies on the following dependencies:
TensorFlow (tensorflow) for deep learning functionality.
NumPy (numpy) for numerical computations.
keras.preprocessing.image for image preprocessing utilities.
keras.applications.imagenet_utils for decoding model predictions.
38
7. Displaying Disease Prediction from Image

Purpose:
This code segment is intended to visualize the prediction of a disease based on
an input image using a machine learning model.

Code Explanation:

model_prediction = class_names[result_index]: Retrieves the name of the


predicted disease class based on the model's output index.
plt.imshow(img): Displays the input image.
plt.title(f"Disease Name: {model_prediction}"): Sets the title of the plot to
include the predicted disease name.
plt.xticks([]) and plt.yticks([]): Removes the tick marks on the x and y axes.
plt.show(): Displays the plot with the image and predicted disease name.
Usage:
This code segment can be used in applications where disease prediction from
images is required, such as medical diagnosis systems or plant disease detection
applications.

Dependencies:
This code relies on the following dependencies:
matplotlib.pyplot for plotting images.
img - Input image data.
class_names - List or dictionary mapping class indices to disease names.
result_index - Index of the predicted class returned by the machine learning
model.

39
40
8. Summary of Key Findings

This research project investigated the effectiveness of Convolutional Neural


Networks (CNNs) for classifying diseased mango leaves. We explored three pre-
trained CNN architectures: EfficientNet, VGG16, and ResNet. These models
were fine-tuned on a mango leaf image dataset to distinguish between healthy and
diseased leaves.

Our key findings are as follows:

EfficientNet's Superior Performance: Among the evaluated models,


EfficientNet achieved the highest accuracy in classifying diseased mango leaves.
It also potentially outperformed other models in metrics like Precision, Recall,
and F1-score, depending on the specific emphasis of the task (overall accuracy
vs. prioritizing true positive disease identification).

Potential Factors Contributing to EfficiencyNet's Success: Several factors


might explain EfficientNet's superior performance. Its compound scaling
approach, which balances depth, width, and resolution increase, might be more
effective for capturing a wider range of disease-related features compared to
VGG16 and ResNet. Additionally, EfficientNet's Squeeze-and-Excitation (SE)
blocks could play a crucial role by emphasizing informative features within the
network, leading to better disease classification, particularly if subtle visual cues
differentiate healthy and diseased leaves.

Training Optimization and Dataset Characteristics: While the exact impact is


uncertain without further exploration, the training configuration and dataset
characteristics might also have influenced the results. EfficientNet training might
have benefited from a more optimal hyperparameter setup, leading to faster
convergence and better feature learning. Additionally, the dataset's properties,
such as image complexity or size, could have favored EfficientNet's architecture
for learning disease-specific features.

Effectiveness of EfficientNet for Mango Leaf Disease Classification

Based on the findings of this research project, EfficientNet emerged as an


effective Convolutional Neural Network (CNN) architecture for classifying
diseased mango leaves. Its superior performance can be attributed to several
factors:

41
EfficientNet's architecture with compound scaling:

Unlike VGG16's simple layer stacking or ResNet's focus on residual connections,


EfficientNet's approach scales depth, width, and image resolution proportionally.
This balanced scaling potentially allows EfficientNet to capture a wider range of
features from the mango leaf images compared to the other models. These
features might encompass subtle variations in color, texture, or leaf shape that are
crucial for disease classification.

Squeeze-and-Excitation (SE) blocks within EfficientNet: These blocks act as


an attention mechanism, dynamically emphasizing informative disease-specific
features within the network. By focusing on these relevant patterns, EfficientNet
might achieve more accurate classification, especially when dealing with subtle
visual cues that differentiate healthy from diseased leaves.

EfficientNet's training might have benefited from a more optimal


hyperparameter configuration: While the specific hyperparameters used are
unknown, it's possible that EfficientNet's training regime employed a learning
rate, optimizer, or other settings that led to faster convergence and better feature
learning specific to mango leaf disease patterns. This could contribute to its
superior performance in our task.

42
9. Recommendations for Future Work

Building upon the findings of this research, here are some recommendations for
future work to enhance the mango leaf disease classification system:

Explore a wider range of CNN architectures: Beyond EfficientNet, VGG16,


and ResNet, investigate architectures specifically designed for disease detection
tasks in plant images. Architectures like Inception or DenseNet might be explored
to see if they achieve comparable or even better performance on the mango leaf
disease classification task.

Experiment with data augmentation techniques: Artificially expand the


dataset using data augmentation techniques like random rotations, flips, cropping,
and scaling. This can improve the model's generalizability and potentially
enhance its ability to classify diseases in unseen mango leaf images.

Consider transfer learning or fine-tuning on a larger pre-trained model: If


computational resources allow, explore incorporating techniques like transfer
learning or fine-tuning on a larger pre-trained model like ImageNet. This can
leverage the extensive feature learning capabilities of these models on a broader
image dataset, potentially improving performance on the specific task of mango
leaf disease classification.

Explore the use of class activation maps (CAMs): Utilize class activation maps
(CAMs) to visualize the regions of interest in the mango leaf images that the
models focus on for disease classification. This can provide valuable insights into
how the models are making decisions and identify which image features are most
critical for accurate disease detection.

Integrate the developed model into a mobile application or web interface:


Develop a user-friendly interface for real-time disease detection in mango
orchards. This could be a mobile application or web interface that allows farmers
to capture images of their leaves and receive instant disease classification results.
This empowers farmers with early detection capabilities to take timely action and
minimize crop losses.

43
10. REFERENCE
1. https://www.kaggle.com/datasets/warcoder/mango-leaf-disease-dataset
2. Issues · animesh1012/machineLearning · GitHub

44

You might also like