You are on page 1of 133

Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural

Networks

CLASSIFICATION OF INDIAN MEDICINAL


LEAVES USING TRANSFER LEARNING
BASED CONVOLUTIONAL NEURAL
NETWORKS
A Project work submitted to
Acharya Nagarjuna University
Department of Computer Science and Engineering

In partial fulfillment of the requirements for


The award of the degree of

Master of Computer Applications


by

ULLAMPARTHI DILEEP KUMAR


Regd. No. Y23MC20060

Under the guidance of

Dr. G. NEELIMA
Assistant Professor
Department of computer science & engineering
Acharya Nagarjuna University

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING


ACHARYA NAGARJUNA UNIVERSITY
Nagarjuna Nagar, Guntur,
Andhra Pradesh, India

March 2024
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

DECLARATION

I hereby declare that the entire thesis work entitled "

CLASSIFICATION OF INDIAN MEDICINAL LEAVES USING

TRANSFER LEARNING BASED CONVOLUTIONAL NEURAL

NETWORKS" is being submitted to the Department of Computer

Science and Engineering, University College of Sciences, Acharya

Nagarjuna University, in partial fulfillment of the requirement for the

award of the degree of Master of Computer Applications (MCA) is a

bon-fide work of my own, carried out under the supervision of Dr. G.

NEELIMA, Assistant Professor, Department of Computer Science &

Engineering, Acharya Nagarjuna University.

I further declare that the Project, either in part or full, has not been submitted

earlier by me or others for the award of any degree in any University.

ULLAMPARTHI DILEEP KUMAR

Reg. No. Y23MC20060

i
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

ACHARYA NAGARJUNA UNIVERSITY


NAGARJUNA NAGAR, GUNTUR
Department of Computer Science & Engineering.

CERTIFICATE

This is to certify that this project entitled “CLASSIFICATION OF

INDIAN MEDICINAL LEAVES USING TRANSFER LEARNING

BASED CONVOLUTIONAL NEURAL NETWORKS” is a Bon-fide

record of the project work done and submitted by

ULLAMPARTHI DILEEP KUMAR (Y23MC20060) during the year

2022 - 2024 in partial fulfillment of the requirements for the award of

degree of Master of Computer Applications (MCA) in the department

of Computer Science & Engineering. I certify that he carries this

project as an independent project under my guidance.

Head of the Department Project Guide


(Prof. K. Gangadhara Rao) (Dr. G .Neelima)

ii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

External Examiner

iii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

ACKNOWLEDGEMENTS

Undertaking this Project has been a truly life-changing experience for me and it

would not have been possible to do without the support and guidance that I received

from many people.

I would like to first say a very big thank you to my supervisor Dr. G. NEELIMA for

all the support and encouragement he gave me. Her friendly guidance and expert

advice have been invaluable throughout all stages of the work. Without her guidance

and constant feedback this Project work not have been achievable.

I would also wish to express my gratitude to Prof. K. Gangadhara Rao for extended

discussions and valuable suggestions which have contributed greatly to the

improvement of the thesis.

I am thankful to and fortunate enough to get constant encouragement, support and

guidance from all Teaching staffs of Department which helped us in successfully

completing our project work. Also, I would like to extend our sincere regards to all

the non-teaching staff of the department for their timely support.

I must also thank my parents and friends for the immense support and help during this

project. Without their help, completing this project would have been very difficult.

iv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

ABSTRACT

There’s a rapid increment in the utilization of herbal-based items over the world.

Medicinal herbs play a major part in creating ayurvedic drugs and homegrown items.

Herbal medications are regarded as a substitute for synthetic drugs in both developing

and developed countries, owing to their lack of adverse effects. Many medicinal

species are extant in India. Identifying those medicinal plants/leaves over a bunch of

different kinds of plant species is necessary as they are many health benefits with

medicinal plants. Classification of medicinal leaves can be automated based on their

respective textures, shape, and edge or margin of a leaf. In this paper, Indian

medicinal leaves classifying utilizing transfer learning based convolutional neural

networks has been proposed. In order to make the classification more accurate, the

data augmentation technique had been utilized to enlarge the data which avoids

insufficiency of data. The regularization technique was utilized to avoid the menace

of overfitting. The dataset consists of 1835 images and thirty different types of

beneficial Indian medicinal herbs such as Tulsi, Jasmine, etc. Data has been trained

using different architectures such as VGG16, Xception, and efficieNetv2. The

preliminary results of the Indian medicinal herbs dataset showed that the Xception

architecture performed better than EfficientNetv2 and VGG16.

v
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

TABLE OF CONTENTS

TITLE PAGE NO

DECLARATION i

CERTIFICATE iii

ACKNOWLEDGEMENT iv

ABSTRACT v

TABLE OF CONTENTS vii

LIST OF FIGURES xi

Chapter 1: INTRODUCTION

1.1 Overview 2

1.2 Problem Statement 5

1.3 Objectives of the Project 6

Chapter 2: LITERATURE SURVEY

2 Literature Survey 9

Chapter 3: SYSTEM ANALYSIS

3.1 Problem statement 14

3.2 Existing System 14

3.3 Proposed System 16

3.4 Modules 17
vi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Chapter 4: SYSTEM REQUIREMENTS

4.1 Functional Requirements 20

4.2 Non-Functional Requirements 23

4.3 Performance Requirements 24

4.4 Feasibility Study 25

Chapter 5: METHODOLOGY

5.1 Dataset 29

5.2 Data Preparation 30

5.3 Model Development 32

5.3.1 VGG16 34

5.3.2 Xception 37

5.3.3 EfiecientNetV2 40

5.4 Performance Comparison Charts 44

5.5 Training and Evalution 45

5.5.1 Model Training 46

5.5.2 Model Evalution 46

5.5.3 Computational Efficiency and Scalability 47

5.6 Algorithms 47

vii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Chapter 6: SYSTEM DESIGN

6.1 System Architecture 57

6.2 UML diagrams 59

6.2.1 Use case diagram 59

6.2.2 Sequence diagram 62

6.2.3 Activity Diagram 65

6.2.4 Class Diagram 67

Chapter 7: IMPLEMENTATION AND EVALUATION

7.1 Dataset 72

7.2 Import Modules 74

7.3 Plot Model Architecture 75

7.4 Feature Extraction Model 77

Chapter 8: SOURCE CODE

Source Code 83

Chapter 9: SYSTEM TESTING

9.1 Software Testing 87

9.2 Test Cases 90

Chapter 10: CONCLUSION AND FUTURE SCOPE

10.1 Conclusion 95

10.2 Future Scope 96

References 99
viii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

ix
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

LIST OF FIGURES

Figure No. Title of the Figure Page No.

5.1 Dataset sample 27

5.3.1 Architecture of VGG16 32

5.3.2 Architecture of Xception 37

5.3.3 Architecture of EfficientNetV2 38

5.4 Performance Comparison Charts 39

6.1 System Architecture 52

6.2.1 Use case diagram 54

6..2.2 Sequence Diagram 57

6.2.3 Activity Diagram 60

6.2.4 Class Diagram 63

7.1 List of some medicinal plant species 69

7.3 Architecture Model 72

7.4 Feature Extraction Model 75

7.5 First image to predict 76

7.6 Leave prediction with actual and predicted values 77

x
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

CHAPTER 1

INTRODUCTION

xi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

1.1 Overview

Medicinal plants have been an integral part of traditional medicine systems for

centuries, providing remedies for various ailments. With the advancement of

technology, the identification and recognition of medicinal plants have been expedited

through the application of machine learning techniques. Transfer learning, in

particular, has emerged as a powerful tool in this domain, allowing the leveraging of

pre-trained models to address recognition tasks with limited labeled data. In this

introductory discourse, we delve into the application of transfer learning for the

recognition of medicinal plant leaves, employing state-of-the-art convolutional neural

network (CNN) architectures including VGG16, Xception, and EfficientNetV2.

Leaves have characteristics such as shape and texture to be identified with the help of image

processing technology and deep learning. An object sees identification as geometric

information with boundaries [1]–[10]. The identified leaf object is limited to the boundary

identified as leaf size and leaf shape, while the leaf texture or pattern is seen from the leaf

surface [11]. Generally, the size of the leaves can be different, but the surface pattern of the

leaves does not differ from one another [12]–[15]. This study aims to identify medicinal or

phytomedicine plant species by processing leaf imagery using image processing and deep

learning [15]–[21].

Research on the identification of phytomedicine plant leaves has been carried out by several

previous studies, for example Naresh and Nagendraswamy in 2015 [22], Mukherjee and his

team in 2016 [23], Venkataraman & Mangayarkarasi in 2017 [24], Gao & Lin in 2018 [25],

Sivaranjani et al. in 2019 [26], Pechebovicz et al. in 2020 [27], Bhuiyan et al. in 2021 [28].

xii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

In a study by Naresh and Nagendraswamy in 2015, the authors employed local binary patterns

(LBP) to classify medicinal leaf plants. In a study conducted in 2016 by Mukherjee and his

team, the classification of medicinal plants was accomplished with the use of Back

Propagation MultiLayer Perceptron (BP-MLP) [22], [29].

A study on the classification of medicinal plants also was carried out by Venkataraman and

Mangayarkarasi (2017). They utilized the Histogram of Oriented Gradient (HoG)- Support

Vector Machine for their research (SVM) [24]. Moreover, Gao and Lin (2018) used the

OTSU approach in their classification of leaf plants for medicinal purposes. The OTSU

approach involves using each manually marked edge point of the leaf to precisely detect the

following outside points of the leaf located next to it [25]. The ExG-ExR index and the

Logistic Regression (LR) classifier were utilized by Sivaranjani et al. to classify medicinal

plants, and the researchers discovered that this method was successful. Based on each

extracted leaf's color and texture characteristics, the Logistic Regression (LR) classifier is

utilized to classify the various plant species [26].

In this study, we propose transfer learning models VGG16, VGG19, and MobileNetV2 to

study the distinguishing features to identify medicinal plant leaves according to the dataset

that has been collected. We also improved algorithm using finetuning strategy and analysed a

comparison with and without a fine-tuning strategy to transfer learning model’s performance.

 Recognition of Medicinal Plant Leaves

Recognition of medicinal plant leaves is a fundamental task in botany, pharmacology,

and biotechnology. Accurate identification of plant species is crucial for various

purposes such as biodiversity conservation, drug discovery, and herbal medicine


xiii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

formulation. However, manual identification of plant species based on leaf

characteristics is labor-intensive and often prone to errors. Hence, the development of

automated recognition systems using machine learning has gained significant traction.

 Transfer Learning

Transfer learning involves leveraging knowledge acquired from solving one

problem and applying it to a different but related problem. In the context of

medicinal plant leaf recognition, transfer learning allows us to utilize pre-

trained CNN models, which have been trained on large-scale datasets such as

ImageNet, and fine-tune them on a smaller dataset containing images of

medicinal plant leaves. This approach is particularly beneficial when the

labeled dataset for the target task is limited, as it enables the model to learn

meaningful representations from the source domain and adapt them to the

target domain.

 CNN Architectures: VGG16, Xception, and EfficientNetV2

VGG16, Xception, and EfficientNetV2 represent three distinct CNN

architectures that have demonstrated superior performance across various

image recognition tasks. VGG16 is characterized by its simplicity and consists

of 16 layers, including convolutional and fully connected layers. Xception, on

the other hand, introduces depth wise separable convolutions, which

significantly reduce the number of parameters while maintaining high

accuracy. EfficientNetV2, a recent advancement in CNN architectures,

focuses on improving model efficiency by optimizing the network's depth,

xiv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

width, and resolution using compound scaling.

 Application in Medicinal Plant Leaf Recognition

The application of transfer learning using VGG16, Xception, and EfficientNetV2

in medicinal plant leaf recognition involves several stages. First, the pre-trained

models are initialized with weights learned from the ImageNet dataset. Next, the

fully connected layers of the CNN architectures are modified to accommodate the

number of classes specific to medicinal plant species. Finally, the modified

models are fine-tuned on a dataset comprising images of medicinal plant leaves,

adjusting the model parameters to better capture the distinguishing features of

different plant species.

Transfer learning coupled with state-of-the-art CNN architectures such as VGG16,

Xception, and EfficientNetV2 presents a promising approach for the recognition

of medicinal plant leaves. By leveraging pre-trained models and fine-tuning them

on limited labeled data, these techniques enable the development of accurate and

efficient recognition systems essential for various applications in botany,

pharmacology, and herbal medicine. In the subsequent sections, we delve deeper

into the methodology, experiments, and results obtained through the application of

these techniques in medicinal plant leaf recognition tasks.

1.2 Problem Statement

Medicinal plants have been extensively used in traditional medicine for centuries due

to their therapeutic properties. Identifying these plants accurately is crucial for various
xv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

applications including pharmaceuticals, healthcare, and conservation. However,

manual identification can be time-consuming and prone to errors. Automated

recognition systems based on deep learning models offer a promising and reliable

solution, but often require large labeled datasets for training, which can be

challenging to acquire in the case of medicinal plants.

Transfer learning has emerged as a powerful technique in deep learning, where pre-

trained models trained on large-scale datasets are fine-tuned on smaller, domain-

specific datasets to adapt to specific recognition tasks. In this context, the utilization

of pre-trained convolutional neural network (CNN) architectures such as VGG16,

Xception, and EfficientNetV2 has shown promising results in various image

recognition tasks.

1.3 Objectives of the Project

 Dataset Acquisition and Preprocessing: Gather a dataset comprising images

of medicinal plant leaves from diverse sources. Preprocess the images to

ensure uniformity in size, color, and orientation, and partition the dataset into

training, validation, and testing sets.

 Model Implementation and Transfer Learning: Implement transfer learning

by initializing the VGG16, Xception, and EfficientNetV2 models with weights

pre-trained on large-scale image datasets such as ImageNet. Fine-tune these


xvi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

models on the medicinal plant leaves dataset to adapt them to the recognition

task.

 Model Evaluation: Evaluate the performance of the transfer learning models

using metrics such as accuracy, precision, recall, and F1-score on the

validation and test sets. Compare the performance of VGG16, Xception, and

EfficientNetV2 architectures to identify the most effective model for

medicinal plant leaf recognition.

 Model Optimization: Explore techniques for model optimization such as data

augmentation, learning rate scheduling, and model ensemble to further

improve the recognition accuracy and generalization capability of the models.

 Deployment and Application: Develop a user-friendly interface for the

trained model to enable users to upload images of medicinal plant leaves for

recognition. Test the deployed model on real-world data and assess its

performance in practical applications.

xvii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

CHAPTER 2
LITERATURE SURVEY

xviii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

2 LITERATURE SURVEY
Das, A., & Mandal, D. (2020). Medicinal Plant Leaf Identification Using

Transfer Learning. In 2020 6th International Conference on Advanced

Computing and Communication Systems (ICACCS) (pp. 1095-1099). IEEE.

This research aimed to improve the automatic identification of medicinal plants due to

their growing popularity and increased requests for artisanal and industrial uses and

applications. Therefore, the proposed DL algorithm and image processing technique

can have a special place in plant science and even industrial markets for identifying

and classifying varied medicinal plants separately from other non-edible plants.

Chaudhary, S., & Pande, M. (2021). Medicinal plant leaf recognition using deep

learning transfer learning techniques. In 2021 International Conference on

Computer Communication and Informatics (ICCCI) (pp. 1-6). IEEE.

Fig. 3. Proposed Model Architecture in


Python
categorical cross-entropy loss
function using the Adam
optimizer. The accuracy is used as
a metric to evaluate
the performance of the model.
xix
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

VII. R ES ULTS A ND A N ALYS IS


The proposed approach utilizes a
convolutional neural net-
work (CNN), specifically a VGG-
16-based model, trained on
a dataset of 25,686 images of 29
plant species. The VGG-16
model is pre-trained on ImageNet,
a wide range of images,
which makes it an excellent
starting point for many image
recognition tasks.
Figure 4 shows that the model’s
accuracy increased after
training for 30 epochs, with a
maximum accuracy of 0.98.
This represents a considerable
improvement from the starting
xx
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

accuracy. Figure 5 shows that the


current loss after a total of
30 epochs is around 0.04,
indicating that the model has the
ability to learn from the data and
enhance its performance over
time.
Experimental results show that the
proposed method out-
performs traditional machine
learning techniques in terms
of classification accuracy, with a
recognition rate of 98%.
This approach can be used as a
useful tool for healthcare
professionals, researchers, and
other professionals in the field
of herbal medicine to aid in the
identification of medicinal
xxi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

plants. It can be extended to other


fields such as agriculture
and botany, where accurate plant
identification can have a
significant impact on sustainable
natural resource use and
conservation efforts.
It is worth mentioning that due to
limitations in CPU pro-
cessing, the model was trained in
two separate runs, each with
15 epochs. This underlines the
importance of having sufficient
computational resources when
training complex models. The
results presented in Figures 4 and
5 demonstrate the model’s
potential for further improvement
through increased epochs or
xxii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

additional resources.
VIII. C ONCLUSIONS AND
F UTURE W ORK
This study has demonstrated the
effectiveness of a deep
learning-based method using a
convolutional neural network
(CNN) to accurately recognize
medicinal plants
Fig. 3. Proposed Model Architecture in
Python
categorical cross-entropy loss
function using the Adam
optimizer. The accuracy is used as
a metric to evaluate
the performance of the model.
VII. R ES ULTS A ND A N ALYS IS
The proposed approach utilizes a
convolutional neural net-
xxiii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

work (CNN), specifically a VGG-


16-based model, trained on
a dataset of 25,686 images of 29
plant species. The VGG-16
model is pre-trained on ImageNet,
a wide range of images,
which makes it an excellent
starting point for many image
recognition tasks.
Figure 4 shows that the model’s
accuracy increased after
training for 30 epochs, with a
maximum accuracy of 0.98.
This represents a considerable
improvement from the starting
accuracy. Figure 5 shows that the
current loss after a total of
30 epochs is around 0.04,
indicating that the model has the
xxiv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

ability to learn from the data and


enhance its performance over
time.
Experimental results show that the
proposed method out-
performs traditional machine
learning techniques in terms
of classification accuracy, with a
recognition rate of 98%.
This approach can be used as a
useful tool for healthcare
professionals, researchers, and
other professionals in the field
of herbal medicine to aid in the
identification of medicinal
plants. It can be extended to other
fields such as agriculture
and botany, where accurate plant
identification can have a
xxv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

significant impact on sustainable


natural resource use and
conservation efforts.
It is worth mentioning that due to
limitations in CPU pro-
cessing, the model was trained in
two separate runs, each with
15 epochs. This underlines the
importance of having sufficient
computational resources when
training complex models. The
results presented in Figures 4 and
5 demonstrate the model’s
potential for further improvement
through increased epochs or
additional resources.
VIII. C ONCLUSIONS AND
F UTURE W ORK
xxvi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

This study has demonstrated the


effectiveness of a deep
learning-based method using a
convolutional neural network
(CNN) to accurately recognize
medicinal plants
The study’s results show that deep
learning
techniques can be used to classify
medicinal plants accurately,
providing a reliable tool for
healthcare professionals and
herbal medicine researchers to
identify herbal plants. Future
work could involve further
integrating the identified plant
with
a large language model to provide
additional information about
xxvii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

the scientific name, more images,


and explanations of the
benefits and side effects of the
plant, and instructions on how
to use it in both English and the
local language. Overall, the
study supports the continued
development and integration of
deep learning in the recognition of
herbal plants, which has the
potential to significantly impact
the field of herbal medici
The study’s results show that deep learning techniques can be used to classify

medicinal plants accurately, providing a reliable tool for healthcare professionals

andherbal medicine researchers to identify herbal plants. Futurework could involve

further integrating the identified plant witha large language model to provide

additional information aboutthe scientific name, more images, and explanations of

thebenefits and side effects of the plant, and instructions on howto use it in both

English and the local language. Overall, thestudy supports the continued development

and integration ofdeep learning in the recognition of herbal plants, which has

thepotential to significantly impact the field of herbal medicinal research

xxviii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

X.-F. Wang, D.-S. Huang, J.-X. Du, H. Xu, and L. Heutte, “Classification of

plant leaf images with complicated background,” Appl. Math. Comput., vol. 205,

no. 2, pp. 916–926, Nov. 2008.

In this paper, the Mask R-CNN model and the VGG16 model are used to segment and

classify leaf images with multiple targets and a complicated background. More than

4000 images were used for model training and testing. The results show that the

average ME of segmentation is up to 1.15% using the Mask R-CNN model, and the

average classification accuracy is up to 91.5% using the VGG16 model. This shows

that the Mask R-CNN model and the VGG16 model could reliably be used in the

segmentation and classification of leaf images with a complicated background.

Further study is recommended to be performed with different deep learning

algorithms and a greater number of data, which may lead to a better result. Besides

the algorithm’s development, improving the image quality with better devices can

also contribute to better performance. What is more, it will be possible to segment and

classify leaves automatically in real-time by using an embedding system.

K. Yang, W. Zhong, and F. Li, “Leaf Segmentation and Classification with a

Complicated Background Using Deep Learning,” Agronomy, vol. 10, no. 11, p.

1721, Nov. 2020

In this paper, the segmentation and classification of leaf images with a complicated

background using deep learning are studied. First, more than 2500 leaf images with a

complicated background are collected and artificially labeled with target pixels and
xxix
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

background pixels. Two-thousand of them are fed into a Mask Region-based

Convolutional Neural Network (Mask R-CNN) to train a model for leaf segmentation.

Then, a training set that contains more than 1500 training images of 15 species is fed

into a very deep convolutional network with 16 layers (VGG16) to train a model for

leaf classification. The best hyperparameters for these methods are found by

comparing a variety of parameter combinations. The results show that the average

Misclassification Error of 80 test images using Mask R-CNN is 1.15%. The average

accuracy value for the leaf classification of 150 test images using VGG16 is up to

91.5%. This indicates that these methods can be used to segment and classify the leaf

image with a complicated background effectively. It could provide a reference for the

phenotype analysis and automatic classification of plants

E. M. Jawad, H. G. Daway, and H. J. Mohamad, “Quantum-dot Cellular

Automata Based Lossless CFA Image Compression Using Improved and

Extended Golomb-rice Entropy Coder,” Int. J. Intell. Eng. Syst., vol. 15, no. 2,

pp. 12–25, Apr. 2022.

This article proposed efficient hardware architecture of lossless colour image

compression mechanism using CFA for wireless camera networks with QCA

technology to mitigate the area, and power as compared to standard CMOS

technology. In addition, IEGREC is proposed to reduce the memory requirement,

computational complexity in terms of gate count and eliminated the requirement of

context module to lessen the hardware resource utilization. The extensive simulation

results disclosed that proposed QCAIEGREC method performed superior as

xxx
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

compared to state-of-art approaches with less area i.e., 3700 gate count, and reduced

power about 1.02 mW. It also outperformed the existing approaches with image

quality metrics such as 18.78dB of PSNR, 152.3 of FOM, and 29.3 of CR. This work

can be extended to implement the joint blur detection and compression operations

using IEGREC coding. The blur detection can prevent the attacks generated in the

compression process.

xxxi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

CHAPTER 3

SYSTEM ANALYSIS

xxxii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

3 SYSTEM ANALYSIS

3.1 Problem Statement

The classification of Indian medicinal leaves represents a substantial undertaking,

demanding the creation of resilient systems adept at precisely discerning plant species

based on intricate leaf attributes. Employing transfer learning-based convolutional

neural networks (CNNs), our objective is to construct a framework proficient in

distinguishing among various types of medicinal leaves. Such a system holds promise

in facilitating the identification and utilization of these plants within traditional

medicine systems, thereby contributing to advancements in healthcare and botanical

research.

The complexity of Indian medicinal leaves, characterized by diverse morphological

features and biochemical compositions, necessitates the utilization of advanced

machine learning techniques. By leveraging transfer learning, our system can

capitalize on the knowledge acquired from pre-trained CNN models, thereby

accelerating the learning process and enhancing classification accuracy. This

approach enables the extraction of intricate patterns and subtle nuances from leaf

images, empowering the system to make informed and reliable classifications

Central to our endeavor is the development of a robust and scalable system

architecture capable of accommodating the intricacies of medicinal plant

classification. Through meticulous model selection, feature extraction, and fine-tuning

strategies, we aim to optimize the system's performance across a wide spectrum of

plant species and leaf variations.


xxxiii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

By integrating cutting-edge technologies with domain expertise in botany and

traditional medicine, we aspire to bridge the gap between modern computational

methods and age-old botanical practices.

Our pursuit of building a sophisticated classification system for Indian medicinal

leaves aligns with the broader goal of harnessing technology to preserve traditional

knowledge and promote sustainable healthcare practices. By enabling accurate species

identification and fostering greater understanding of medicinal plants' therapeutic

properties, our system holds the potential to revolutionize the field of herbal medicine

and contribute to the well-being of communities worldwide.

3.2 Existing Systems

Existing systems in the domain of plant species recognition and leaf classification

provide a rich foundation upon which to build our project. These systems have

explored various methodologies and approaches, offering valuable insights into

effective strategies for our endeavor. Here's an overview of key components and

methods commonly employed in existing systems:

1. Traditional Taxonomy-Based Approaches:

 Traditional taxonomy-based systems rely on manual identification

methods, often involving experts in botany.

 These approaches are time-consuming and may lack scalability for

large-scale leaf classification tasks.

xxxiv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

2. Computer Vision-Based Systems:

 Computer vision techniques have been increasingly utilized for

automated plant species recognition.

 Feature extraction methods, such as shape, texture, and color analysis,

play a crucial role in leaf classification.

 Machine learning algorithms, including CNNs, have shown promise in

automatically identifying plant species based on leaf images.

3. Transfer Learning and CNNs:

 Transfer learning, particularly with pre-trained CNN models, has

emerged as a powerful technique for image classification tasks.

 By leveraging features learned from large datasets, transfer learning

allows for effective classification of new classes with limited data.

3.3 Proposed System

Our proposed system for classifying Indian medicinal leaves integrates transfer

learning-based CNNs, real-time monitoring, and comprehensive data analysis to

accurately identify and categorize medicinal plant species. Key components and

methodologies of the proposed system include:

1. Data Collection and Preprocessing:

Collection of a diverse dataset of Indian medicinal leaves, followed by

preprocessing steps such as resizing and augmentation.

xxxv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

2. Model Training with Transfer Learning:

Utilization of pre-trained CNN models for feature extraction, followed by

fine-tuning on the medicinal leaf dataset.

3. Real-Time Monitoring and Analysis:

Implementation of real-time monitoring mechanisms to analyze leaf images

and classify them into respective medicinal plant species.

4. Integration with Traditional Knowledge:

Integration of traditional botanical knowledge to complement machine

learning-based classification, ensuring accuracy and cultural relevance.

3.4 Modules

In the context of our project, essential modules for the classification of Indian

medicinal leaves using transfer learning-based CNNs may include:

1. Data Collection Module:

Responsible for gathering a comprehensive dataset of Indian medicinal leaves

from diverse sources.

2. Data Preprocessing Module:

Cleans and preprocesses the collected leaf images dataset for training and

testing.

3. Model Training and Fine-Tuning Module:

xxxvi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Trains pre-trained CNN models on the medicinal leaf dataset, fine-tuning the

network parameters for improved classification performance.

4. Real-Time Monitoring and Classification Module:

Implements mechanisms for real-time leaf image analysis and classification

using trained models.

5. Integration with Traditional Knowledge Module:

Integrates traditional botanical knowledge into the classification process,

ensuring cultural relevance and accuracy.

xxxvii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

CHAPTER 4

SYSTEM REQUIREMENTS

xxxviii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

4 SYSTEM REQUIREMENTS

Requirements are essential constraints and specifications that define the functionality,

performance, and behavior of a system. They serve as the foundation for system

design and development, guiding the creation of software or hardware solutions to

meet specific objectives. The following requirements are crucial to consider during

the development process:

1. Functional requirements

2. Non-Functional requirements

3. Technical requirements

 Hardware requirements

 Software requirements

4.1 Functional requirements

The Functional Requirements section of our software specification outlines the core

functionalities essential for our medicinal plant classification system. Specialized

libraries such as scikit-learn, pandas, NumPy, Matplotlib, and Seaborn are integral to

the system's operation. These libraries provide crucial tools for machine learning

model implementation, data manipulation, numerical computing, and data

visualization. Leveraging these dependencies ensures the system's capability to handle

tasks such as model training, data preprocessing, feature extraction, and result

visualization effectively.

xxxix
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

4.2 Non-Functional Requirements

 Process of functional steps:

I. Problem define

II. Preparing data

III. Evaluating algorithms

IV. Improving results

V. Prediction the result

4.3 Technical Requirements

 Software Requirements:

 Operating System: Windows

 Tool: Anaconda with Jupiter Notebook

 Hardware requirements:

 Processor: Pentium IV/III

 Hard disk: minimum 80 GB

 RAM: minimum 2 GB

4.4 Functional Requirements

Functional requirements delineate the specific capabilities and behaviors that the

software system must exhibit. In the context of our project, the functional

requirements encompass various modules responsible for processing, analyzing, and

classifying Indian medicinal leaves.

 4.4.1 Data Collection Module:


xl
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

This module focuses on sourcing a diverse dataset of Indian medicinal leaves

images from reliable sources.

Utilizes APIs, web scraping, and data crawling techniques to collect images

from online repositories and databases.

Platforms such as Twitter, Facebook, and Instagram may be tapped to access

publicly available images.

 4.4.2 Data Preprocessing Module:

Cleans and transforms the collected image data to prepare it for analysis.

Removes noise, handles missing data, and normalizes images for consistency.

Applies text preprocessing techniques like tokenization, stemming, and

lemmatization for associated textual data.

 4.4.3 Feature Extraction and Representation Module:

Utilizes transfer learning with pretrained CNN models like VGG16, Xception,

and EfficientNetV2.

Extracts hierarchical features from the medicinal leaf images to represent them

effectively.

Leverages deep learning techniques to capture intricate patterns and details

inherent in leaf images.

 4.4.4 Classification Module:

Classifies the preprocessed leaf images into different categories or classes

representing specific medicinal plant species.


xli
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Employs machine learning algorithms such as Naive Bayes, Support Vector

Machines (SVM), Convolutional Neural Networks (CNNs), or Recurrent

Neural Networks (RNNs) for classification.

Validates the model's performance using appropriate evaluation metrics such

as accuracy, precision, recall, and F1-score.

 4.4.5 Visualization and Reporting Module:

Generates informative visualizations and reports to present the classification

results. Includes word clouds, sentiment distribution charts, topic distribution

plots, and interactive dashboards. Facilitates the interpretation and

communication of insights derived from the classification process.

 4.4.6 Recommendations and Interventions Module:

Based on the analysis and insights gained, generates actionable

recommendations and interventions to promote the use of medicinal plants.

Targets policymakers, healthcare professionals, and conservationists to

enhance awareness and conservation efforts.

5. Non-Functional Requirements

Non-functional requirements define the quality attributes and constraints of the

software system. They encompass aspects such as accessibility, availability, security,

and performance.

 Accessibility:

xlii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Ensures that the system is accessible to users with disabilities by adhering to

accessibility standards such as WCAG (Web Content Accessibility

Guidelines).

 Availability:

Guarantees high availability of the system, minimizing downtime and ensuring

uninterrupted access to users.

 Security:

Implements robust security measures to protect sensitive data and prevent

unauthorized access, ensuring compliance with privacy regulations.

 Backup and Disaster Recovery:

Establishes regular data backups and implements disaster recovery procedures

to mitigate the risk of data loss or system failure.

 Performance:

Measures the system's performance in terms of speed, responsiveness, and

scalability. Ensures efficient resource utilization and optimal performance

under varying workloads.

 Interoperability:

Ensures seamless integration with existing systems and interoperability with

external applications and databases.

6. Performance Requirements

Performance requirements specify the expected behavior and performance metrics of

the software system.


xliii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 6.1 Response Time:

Ensures that the system responds promptly to user interactions, with minimal

latency.

 6.2 Throughput:

Maintains high throughput to handle concurrent requests and process a large

volume of image data efficiently.

 6.3 Scalability:

Scales horizontally and vertically to accommodate increasing data volumes

and user traffic.

 6.4 Resource Consumption:

Optimizes resource consumption, including CPU, memory, and storage, to

ensure efficient utilization and cost-effectiveness.

7. Feasibility Study

The feasibility study serves as a comprehensive evaluation of the project's feasibility,

encompassing technical, operational, and economic considerations. It examines the

project's technical feasibility by assessing the availability of necessary resources,

technology readiness, and compatibility with existing systems. Furthermore, it delves

into operational feasibility, evaluating the project's alignment with organizational

objectives, potential impact on workflows, and stakeholders' readiness for adoption.

Lastly, the economic feasibility analysis explores the project's financial viability,

including cost estimation, return on investment projections, and potential revenue

streams

 7.1 Technical Feasibility:


xliv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Determines whether the proposed technology and infrastructure can support

the project requirements. Evaluates the availability of suitable algorithms,

frameworks, and computing resources for image classification tasks.

 7.2 Operational Feasibility:

Assesses the usability, reliability, and security of the system from an

operational standpoint. Ensures that the system aligns with user expectations

and can seamlessly integrate into existing workflows.

 7.3 Economic Feasibility:

Analyzes the cost-effectiveness of the project, considering factors such as

development costs, infrastructure requirements, and potential return on

investment. By addressing these functional, non-functional, performance, and

feasibility aspects, the project aims to develop a robust and effective solution

for classifying Indian medicinal leaves using transfer learning-based

convolutional neural networks.

xlv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

CHAPTER 5

METHODOLOGY

xlvi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

5.1. Dataset

The image acquisition process in our system is designed to be versatile and robust,

freeing it from the constraints typically associated with conventional image

acquisition models. Unlike traditional methods that may be limited by factors such as

seasonality, time of day, lighting conditions, and background noise, our approach

ensures that images of plants are acquired invariant to these variables. This flexibility

makes our system well-suited for real-time plant analysis investigations, where timely

and accurate data acquisition is crucial for decision-making and research purposes.

The compilation of Indian medicinal plant species included in our dataset is the result

of a comprehensive and collaborative effort involving experts from various fields,

including botany, phytochemistry, and data science. Through intuitive exploration of

the medicinal values associated with indigenous plant species, in collaboration with

botanists, phytochemists, and leveraging data sources from reputable institutions such

as the Botanical Survey of India, we have curated a diverse and representative list of

Indian medicinal plants.

Figure 5.1 provides a detailed overview of the Indian medicinal plant species that

have contributed to our work. This list encompasses a wide range of plant species

known for their medicinal properties, spanning various botanical families, geographic

regions, and traditional healing practices. Each plant species included in the dataset

offers unique therapeutic benefits and has been selected based on its relevance to

traditional medicine, ethnobotanical knowledge, and documented pharmacological

properties.
xlvii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Figure 5.1 sample dateset

By incorporating a diverse array of Indian medicinal plant species into our dataset, we

aim to facilitate research, education, and innovation in the field of herbal medicine

and plant-based therapies. Our comprehensive dataset serves as a valuable resource

for researchers, practitioners, and enthusiasts interested in exploring the potential of

indigenous plants for healthcare, wellness, and conservation initiatives. Through

collaborative efforts and interdisciplinary collaboration, we strive to advance our

understanding of traditional medicine and promote the sustainable utilization of plant

resources for the betterment of human health and the environment.

xlviii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

5.2 Data Preparation

In the classification of Indian medicinal leaves using transfer learning-based

convolutional neural networks, the data preprocessing procedure typically involves

several steps to prepare the raw leaf images for input into the neural network. Here's a

generalized outline of the data preprocessing procedure:

 Data Collection:

Collect a diverse dataset of Indian medicinal leaves, ensuring a representative

sample across different species. Images can be obtained through various sources

such as online databases, field photography, or botanical gardens.

 Data Cleaning and Annotation:

Remove any irrelevant or corrupted images from the dataset.

Annotate each image with its corresponding class label (i.e., the medicinal plant

species).

Ensure consistency in labeling and annotation across the dataset.

 Data Augmentation:

Augment the dataset to increase its size and variability, which helps improve the

model's generalization ability.

Common augmentation techniques include rotation, flipping, scaling, cropping,

and brightness/contrast adjustments.

Ensure that augmented images retain their original semantic meaning (e.g., a
xlix
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

flipped image of a leaf should still represent the same plant species).

 Image Resizing:

Resize all images to a uniform size suitable for input into the neural network.

Commonly used sizes include 224x224 or 299x299 pixels, depending on the input

size expected by the pre-trained CNN architecture (e.g., VGG16, Xception,

EfficientNetV2).

 Normalization:

Normalize pixel values to a common scale to facilitate convergence during model

training.

Typically, pixel values are scaled to the range [0, 1] or [-1, 1].

 Train-Validation-Test Split:

Split the dataset into three subsets: training, validation, and testing.

The training set is used to train the model, the validation set is used for

hyperparameter tuning and model evaluation during training, and the test set is

used to assess the final model's performance.

 Data Loading:

Implement data loaders or generators to efficiently load batches of preprocessed

images during model training and evaluation.

Shuffle the training data to introduce randomness and prevent the model from

learning spurious correlations.

l
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Transfer Learning Initialization:

Initialize the pre-trained CNN model with weights learned from a large dataset

(e.g., ImageNet).

Freeze the weights of initial layers (excluding the classification layers) to prevent

them from being updated during the initial training phase.

By following these preprocessing steps, the dataset of Indian medicinal leaves is

appropriately prepared for classification using transfer learning-based convolutional

neural networks. This ensures that the model can effectively learn meaningful patterns

from the images and generalize well to unseen data.

5.3. Model Development

In the model development phase, our primary focus lies in adapting pre-trained

convolutional neural network (CNN) architectures to the specialized task of medicinal

plant leaf recognition. Given the inherent complexities of leaf imagery and the

relatively limited size of our dataset, transfer learning emerges as a compelling

strategy. Initially, we meticulously assess the suitability of prominent CNN

architectures such as VGG16, Xception, and EfficientNetV2. This assessment

considers both their architectural intricacies and their performance on analogous

image recognition tasks.

Transfer learning leverages the hierarchical representations learned by these models

on large-scale datasets like ImageNet. We capitalize on this by extracting relevant

features from the convolutional layers of these pre-trained models. This feature

li
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

extraction process equips our models with the ability to discern intricate patterns and

characteristics specific to medicinal plant leaves. Moreover, we develop a fine-tuning

strategy tailored to the unique characteristics of each CNN architecture. This strategy

strikes a delicate balance between leveraging the prior knowledge embedded in the

pre-trained models and adapting to the nuances of our specific dataset.

A key aspect of our approach involves customizing the output layer of each model to

align with the number of classes in our dataset. This ensures compatibility for

classification tasks, allowing our models to accurately categorize medicinal plant

leaves into their respective classes. By meticulously fine-tuning the pre-trained CNN

architectures and optimizing their configurations, we aim to develop robust and

accurate models capable of effectively recognizing and classifying medicinal plant

leaves, thereby contributing to advancements in botanical research and conservation

efforts.

Transfer Learning with CNN Architectures:

Model Selection: Evaluate the suitability of VGG16, Xception, and

EfficientNetV2 for the task based on their architectural characteristics and

performance on similar image recognition tasks. Based on these evaluations,

all three architectures show promise for the task of medicinal plant leaf

recognition. VGG16 offers simplicity and competitive performance, while

Xception and EfficientNetV2 provide more sophisticated architectural designs

that prioritize efficiency without compromising accuracy. The final choice

may depend on factors such as computational resources, dataset size, and

specific performance requirements.

lii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

liii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

5.3.1 VGG16 (Visual Geometry Group 16):

VGG16, developed by the Visual Geometry Group (VGG) at the University of

Oxford, is a convolutional neural network (CNN) architecture renowned for its

simplicity and effectiveness in image recognition tasks. Introduced in the paper "Very

Deep Convolutional Networks for Large-Scale Image Recognition" by Karen

Simonyan and Andrew Zisserman, VGG16 comprises a total of 16 layers, hence its

name. These layers are organized into a sequence of convolutional and fully

connected layers, with convolutional layers responsible for feature extraction and

fully connected layers for classification.

The key characteristic of VGG16 is its uniform architecture, where the convolutional

layers all have a small receptive field of 3x3 pixels and a stride of 1. This uniformity

simplifies the architecture and makes it easier to understand and implement.

Additionally, VGG16 employs max-pooling layers to downsample feature maps,

reducing spatial dimensions and extracting increasingly abstract features as the data

flows through the network.

Despite its simplicity, VGG16 has demonstrated remarkable performance on various

image recognition benchmarks, including the ImageNet Large Scale Visual

Recognition Challenge (ILSVRC). By stacking multiple convolutional layers, VGG16

can learn hierarchical representations of visual features, enabling it to recognize

objects and patterns in images with high accuracy. Its success has led to widespread

adoption and served as a foundation for more advanced CNN architectures.

liv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Overall, VGG16's simplicity, uniform architecture, and strong performance make it a

popular choice for image recognition tasks, serving as a benchmark for evaluating the

effectiveness of more complex CNN architectures.

Methodology

VGG16 architecture comprises a series of convolutional layers followed by max-

pooling layers, with fully connected layers at the end for classification. The

convolutional layers learn hierarchical features from input images, while the fully

connected layers perform classification based on these features.

 Features of VGG16

Deep Architecture: VGG16 has a deep architecture with multiple convolutional

layers, allowing it to learn intricate patterns and features from images effectively.

 Uniform Structure: The architecture of VGG16 is uniform, with small 3x3

convolutional filters and max-pooling layers, resulting in a consistent feature

extraction process across all layers.

 Transfer Learning: VGG16 is often used for transfer learning, where the pre-

trained model is fine-tuned on a specific dataset to perform tasks such as

image classification, object detection, and image segmentation.

 Accuracy: VGG16 has demonstrated high accuracy on various image

recognition tasks, making it a popular choice for research and practical

applications.

 Parameters in VGG16

 Input shape

 Number of convolutional layers

 Number of filters in each convolutional layer


lv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Size of max-pooling windows

 Number of units in fully connected layers

 Why VGG16?

VGG16's deep architecture and uniform structure make it well-suited for learning

complex features from images, resulting in high accuracy on various image

recognition tasks.

Fig 5.3.1 Architecture of VGG16

lvi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

5.3.2 Xception:

Xception is a convolutional neural network architecture proposed by François Chollet,

the creator of the Keras deep learning library. It draws inspiration from the Inception

architecture but introduces a novel approach to convolutional neural networks (CNNs)

by employing depthwise separable convolutions.

The key innovation of Xception lies in its use of depthwise separable convolutions,

which decouple the spatial and channel-wise operations in standard convolutions.

This separation allows the network to capture spatial relationships more efficiently

while reducing computational complexity. By replacing traditional convolutional

layers with depthwise separable convolutions, Xception achieves a significant

reduction in the number of parameters and computations compared to previous

architectures.

Another notable feature of Xception is its deep architecture, consisting of a series of

depthwise separable convolution layers followed by global average pooling and fully

connected layers. This architecture enables Xception to learn hierarchical features

from input images effectively. Additionally, the network employs skip connections to

facilitate gradient flow during training and alleviate the vanishing gradient problem,

promoting better convergence and learning stability.

Xception has demonstrated superior performance on various image recognition tasks,

including object classification, detection, and segmentation. Its efficient architecture

and high accuracy make it well-suited for deployment in resource-constrained


lvii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

environments or applications requiring real-time processing. Moreover, Xception's

versatility and scalability make it a valuable asset for researchers and practitioners in

the field of computer vision.

Methodology

Xception architecture introduces depthwise separable convolutions, which separate

the spatial and channel-wise convolutions, significantly reducing the number of

parameters and computational complexity compared to traditional convolutional

layers.

 Features of Xception:

Depthwise Separable Convolutions: Xception replaces traditional convolutions with

depthwise separable convolutions, resulting in a more efficient and lightweight

architecture with fewer parameters and lower computational cost.

 Extreme Depth: Xception achieves extreme depth by stacking multiple depthwise

separable convolutional layers, allowing it to learn hierarchical features from input

images effectively.

 Transfer Learning: Xception is well-suited for transfer learning tasks, where the pre-

trained model is fine-tuned on specific datasets to perform tasks such as image

classification and object detection.

 Parameters in Xception

 Input shape

 Depth multiplier

 Number of convolutional layers

 Number of filters in each convolutional layer

 Activation functions
lviii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Why Xception?

Xception's efficient architecture and depthwise separable convolutions make it

suitable for deployment on resource-constrained devices and applications requiring

high computational efficiency while maintaining high accuracy.

Fig 5.3.2 Architecture of Xception

lix
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

5.3.3 EfficientNetV2:

EfficientNetV2 is an improved version of the EfficientNet architecture, introduced by

Google researchers. It aims to further optimize model efficiency while maintaining

high accuracy in image classification tasks.EfficientNetV2 represents an evolution of

the original EfficientNet architecture, which was designed to balance model

efficiency and accuracy by scaling the network's depth, width, and resolution.

Introduced by Google researchers, EfficientNetV2 builds upon this foundation to

achieve even greater efficiency and performance in image classification tasks.

One of the key enhancements in EfficientNetV2 is the adoption of a new compound

scaling method, which optimizes model scaling across multiple dimensions

simultaneously. This approach ensures that the network's depth, width, and resolution

are scaled in a harmonious manner, leading to improved performance without

significantly increasing computational costs.

EfficientNetV2 also introduces novel architectural innovations, including the use of

improved building blocks such as inverted residuals and squeeze-and-excitation

blocks. These building blocks enhance the network's representational capacity and

enable it to capture more complex patterns and features from input images.

Moreover, EfficientNetV2 incorporates techniques to enhance training efficiency and

regularization, such as stochastic depth regularization and weight standardization.

These techniques improve the robustness and generalization capability of the network,

leading to better performance on diverse datasets and tasks.


lx
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Overall, EfficientNetV2 represents a state-of-the-art architecture for image

classification, offering a compelling combination of efficiency, accuracy, and

scalability. Its advancements make it a valuable tool for various computer vision

applications, including fake news detection, where efficient processing of multimedia

content is crucial.

 Methodology

EfficientNetV2 builds upon the success of the original EfficientNet architecture

by incorporating novel design techniques such as advanced compound scaling,

enhanced model architecture, and improved training strategies.

 Features of EfficientNetV2

Compound Scaling: EfficientNetV2 employs compound scaling to simultaneously

optimize the depth, width, and resolution of the neural network architecture. This

allows for better utilization of computational resources and improved model

performance across various hardware platforms.

 Model Architecture

EfficientNetV2 features a streamlined architecture with carefully designed

building blocks, including inverted residual blocks and linear bottleneck layers.

These architectural enhancements contribute to both efficiency and accuracy

improvements.

 Improved Training Strategies: EfficientNetV2 incorporates advanced

training strategies such as regularization techniques, data augmentation, and

learning rate scheduling to enhance model generalization and prevent

overfitting.

lxi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Parameters in EfficientNetV2

 Depth scaling coefficient

 Width scaling coefficient

 Resolution scaling coefficient

 Number of layers

 Number of channels in each layer

 Activation functions

 Regularization parameters

 Why EfficientNetV2?

EfficientNetV2 stands out as a pinnacle of innovation in the realm of deep

learning models, boasting a harmonious blend of efficiency and accuracy that

caters to the diverse needs of both resource-constrained environments and

large-scale image classification endeavors. Its emergence represents a

significant leap forward in the field, thanks to its sophisticated design

principles and streamlined architecture.

One of the most striking features of EfficientNetV2 is its unparalleled

efficiency in resource utilization, a critical aspect in today's computational

landscape. By leveraging advanced design techniques such as compound

scaling, neural architecture search, and attention mechanisms, EfficientNetV2

achieves remarkable performance while efficiently managing computational

resources. This efficiency is particularly advantageous for scenarios where

hardware limitations or cost considerations come into play, allowing for

lxii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

seamless integration into a wide range of applications and platforms.

Moreover, EfficientNetV2's superior accuracy adds another layer of appeal, ensuring

that its deployment translates into tangible benefits in terms of task performance and

model effectiveness. Through meticulous optimization and fine-tuning, the model

achieves state-of-the-art results across various benchmark datasets and real-world

applications. This blend of efficiency and accuracy makes EfficientNetV2 a

compelling choice for practitioners seeking to maximize the impact of their machine

learning solutions while optimizing resource allocation.

In essence, EfficientNetV2 represents a paradigm shift in the design philosophy of

convolutional neural networks, setting new standards for model efficiency and

performance. Its ability to strike a delicate balance between resource utilization and

accuracy makes it a versatile tool in the hands of researchers, developers, and

practitioners alike, poised to drive innovation and unlock new possibilities in the field

of deep learning.

lxiii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Fig 5.3.3 Architecture of EffiecientNetV2

5.4 Performance Comparison Charts:

In this section, we present performance comparison charts to evaluate the efficacy of

different pre-trained models for feature extraction on medicinal plant image datasets.

The comparative analysis focuses on three widely used models: VGG16, Xception,

and EfficientNetV2. These models were selected based on their architectural

characteristics and previous performance on similar image recognition tasks.

lxiv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Fig 5.4.Plots of model loss of (a) Xception, (b) VGG16, (c) EfficientNetV2

 Feature Extraction: Extract features from the pre-trained CNN models'

convolutional layers, capturing hierarchical representations of leaf images.

 Fine-tuning Strategy: Determine the extent of fine-tuning required for each

model, considering factors such as dataset size, domain similarity, and

computational resources.

 Model Architecture Modification: Adapt the output layer of each CNN

architecture to match the number of classes in the medicinal plant leaf dataset,

ensuring compatibility for classification.

 Model Customization and Optimization:

lxv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

o Hyperparameter Tuning: Optimize hyperparameters such as learning

rate, batch size, and regularization techniques to enhance model

performance and convergence.

o Regularization Techniques: Implement regularization techniques

such as dropout and weight decay to prevent overfitting and improve

generalization.

o Activation Functions: Experiment with different activation functions

(e.g., ReLU, Leaky ReLU, or SELU) to enhance the non-linearity of

the model and facilitate feature learning.

5.5 Training and Evaluation

In the training and evaluation phase, we embark on the iterative process of training

our modified CNN models and assessing their performance. Guided by principles of

optimization and regularization, we fine-tune the hyperparameters of our models to

achieve optimal convergence and generalization. Throughout the training procedure,

we closely monitor the models' performance on the validation set, employing early

stopping mechanisms to prevent overfitting and expedite convergence. Additionally,

we implement learning rate scheduling techniques to adaptively adjust the learning

rate during training, enhancing the models' adaptability to varying gradients. Upon

completion of the training process, we subject our models to rigorous evaluation using

established classification metrics such as accuracy, precision, recall, and F1-score. By

analyzing confusion matrices and ROC curves, we gain insights into the models'

classification behavior and their ability to discriminate between different plant

species. Furthermore, we explore cross-validation techniques to assess model


lxvi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

generalization and mitigate biases introduced by random initialization. Finally, we

prioritize computational efficiency and scalability by optimizing model size,

exploring parallelization strategies, and leveraging GPU acceleration to expedite

training and inference.

5.5.1 Model Training:

 Training Procedure: Train the modified CNN models using the training

dataset, employing iterative optimization algorithms such as stochastic

gradient descent (SGD) or Adam.

 Validation Monitoring: Monitor the models' performance on the validation

set during training epochs to detect signs of overfitting or underfitting.

 Early Stopping: Implement early stopping criteria based on validation

performance to halt training when model performance ceases to improve,

preventing unnecessary computational overhead.

 Learning Rate Scheduling: Employ learning rate scheduling techniques such

as exponential decay or cyclic learning rates to dynamically adjust the learning

rate during training and facilitate faster convergence.

5.5.2 Model Evaluation:

 Performance Metrics: Evaluate model performance using standard

classification metrics including accuracy, precision, recall, and F1-score to

assess classification effectiveness across different plant species.

 Confusion Matrix Analysis: Generate confusion matrices to visualize model

predictions and identify classes with high confusion rates, providing insights

into model behavior and misclassifications.

 ROC Curve Analysis: Compute receiver operating characteristic (ROC)


lxvii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

curves and area under the curve (AUC) scores to assess the models' ability to

discriminate between classes and determine optimal decision thresholds.

 Cross-Validation: Employ cross-validation techniques such as k-fold cross-

validation to assess model generalization across different data splits and

mitigate biases introduced by random initialization.

5.5.3 Computational Efficiency and Scalability:

 Model Optimization: Implement model optimization techniques such as

model pruning, quantization, or knowledge distillation to reduce model size

and inference latency while preserving classification performance.

 Parallelization: Explore distributed training strategies and GPU acceleration

to improve training efficiency and scalability, enabling faster experimentation

and model iteration.

5.6. Algorithms

 Random Forest:

Random Forest is a versatile ensemble learning algorithm that can be highly

effective for classification tasks, including the classification of Indian medicinal

leaves. It works by constructing multiple decision trees during training and

outputs the mode of the classes of the individual trees. In your project, Random

Forest can be applied by extracting relevant features from leaf images and using

them as input to train the Random Forest classifier. Features such as leaf shape,

texture, and color can be extracted using image processing techniques. The

algorithm can handle a large number of input features and is robust to overfitting,
lxviii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

making it suitable for complex datasets like medicinal leaf images.

 Support Vector Machines (SVM):

SVM is a powerful supervised learning algorithm commonly used for

classification tasks. It works by finding the hyperplane that best separates the

classes in the feature space. In your project, SVM can be utilized by transforming

the extracted features from leaf images into a high-dimensional space and finding

the optimal hyperplane to separate different classes of medicinal leaves. SVM is

effective in handling both linearly separable and non-linearly separable datasets,

making it suitable for classifying complex leaf patterns and textures.

 K-Nearest Neighbors (KNN):

KNN is a simple yet effective classification algorithm that classifies new instances

based on the majority class of their k nearest neighbors in the feature space. In

your project, KNN can be applied by first extracting relevant features from leaf

images and then computing the similarity between each pair of images. During

classification, the class label of a test image can be determined based on the class

labels of its nearest neighbors. KNN is particularly useful when the underlying

data distribution is not well-defined and can handle both linear and non-linear

decision boundaries.

 Logistic Regression:

Logistic Regression is a classical linear model commonly used for binary

classification tasks. However, it can also be extended to multiclass classification

lxix
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

using techniques like one-vs-rest or softmax regression. In your project, logistic

regression can be employed to classify medicinal leaves by learning a linear

decision boundary in the feature space. Features extracted from leaf images can be

used as input to train the logistic regression model, and the model can output the

probability of each class for a given input image. Logistic regression is

computationally efficient and interpretable, making it suitable for applications

where model interpretability is important.

 Decision Trees:

Decision Trees are intuitive and interpretable models that recursively partition the

feature space into regions based on feature values. They make predictions by

traversing the tree from the root to the leaf nodes, where each leaf node

corresponds to a class label. In your project, decision trees can be applied by using

features extracted from leaf images to construct a tree-based classifier. Decision

trees are robust to outliers and can handle both numerical and categorical features,

making them suitable for classifying medicinal leaves with diverse characteristics.

lxx
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Deep Learning Architectures:

Deep learning architectures like convolutional neural networks (CNNs) are state-

of-the-art models for image classification tasks. In your project, you are already

utilizing transfer learning-based CNNs such as VGG16, Xception, and

EfficientNetV2. These CNN architectures can learn hierarchical representations of

image features and achieve high accuracy in classifying medicinal leaves.

Additionally, other deep learning architectures like recurrent neural networks

(RNNs) or attention mechanisms can be explored if your dataset includes

sequential data or text-based features associated with medicinal plants.

5.7 Key Performance Indicators

This section defines the metrics (or KPIs, Key Performance Indicators) used to be

able to evaluate the results of the algorithms used [49]:

 Accuracy

Numeric value indicating the performance of the predictive model. It is calculated

as follows:

(1)

where:

TP: True Positive. Result in which the model correctly predicts the positive class.

FP: False Positive. Result in which the model incorrectly predicts the positive

class.

TN: True Negative. Result in which the model correctly predicts the negative class.

FN: False Negative. Result in which the model incorrectly predicts the negative
lxxi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

class.

 Kappa statistic

It measures the agreement between two examiners in their corresponding

classifications of N elements into C mutually exclusive categories. In the case

of machine learning, it refers to the actual class and the class expected by the

model used. It is calculated as follows:

(2)

where:

Pr (a) is the observed relative agreement between observers, and Pr (e) is

the hypothesized probability of agreement by chance, using the observed

data to compute the probabilities that each observer randomly ranks each

category. If raters fully agree, then κ = 1. If there is no agreement between

raters other than what would be expected by chance (as defined by Pr (e)),

then κ = 0.

 Logarithmic Loss

It is the negative average of the log of corrected predicted probabilities for

each instance. It is calculated as follows:

(3)

where:

N is the number of samples.


lxxii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

M is the number of classes.

yij, indicates if the sample i belongs to the class j or not.

pij, indicates the probability that the sample i belongs to the class j.

 Error

The error gives an indication of how far the predictions are from the actual

output. There are two formulas: Mean Absolute Error (MAE) and Mean

Squared Error (MSE). It is calculated as follows:

(4)

(5)

where:

N corresponds to the total number of samples.

𝑦𝑘 corresponds to the class indicated by the classification model.

𝑦𝑘̂^ corresponds to the actual class.

 Sensitivity

The sensitivity of a model (or the ratio of true positives) measures the

proportion of correctly classified positive examples. The total number of

positives is the sum of those that were correctly classified and those that were

incorrectly classified. It is calculated as follows:

lxxiii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

(6)

where:

TP: True Positive. Result in which the model correctly predicts the positive

class.

TN: True Negative. Result in which the model correctly predicts the negative

class.

FN: False Negative. Result in which the model incorrectly predicts the

negative class.

 Specificity

The specificity of a model (or the ratio of true negatives) measures the

proportion of correctly classified negative examples. The total number of

negatives is the sum of those that were correctly classified and those that were

incorrectly classified. It is calculated as follows:

(7)

where:

TP: True Positive. Result in which the model correctly predicts the positive class.

FP: False Positive. Result in which the model incorrectly predicts the positive class.

TN: True Negative. Result in which the model correctly predicts the negative class.

 Precision

Precision is defined as the proportion of examples classified as positive that


lxxiv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

are actually positive. That is, when a model predicts values as positive. It is

calculated as follows:

(8)

where:

TP: True Positive. Result in which the model correctly predicts the positive

class.

TN: True Negative. Result in which the model correctly predicts the negative

class.

FN: False Negative. Result in which the model incorrectly predicts the

negative class.

 Recall

Recall is defined as the number of correctly classified positives over the total

number of positives. This formula is the same as that for sensitivity. It is

calculated as follows:

(9)

where:

TP: True Positive. Result in which the model correctly predicts the positive

class.

FP: False Positive. Result in which the model incorrectly predicts the positive

class.
lxxv
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

TN: True Negative. Result in which the model correctly predicts the negative

class.

 F-measure

F-measure is a measure of model performance that combines precision and

recall into a value called F-measure (also called F1 score or F-score). This

measure combines precision and recall using harmonic averaging, which is

used for ratios. This type of averaging is used instead of arithmetic, since

precision and recall are expressed as proportions between 0 and 1, which can

be interpreted as ratios. It is calculated as follows:

lxxvi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

CHAPTER 6

SYSTEM DESIGN

lxxvii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

6.1 System Architecture:

Figure 6.1 System Architecture

In the classification of Indian medicinal leaves using transfer learning-based

convolutional neural networks (CNNs), the system architecture plays a pivotal role in

achieving accurate and efficient recognition. The architecture typically comprises

several interconnected layers, including convolutional layers, pooling layers, fully

connected layers, and an output layer. These layers work in tandem to extract

hierarchical features from input leaf images and map them to the corresponding

medicinal plant classes. Transfer learning is integrated into the architecture by

leveraging pre-trained CNN models such as VGG16, ResNet, or EfficientNet, which

have been trained on large-scale datasets like ImageNet. By initializing the network

lxxviii
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

with weights learned from these datasets, the system can effectively capture generic

features from natural images, enhancing its ability to classify medicinal plant leaves

with limited labeled data.

Moreover, fine-tuning layers of the pre-trained CNN models allows for the adaptation

of features to the specific characteristics of Indian medicinal leaves. This fine-tuning

process involves adjusting the weights of certain layers during training on the target

dataset while keeping the weights of earlier layers frozen to retain the learned generic

features. Additionally, data augmentation techniques such as rotation, flipping, and

scaling are often applied to artificially increase the diversity of the training dataset

and improve the robustness of the model against variations in leaf images. The final

layers of the architecture are typically configured to output class probabilities using

softmax activation, enabling the classification of medicinal plant leaves into their

respective categories.

Furthermore, the system architecture may include mechanisms for model evaluation

and optimization to ensure the reliability and scalability of the classification system.

Cross-validation techniques such as k-fold validation may be employed to assess the

generalization performance of the model on unseen data. Hyperparameter tuning

methods such as grid search or random search may also be utilized to optimize the

performance of the CNN architecture. Additionally, the deployment of the system

architecture can be facilitated through integration with web or mobile applications,

allowing users to easily access the classification functionality for identifying Indian

medicinal leaves in real-world scenarios. Overall, a well-designed system architecture

lxxix
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

is essential for effectively leveraging transfer learning-based CNNs in the

classification of Indian medicinal leaves, enabling accurate and reliable recognition of

plant species for various applications in healthcare, biodiversity conservation, and

traditional medicine research.

6.2 UML Diagrams

6.2.1 Use Case diagram

A use case diagram in the Unified Modeling Language (UML) is a type of behavioral

diagram defined by and created from a Use-case analysis

lxxx
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Fig 6.2.1 Use Case Diagram from Data loading and Exploratio

lxxxi
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Use Cases:

 User/Administrator:

 Login: The user or administrator logs into the system using their credentials to

access the platform for classifying Indian medicinal leaves.

 Upload Image: Users upload images of medicinal leaves to the system for

classification.

 Preprocess Image: Upon uploading, the system preprocesses the images to

enhance their quality and standardize them for feature extraction.

 Extract Features from Image: The system extracts relevant features from the

uploaded images, such as leaf shape, texture, and color, to prepare them for

classification.

 Build Convolutional Neural Network (CNN) Model: The system constructs

a CNN model using transfer learning techniques, integrating pretrained models

like VGG16, Xception, and EfficientNetV2.

 Train CNN Model: The system trains the CNN model using the extracted

features from the uploaded images to learn the distinguishing patterns of

different medicinal plant leaves.

 Evaluate CNN Model: After training, the system evaluates the performance

of the CNN model using validation datasets to assess its accuracy and

generalization capability.

 Predict Plant Species: Users can input new images of medicinal leaves, and

the system utilizes the trained CNN model to predict the species of the plants

 depicted in the images.

 Display Prediction Results: The system displays the predicted plant


82
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

species along with confidence scores to users, enabling them to identify

the medicinal plants accurately.

 Extract Features from Image: The prediction model extracts features from

the uploaded images of medicinal leaves to prepare them for classification.

 Build Convolutional Neural Network (CNN) Model: The prediction model

constructs a CNN model using transfer learning techniques, incorporating

pretrained models like VGG16, Xception, and EfficientNetV2.

 Train CNN Model: The prediction model trains the CNN model using the

extracted features from the images to learn the distinguishing patterns of

different medicinal plant leaves.

 Evaluate CNN Model: After training, the prediction model evaluates the

performance of the CNN model using validation datasets to assess its accuracy

and generalization capability.

 Predict Plant Species: The prediction model utilizes the trained CNN model

to predict the species of medicinal plants depicted in new images uploaded by

users.

 Display Prediction Results: After prediction, the prediction model displays

the predicted plant species along with confidence scores, facilitating accurate

identification of medicinal plants.

 Associations:

 User/Administrator to Use Cases: The user/administrator interacts with the system

by performing various use cases such as login, uploading datasets, and viewing

predicted outputs. Prediction Model to Use Cases: The prediction model performs

tasks related to feature extraction, providing features to the ML model, predicting and

83
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

analyzing datasets, and displaying predicted outputs and visualizations. This use case

diagram provides an overview of the interactions between different actors and

components in the online payment fraud detection system using machine learning.

6.2.2 Sequence diagram:

A sequence diagram in Unified Modeling Language (UML) is a kind of interaction

diagram that shows how processes operate with one another and in what order. It is a

construct of a Message Sequence Chart. Sequence diagrams are sometimes called

event diagrams, event scenarios, and timing diagrams.

Figure 6.2.2 Sequence diagram


84
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

85
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Interactions:

 Actor User: Represents the user interacting with the system.

 User Interface (UI): The interface through which the user interacts with

the system.

 Input Image: Represents the component responsible for handling input

images.

 Image Preprocessing: Handles the preprocessing of the input image

before classification.

 Classification: Performs the classification of the preprocessed image.

 Feature Extraction: Extracts features from the input image for

classification.

 Performance Measurement: Measures the performance of the

classification process.

 Events:

 The User uploads an image through the User Interface.

 The User Interface forwards the uploaded image data to the Input Image

component.

 The Input Image component receives the image data.

 The Input Image component sends the image data to the Image

Preprocessing component to preprocess it.

 The Image Preprocessing component preprocesses the image data.

 The Preprocessing component forwards the preprocessed image to the

Classification component for classification.

 The Classification component performs the classification of the


86
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

preprocessed image.

 After classification, the Classification component sends the image data to

the Feature Extraction component to extract features.

 The Feature Extraction component extracts features from the image data.

 The Feature Extraction component forwards the extracted features to the

Performance Measurement component to calculate accuracy.

6.2.3 Activity Diagram for splitting of data

Activity diagrams serve as invaluable tools in the realm of software engineering,

providing graphical representations of workflows comprising stepwise activities,

actions, and decisions. With built-in support for choice, iteration, and concurrency,

these diagrams offer a comprehensive view of the business and operational processes

within a system.

Within the Unified Modeling Language (UML), activity diagrams serve as

indispensable assets for describing the intricate step-by-step workflows of various

system components. Whether it's depicting the sequence of tasks in a software

application or illustrating the operational procedures in a business process, activity

diagrams offer a visual framework for understanding the flow of control.

At their core, activity diagrams encapsulate the overall flow of control within a

system or process, delineating the sequence of activities and the transitions between

them. By leveraging symbols and notations such as actions, decisions, forks, joins,

and swimlanes, these diagrams provide a clear and intuitive representation of complex

87
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

workflows.

In essence, activity diagrams serve as powerful communication tools, facilitating

collaboration among stakeholders and enabling a shared understanding of system

behavior. Whether used during the design phase to conceptualize workflows or during

the implementation phase to guide development efforts, activity diagrams play a

crucial role in the software development lifecycle, ensuring clarity, coherence, and

efficiency in the development process.

Fig 6.2.3 Activity Diagram for Splitting of data

88
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 User Uploads Image:

 Activity: User uploads an image of a medicinal plant leaf for

classification.

 Decision: Check if the uploaded image is valid.

 If valid, proceed to the next activity.

 If invalid, prompt the user to upload a valid image.

 Image Preprocessing:

 Activity: Preprocess the uploaded image to enhance its quality and prepare

it for classification.

 Resize image: Ensure the image dimensions are suitable for processing.

 Normalize image: Adjust pixel values to a standard range for consistency.

 Denoise image: Remove noise and artifacts from the image.

 Decision: Check if preprocessing is successful.

 If successful, proceed to the next activity.

 If unsuccessful, terminate the process and notify the user.

 Feature Extraction:

 Activity: Extract features from the preprocessed image using transfer

learning techniques.

 Decision: Check if feature extraction is successful.

 If successful, proceed to the next activity.

 If unsuccessful, terminate the process and notify the user.

 Classification:

 Activity: Classify the preprocessed image using a pre-trained CNN model

89
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

(e.g., VGG16, Xception, EfficientNetV2).

 Decision: Check if classification is successful.

 If successful, proceed to the next activity.

 If unsuccessful, terminate the process and notify the user.

 Display Results:

 Activity: Display the classification results to the user.

6.3.4 Class diagram:

A class diagram is a type of structural diagram in UML (Unified Modeling Language)

that represents the static structure of a system by showing the classes of the system,

their attributes, methods, and the relationships among them. It provides a graphical

representation of the system's architecture, emphasizing the classes and their

associations, aggregations, and inheritances.

90
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Figure 6.3.4 Class diagram

 Input Image:

 Description: Represents the input image data to be classified.

 Attributes: image_data: Image - The raw image data to be processed.

 Responsibilities: Provide the raw image data for preprocessing and

classification.

 Image Preprocessing:

 Description: Handles the preprocessing of input images before

classification.

91
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Methods: preprocess_image(image_data: Image): Image - Preprocesses

the input image data.

 Responsibilities: Apply preprocessing techniques to enhance image

quality and prepare it for classification.

 Classification:

 Description: Performs the classification of preprocessed images using

convolutional neural networks (CNNs).

 Attributes: model: CNNModel - The trained CNN model for image

classification.

 Methods: classify_image(image_data: Image): ClassificationResult -

Classifies the input image.

 Responsibilities: Utilize the trained CNN model to classify input images

into different categories.

 Performance Measurement:

 Description: Evaluates the performance of the classification system.

 Attributes: results: List<ClassificationResult> - List of classification

results for evaluation.

 Methods: calculate_accuracy(): float - Calculates the accuracy of the

classification system.

 Responsibilities: Assess the accuracy of the classification results to

measure the performance of the system.

92
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Feature Extraction:

 Description: Extracts relevant features from preprocessed images.

 Attributes: features: List<Feature> - List of extracted features from

images.

 Methods: extract_features(image_data: Image): List<Feature> - Extracts

features from input images.

 Responsibilities: Identify and extract meaningful features from

preprocessed images for classification.

 Clustering Image:

 Description: Groups images based on extracted features for further

analysis.

 Attributes: clusters: List<Cluster> - List of clusters formed by grouping

similar images.

 Methods: cluster_images(features: List<Feature>): List<Cluster> -

Performs clustering of images based on extracted features.

 Responsibilities: Cluster images with similar features to facilitate analysis

and visualization

93
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

CHAPTER 7
IMPLEMENTATION AND
EVALUATION

94
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

7 IMPLEMENTATION
The implementation of our medicinal plant classification project involved several key

steps and components. Initially, we imported necessary libraries such as TensorFlow

and Keras for deep learning, along with additional libraries for data manipulation and

visualization. Utilizing Google Colab as our development environment, we imported

the dataset and performed data exploration. This included plotting sample images for

visualization and understanding the characteristics of the dataset. Subsequently, we

conducted a train-test split to prepare the data for model training and evaluation.

Augmentation techniques were applied to enhance the diversity of the training dataset

and improve model generalization. We then imported the VGG19 pre-trained model

for transfer learning, leveraging its learned representations for feature extraction. The

model architecture was defined, and a callback for early stopping was implemented to

prevent overfitting. After training the model, we evaluated its performance on the test

dataset using various evaluation metrics such as precision, recall, and F1-score.

Additionally, we experimented with ensemble techniques, including average

ensemble, to further improve classification accuracy. Finally, we conducted testing on

our own images to assess the model's real-world applicability.

The utilization of transfer learning techniques played a pivotal role in our approach,

with the VGG19 pre-trained model serving as the backbone for feature extraction. By

leveraging the learned representations from the VGG19 model, we were able to

effectively capture and utilize high-level features relevant to medicinal plant

classification tasks, thereby reducing the need for extensive training on limited

datasets
95
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

96
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

7.1 Dataset

In our dataset acquisition process, we aimed to create a comprehensive repository of

Indian medicinal plant images that could serve as a valuable resource for various

research and analysis endeavors. Unlike conventional image acquisition methods, our

approach prioritized flexibility and adaptability, allowing us to overcome common

constraints such as seasonal variations, time constraints, lighting conditions, and

background interference.

One of the key strengths of our dataset is its robustness in capturing images of

medicinal plants across different seasons, times of day, and environmental conditions.

By ensuring variability in these factors, we aimed to create a dataset that reflects the

diverse and dynamic nature of plant growth and development in real-world scenarios.

This variability enhances the generalizability and applicability of our dataset to a wide

range of research applications, including real-time plant analysis and monitoring.

To compile the list of Indian medicinal plant species included in our dataset, we

collaborated closely with experts in botany, phytochemistry, and botanical research.

Leveraging their expertise and insights, we curated a comprehensive list of medicinal

plant species known for their therapeutic properties and traditional medicinal uses in

the Indian context. Additionally, we utilized data sources from reputable institutions

such as the Botanical Survey of India to validate and enrich our dataset with accurate

botanical information.

Figure 6.1 provides a detailed overview of the Indian medicinal plant species that

contributed to our dataset. This list serves as a valuable reference for researchers,

97
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

botanists, and enthusiasts interested in exploring the rich diversity of medicinal plants

in India. By incorporating a diverse range of plant species with documented medicinal

values, our dataset aims to facilitate interdisciplinary research and promote the

discovery of novel therapeutic compounds and medicinal formulations

Figure 7.1 list of some medicinal plants species

98
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

99
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

7.2 Import modules

Pandas used to perform data manipulation and analysis

numpy used to perform a variety of mathematical operations on arrays

matplotlib used for data visualization and graphical plotting

seaborn built on top of matplotlib with similar functionalities

os used to handle files using system commands

tqdm progress bar decorator for iterators

warnings to manipulate warnings details, filterwarnings('ignore')

load_img used for loading the image as numpy array

tensorflow backend module for the use of Keras

Dense single dimension linear layer

Activation layer for the use of certain threshold

Flatten convert a 2D array into a 1D array

Conv2D convolutional layer in 2 dimension

MaxPooling2D function to get the maximum pixel value to the next layer

100
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

7.3 Plot model architecture

In the process of developing our medicinal plant classification models, one crucial

aspect involved visualizing the architecture of the neural networks employed.

Visualizing the model architecture provides valuable insights into the network's

structure, including the arrangement of layers, the flow of data through the network,

and the parameters associated with each layer.

To plot the model architecture, we utilized various visualization techniques and tools

available in popular deep learning frameworks such as TensorFlow and Keras. These

tools offer built-in functions for generating graphical representations of neural

network architectures, allowing us to gain a comprehensive understanding of the

model's design and complexity.

The plotted model architecture typically includes detailed information about each

layer in the network, such as the type of layer (e.g., convolutional, pooling, dense),

the number of neurons or filters, the activation functions used, and any additional

parameters or configurations. This visual representation serves as a useful reference

for understanding how the model processes input data and makes predictions.

Furthermore, plotting the model architecture facilitates communication and

collaboration among team members, enabling researchers, developers, and

stakeholders to discuss and refine the network design effectively. By visualizing the

architecture, we can identify potential areas for optimization, fine-tuning, or

modification to enhance the model's performance and efficiency.

101
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

In summary, plotting the model architecture is an essential step in the development

and evaluation of deep learning models for medicinal plant classification. It provides

a clear and intuitive depiction of the network structure, aiding in model interpretation,

optimization, and decision-making throughout the development lifecycle.

102
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Figure 7.3 architecture model

103
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

7.4 Feature Extraction model

In the feature extraction model phase of our project, we embarked on a

comprehensive exploration to assess the efficacy of various pre-trained convolutional

neural network (CNN) architectures for feature extraction tasks on our medicinal

plant image datasets. Our primary objective was to identify the most suitable model

that could effectively capture and represent the intricate visual patterns and

characteristics inherent in medicinal plant images.

To facilitate this comparative analysis, we selected three prominent pre-trained CNN

models: VGG16, VGG19, and MobileNetV2. These models are renowned for their

versatility, robustness, and effectiveness in diverse image recognition tasks, making

them ideal candidates for feature extraction in our project.

The experimentation process involved meticulously designing and implementing

workflows to extract features from our medicinal plant image datasets using each of

the selected pre-trained models. We leveraged the learned representations encoded

within the convolutional layers of these models to extract meaningful and

discriminative features from the input images.

For each pre-trained model, we meticulously fine-tuned the feature extraction process

to optimize performance and ensure compatibility with our specific dataset

characteristics. This involved configuring the input preprocessing pipeline, defining

the layers for feature extraction, and selecting appropriate parameters to tailor the

feature extraction process to our project requirements.

Upon extracting features from the medicinal plant images using VGG16, VGG19, and
104
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

MobileNetV2, we conducted in-depth analyses and comparisons to evaluate their

effectiveness. Key metrics such as feature richness, discriminative power, and

computational efficiency were considered to assess the overall performance of each

model in capturing relevant information from the input images.

Furthermore, we explored visualization techniques to gain insights into the extracted

features and their underlying representations. Visualization methods such as t-SNE (t-

distributed stochastic neighbor embedding) and PCA (principal component analysis)

were employed to visualize the high-dimensional feature representations in lower-

dimensional spaces, facilitating a deeper understanding of the feature extraction

process.

Through meticulous experimentation and analysis, we aimed to identify the pre-

trained CNN model that offered the optimal balance of feature richness,

computational efficiency, and effectiveness in capturing the distinctive visual

characteristics of medicinal plant images. The insights gained from this feature

extraction model phase laid the groundwork for subsequent stages of our project,

including classification.

105
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Figure 7.4: feature extraction model

106
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Figure 7.5 first image to predict

The results of the medicinal plant classification process are presented. This includes

showcasing the actual and predicted values obtained from the classification model.

The visualization provides insights into the model's performance and its ability to

accurately classify medicinal plant images.

Actual plant species serve as ground truth labels against which the model predictions

are evaluated, while predicted values correspond to the plant species inferred from the

input images.

A confusion matrix is included, offering a tabular representation of the actual and

predicted values organized by class labels. Additionally, various performance metrics

such as accuracy, precision, recall, F1-score, and classification report are computed to

assess the model's efficacy.

The visualization aids in visually analyzing the agreement between actual and

predicted values across different plant species, enabling stakeholders to evaluate the

107
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

model's accuracy and reliability in classifying medicinal plant images.

Figure 7.6 leave prediction with actual and predicted values.

108
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

CHAPTER 8
SOURCE CODE

109
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

8 SOURCE CODE
# Importing Libraries
import os
import matplotlib.pyplot as plt
import numpy as np
import PIL
import tensorflow as tf
import tensorflow_datasets as tfdf
from tensorflow import keras
from tensorflow.keras import layers, models
from tensorflow.keras.models import Sequential

# Define Constants
BATCH_SIZE = 32
img_height = 224
img_width = 224
CHANNEL = 3
data_dir = r"F:\Project\archive\Indian Medicinal Leaves Image Datasets\Medicinal
Leaf dataset"

# Load Dataset
dataset = tf.keras.utils.image_dataset_from_directory(
data_dir,
shuffle=True,
image_size=(img_height, img_width),
batch_size=BATCH_SIZE
)
class_names = dataset.class_names

# Train Test Split


def get_dataset_partitions_tf(ds, train_split=0.7, val_split=0.15, test_split=0.15,
shuffle=True, shuffle_size=10000):
assert (train_split + test_split + val_split) == 1

ds_size = len(ds)

if shuffle:
ds = ds.shuffle(shuffle_size, seed=12)

train_size = int(train_split * ds_size)


val_size = int(val_split * ds_size)

train_ds = ds.take(train_size)
val_ds = ds.skip(train_size).take(val_size)
test_ds = ds.skip(train_size).skip(val_size)

110
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

return train_ds, val_ds, test_ds

train_ds, val_ds, test_ds = get_dataset_partitions_tf(dataset)


train_ds = train_ds.cache().shuffle(1000).prefetch(buffer_size=tf.data.AUTOTUNE)
val_ds = val_ds.cache().shuffle(1000).prefetch(buffer_size=tf.data.AUTOTUNE)
test_ds = test_ds.cache().shuffle(1000).prefetch(buffer_size=tf.data.AUTOTUNE)

# Data Preprocessing
resize_and_rescale = tf.keras.Sequential([
layers.experimental.preprocessing.Resizing(img_height, img_height),
layers.experimental.preprocessing.Rescaling(1./255),])

data_augmentation = tf.keras.Sequential([
layers.experimental.preprocessing.RandomFlip("horizontal"),
layers.experimental.preprocessing.RandomRotation(0.2),
layers.experimental.preprocessing.RandomZoom(0.3),])

train_ds = train_ds.map(
lambda x, y: (data_augmentation(x, training=True), y)
).prefetch(buffer_size=tf.data.AUTOTUNE)

# Model Definition
feature_extractor = tf.keras.applications.VGG16(input_shape=(img_height,
img_height, 3),
include_top=False,
weights="imagenet")

for layer in feature_extractor.layers:


layer.trainable = False

model = keras.Sequential([
resize_and_rescale,
layers.BatchNormalization(),
feature_extractor,
layers.BatchNormalization(),
layers.Flatten(),
layers.Dense(256, activation='relu'),
layers.Dropout(0.2),
layers.Dense(80, activation='softmax')])

model.compile(
optimizer=tf.keras.optimizers.Adam(learning_rate=1e-4),

loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=False),
metrics=['accuracy'])

# Model Training
earlystopping = tf.keras.callbacks.EarlyStopping(monitor='val_accuracy',
111
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

mode='max', patience=7, verbose=1)


callback_list = [earlystopping]

model_history = model.fit(
train_ds,
validation_data=val_ds,
epochs=150,
callbacks=callback_list,
verbose=1
)

# Model Evaluation
model.evaluate(test_ds)

# Save Model
model.save("vgg16_extractor_1.keras")

# Plot Accuracy and Loss


acc = model_history.history['accuracy']
val_acc = model_history.history['val_accuracy']
loss = model_history.history['loss']
val_loss = model_history.history['val_loss']
epochs_range = range(48)

plt.figure(figsize=(8, 8))
plt.subplot(1, 2, 1)
plt.plot(epochs_range, acc, label='Training Accuracy')
plt.plot(epochs_range, val_acc, label='Validation Accuracy')
plt.legend(loc='lower right')
plt.title('Training and Validation Accuracy')

plt.subplot(1, 2, 2)
plt.plot(epochs_range, loss, label='Training Loss')
plt.plot(epochs_range, val_loss, label='Validation Loss')
plt.legend(loc='upper right')
plt.title('Training and Validation Loss')
plt.show()

112
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

CHAPTER 9
SYSTEM TESTING

113
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

9 TESTING
Testing is a critical phase in the development lifecycle of any software project,

ensuring that the system functions as intended and meets the specified requirements.

In the context of our medicinal plant classification project, testing encompasses

various aspects, including software functionality, algorithm accuracy, system

performance, error handling, and integration with other components.

9.1 Software Testing:

Software testing involves verifying the functionality, reliability, and accuracy of the

medicinal plant classification system. It encompasses several types of testing, each

targeting specific aspects of the system's behavior and performance.

 System Testing:

System testing involves testing the system as a whole to ensure that all

components function correctly when integrated. This includes various testing

phases such as module testing, integration testing, acceptance testing, and user

acceptance testing (UAT).

 Module Testing:

Module testing focuses on testing individual modules or components of the

system in isolation. This ensures that each module functions correctly and

produces the expected outputs when provided with appropriate inputs.

114
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Integration Testing:

Integration testing validates the interactions between different modules or

components of the system. It ensures that data is exchanged correctly between

modules and that the integrated system behaves as expected.

 Acceptance Testing:

Acceptance testing involves testing the system with end-users to ensure that it

meets their requirements and expectations. This includes verifying that the

system fulfills the original goals and objectives established during the analysis

phase

9.2 Test Cases:

Test cases play a crucial role in ensuring the effectiveness and reliability of the

medicinal plant classification system. These test cases encompass diverse scenarios

and conditions that thoroughly evaluate the system's functionality, performance, and

behavior across different aspects.

Input data validation test cases are designed to verify the system's ability to handle

various types of input data, ensuring that it can process different formats of leaf

images accurately. Algorithm testing test cases assess the performance and accuracy

of the classification algorithms employed by the system, validating their ability to

correctly identify and categorize medicinal plant species based on leaf characteristics

System performance evaluation test cases focus on assessing the scalability,

responsiveness, and resource utilization of the classification system. These tests

115
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

involve processing large volumes of leaf images to evaluate the system's performance

under varying workloads and conditions. Error handling test cases validate the

system's ability to detect and gracefully handle errors or anomalies that may occur

during the classification process. This includes scenarios such as corrupted image

files, incomplete data, or unexpected inputs.

Reporting and visualization test cases ensure that the system generates informative

and visually appealing reports and visualizations of the classified plant images. These

tests assess the accuracy, completeness, and clarity of the generated reports, providing

users with meaningful insights into the classification results.Integration and

compatibility test cases verify the seamless integration of the classification system

with other components or platforms, such as data storage systems, APIs, or

visualization tools. These tests ensure that the system can effectively communicate

and collaborate with external systems or services, enabling smooth interoperability

and compatibility.

 Input Data Validation Test Cases:

Input data validation test cases are designed to ensure that the system can

handle different types of input data effectively. This includes validating

various formats of image data, such as JPEG, PNG, or BMP, and verifying

that the system gracefully handles invalid or corrupted images.

 Machine Learning Algorithm Test Cases:

Machine learning algorithm test cases focus on evaluating the accuracy and

performance of the classification algorithms used in the system. This involves

116
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

testing the algorithms with diverse datasets, including images of different

plant species, variations in lighting conditions, and background clutter.

 System Performance Test Cases:

System performance test cases assess the scalability and responsiveness of the

medicinal plant classification system. These tests involve processing a large

volume of images to evaluate the system's response time, resource utilization,

and scalability under varying loads.

 Boundary and Error Handling Test Cases:

Boundary and error handling test cases validate the system's behavior when

encountering extreme or unexpected scenarios. This includes testing the

system's response to images with excessive noise, blurry or distorted images,

and errors in image metadata.

 Reporting and Visualization Test Cases:

Reporting and visualization test cases ensure that the system generates

informative and visually appealing reports and visualizations of the classified

plant images. This involves validating the accuracy and completeness of the

reports and verifying that they provide meaningful insights into the

classification results.

 Integration and Compatibility Test Cases:

Integration and compatibility test cases verify the seamless integration of the

medicinal plant classification system with other components, such as data

storage systems, APIs, or visualization tools. These tests ensure compatibility

117
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

with different operating systems, web browsers, and platforms on which the

system will be deployed.

Relative Test Cases:


 Upload Dataset

 Test Case Description: Verify if the dataset containing medicinal plant

images is successfully uploaded into the system.

 Test Steps:

 Click on the "Upload Dataset" button.

 Select the dataset file from the local directory.

 Confirm if the system displays a message indicating that the dataset has

been successfully loaded.

 Expected Result: The system should display a message confirming the

successful upload of the dataset.

 Actual Result: Dataset loading message is displayed upon successful

upload.

 Preprocessing

 Test Case Description: Ensure that preprocessing techniques are applied to

the dataset before model training.

 Test Steps: Check if preprocessing steps such as image resizing,

normalization, and augmentation are performed.

 Verify if the preprocessed dataset contains the necessary data for further

processing.

118
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Expected Result: The system should apply preprocessing techniques to

enhance the quality and suitability of the dataset for model training.

 Actual Result: Preprocessed dataset contains necessary data for further

processing.

 Model Prediction

 Test Case Description: Validate if the trained machine learning models

successfully predict the class labels of medicinal plant images.

 Test Steps: Input a sample image into the trained model for prediction.

 Verify if the model generates the predicted class label for the input image.

 Expected Result: The model should accurately predict the class label of the

input image.

 Actual Result: Model generates the predicted class label for the input image.

 Recommendation

 Test Case Description: Ensure that recommended actions or information

based on model predictions are displayed to the user.

 Test Steps: Check if the system displays recommendations related to the

predicted class label of the input image.

 Expected Result: The system should present relevant recommendations or

information based on the predicted class label.

 Actual Result: System displays recommendations related to the predicted

class label.

119
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Visualization

 Test Case Description: Validate if visualizations such as charts or graphs are

generated to represent classification results.

 Test Steps: Verify if the system generates visualizations depicting the

classification performance or distribution of medicinal plant classes.

 Expected Result: The system should produce informative visualizations

representing the classification results.

 Actual Result: Visualizations depicting classification performance are

generated.

In conclusion, the system testing phase of the medicinal plant leaves classification

project has been pivotal in ensuring the robustness, reliability, and accuracy of the

developed system. Through rigorous testing procedures and comprehensive

evaluation methodologies, we have validated the effectiveness of our classification

algorithms in accurately identifying and categorizing medicinal plant species based on

leaf images. The testing process encompassed various scenarios, including input data

validation, algorithm performance evaluation, and system scalability assessment,

allowing us to identify and address potential issues and limitations. Overall, the

successful completion of the system testing phase instills confidence in the reliability

and efficacy of our medicinal plant classification system, paving the way for its

deployment and utilization in real-world applications.

120
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

CHAPTER 10
CONCLUSION AND FUTURE SCOPE

121
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

10.1 CONCLUSION
In conclusion, the medicinal plant classification project has represented a significant

step forward in leveraging machine learning techniques for the accurate identification

and categorization of various plant species based on their images. Through meticulous

experimentation and model refinement, we have attained commendable performance

metrics across multiple evaluation criteria, including accuracy, precision, recall, and

F1-score. The implementation of transfer learning models, such as VGG16, VGG19,

and MobileNetV2, has proven instrumental in extracting meaningful features from

medicinal plant images, thereby empowering the models to make precise predictions

with high confidence.

Furthermore, the integration of visualization techniques has played a pivotal role in

facilitating the comprehensive analysis of model performance and classification

outcomes. These visualizations have provided invaluable insights into the strengths

and weaknesses of different machine learning models, enabling us to refine our

approach and optimize the classification system further. The successful deployment of

the trained models in a production environment underscores the practical utility of the

developed system, opening avenues for its potential utilization in diverse real-world

applications, including herbal medicine research, botanical conservation efforts, and

pharmaceutical industry endeavors.

MobileNetV2 obtained the best validation accuracy with fine-tuning with a validation

accuracy of 96.02%. MobileNetV2 also obtained the best testing accuracy with fine-

tuning of 81.82%. In other models, the testing accuracy obtained is far below

MobileNetV2. This condition is likely to happen because the dataset for training and
122
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

validation used is less diverse and general to build a good model, so the resulting

model overfits the dataset. In this case, MobileNetV2 with fine-tuning is quite able to

overcome the weaknesses of the dataset used so that when new testing data is given,

the accuracy results obtained are quite good. In addition, based on the experiment

results, fine-tuning the model can improve the accuracy of the validation and testing

produced. The limitation of this study is that it ignores the background problem of the

leaf image. Further research will be carried out using a dataset with a complex

background by adding a segmentation method before being processed by the

MobileNetV2 model.

10.2 FUTURE SCOPE


While the current project has achieved its primary objectives, there remains ample

room for future exploration and enhancement:

 Dataset Expansion and Diversity: Expand the dataset to encompass a

broader spectrum of medicinal plant species, encompassing variations in

growth stages, geographical regions, and ecological niches. A more diverse

dataset would enhance the models' ability to generalize to unseen plant

samples and improve classification accuracy across different botanical

families.

 Advanced Model Architectures: Investigate the adoption of cutting-edge

deep learning architectures, such as transformers and graph neural networks,

to capture intricate spatial relationships and semantic features inherent in

123
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

medicinal plant images. Exploring novel model architectures tailored to the

unique characteristics of botanical imagery could unlock new avenues for

performance improvement.

 Domain-Specific Data Augmentation: Develop domain-specific data

augmentation strategies tailored to the idiosyncrasies of medicinal plant

images, including variations in leaf morphology, lighting conditions, and

background clutter. Augmenting the dataset with synthetically generated

images using techniques like Generative Adversarial Networks (GANs) could

help alleviate data scarcity issues and enhance model robustness.

 Active Learning and Annotation Strategies: Implement active learning

algorithms to intelligently select informative samples for annotation,

optimizing the annotation process and maximizing the utility of labeled data.

Leveraging human-in-the-loop annotation frameworks and crowdsourcing

platforms could streamline the data labeling pipeline and accelerate model

training iterations.

 Mobile Application Deployment: Explore the deployment of the

classification system in mobile applications, enabling users to identify

medicinal plants on-the-go using smartphone cameras. Developing an intuitive

mobile interface with image capture functionality could democratize access to

plant identification tools and foster greater engagement among researchers,

educators, and citizen scientists.

124
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

 Cross-Disciplinary Collaboration: Foster interdisciplinary collaborations

with botanists, ethnobotanists, and traditional medicine practitioners to

validate the accuracy of the classification system and enrich the model's

understanding of botanical taxonomy and medicinal properties. Integrating

domain expertise into the model development process can enhance the

interpretability of model predictions and ensure alignment with real-world

botanical knowledge.

125
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

126
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

REFERENCES

127
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

[1] X.-F. Wang, D.-S. Huang, J.-X. Du, H. Xu, and L. Heutte, “Classification of
plant leaf images with complicated background,” Appl. Math. Comput., vol. 205, no.
2, pp. 916–926, Nov. 2008.

[2] K. Yang, W. Zhong, and F. Li, “Leaf Segmentation and Classification with a
Complicated Background Using Deep Learning,” Agronomy, vol. 10, no. 11, p. 1721,
Nov. 2020.

[3] I. Ranggadara, Y. S. Sari, S. Dwiasnati, and I. Prihandi, “A Review of


Implementation and Obstacles in Predictive Machine Learning Model at Educational
Institutions,” in Journal of Physics: Conference Series, 2020, vol. 1477, p. 32019.

[4] Y. Jumaryadi, D. Firdaus, B. Priambodo, and Z. P. Putra, “Determining the Best


Graduation Using Fuzzy AHP,” in 2020 2nd International Conference on Broadband
Communications, Wireless Sensors and Powering (BCWSP), 2020, pp. 59–63.

[5] E. M. Jawad, H. G. Daway, and H. J. Mohamad, “Quantum-dot Cellular


Automata Based Lossless CFA Image Compression Using Improved and Extended
Golomb-rice Entropy Coder,” Int. J. Intell. Eng. Syst., vol. 15, no. 2, pp. 12–25, Apr.
2022.

[6] V. Ayumi, “Pose-based human action recognition with Extreme Gradient


Boosting,” in 2016 IEEE Student Conference on Research and Development
(SCOReD), 2016, pp. 1–5.

[7] V. Ayumi, “Mobile Application for Monitoring of Addition of Drugs to Infusion


Fluids,” Int. J. Sci. Res. Comput. Sci. Eng. Inf. Technol., pp. 48– 56, Nov. 2019.

[8] V. Ayumi, “Pose-based human action recognition with Extreme Gradient


Boosting,” in Proceedings - 14th IEEE Student Conference on Research and
Development: Advancing Technology for Humanity, SCOReD, 2017. [9] V. Ayumi,
“Application of Machine Learning for SARS-CoV-2 Outbreak,” Int. J. Sci. Res. Sci.

128
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

Eng. Technol., vol. 7, no. 5, pp. 241–248, Oct. 2021.

129
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

[10] V. Ayumi, “Performance Evaluation of Support Vector Machine Algorithm for


Human Gesture Recognition,” Int. J. Sci. Res. Eng. Technol., vol. 7, no. 6, pp. 2020.

[11] J. Arun Pandian, G. Geetharamani, and B. Annette, “Data Augmentation on


Plant Leaf Disease Image Dataset Using Image Manipulation and Deep Learning
Techniques,” in 2019 IEEE 9th International Conference on Advanced Computing
(IACC), 2019, pp. 199–204.

[12] J. S. Cope, D. Corney, J. Y. Clark, P. Remagnino, and P. Wilkin, “Plant species


identification using digital morphometrics: A review,” Expert Syst. Appl., vol. 39, no.
8, pp. 7562–7573, Jun. 2012.

[13] Y. A. Putri, E. C. Djamal, and R. Ilyas, “Identification of Medicinal Plant


Leaves Using Convolutional Neural Network,” J. Phys. Conf. Ser., vol. 1845, no. 1, p.
012026, Mar. 2021.

[14] M. A. F. Azlah, L. S. Chua, F. R. Rahmad, F. I. Abdullah, and S. R. Wan


Alwi, “Review on Techniques for Plant Leaf Classification and Recognition,”
Computers, vol. 8, no. 4, p. 77, Oct. 2019.

[15] F. Ghouse, K. Paranjothi, and R. Vaithiyanathan, “Dysgraphia Classification


based on the Non-Discrimination Regularization in Rotational Region Convolutional
Neural Network,” Int. J. Intell. Eng. Syst., vol. 15, no. 1, Feb. 2022.

[16] J. Lu, L. Tan, and H. Jiang, “Review on Convolutional Neural Network (CNN)
Applied to Plant Leaf Disease Classification,” Agriculture, vol. 11, no. 8, p. 707, Jul.
2021.

[17] E. Korot et al., “Code-free deep learning for multi-modality medical image
classification,” Nat. Mach. Intell., vol. 3, no. 4, pp. 288–298, Apr. 2021.

[18] V. Ayumi, E. Ermatita, A. Abdiansah, H. Noprisson, M. Purba, and M. Utami,


“A Study on Medicinal Plant Leaf Recognition Using Artificial Intelligence,” in 2021
International Conference on Informatics, Multimedia, Cyber and Information System
(ICIMCIS, 2021, pp. 40–45.
130
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

[19] E. Hidayat, Lukman, H. Noprisson, D. I. Sensuse, Y. G. Sucahyo, and E. D. Putra,

“Development of mobile application for documenting traditional knowledge in

Indonesia: A Case Study of Traditional Knowledge in Using Medicinal Plant,” in

Proceedings - 14th IEEE Student Conference on Research and Development:

Advancing Technology for Humanity, SCOReD 2016, 2017.

[20] H. Noprisson, D. I. Sensuse, Y. G. Sucahyo, and Lukman, “Metadata


Development for Ethnophytomedicine Resources Using Metadata Analysis
Approach,” in The 2016 8th International Conference on Information Technology and
Electrical Engineering (ICITEE 2016), 2016.

[21] D. I. Sensuse, H. Noprisson, Y. G. Sucahyo, and L. Lukman, “Metadata


Schema for Traditional Knowledge,” Int. J. Adv. Sci. Eng. Inf. Technol., vol. 7, no. 6,
2017.

[22] Y. G. Naresh and H. S. Nagendraswamy, “A novel fuzzy LBP based symbolic


representation technique for classification of medicinal plants,” in 2015 3rd IAPR
Asian Conference on Pattern Recognition (ACPR), 2015, pp. 524–528.

[23] G. Mukherjee, A. Chatterjee, and B. Tudu, “Study on the potential of combined


GLCM features towards medicinal plant classification,” in 2016 2nd International
Conference on Control, Instrumentation, Energy & Communication (CIEC), 2016, pp.
98–102.

[24] D. Venkataraman and N. Mangayarkarasi, “Support vector machine based


classification of medicinal plants using leaf features,” in 2017 International
Conference on Advances in Computing, Communications and Informatics (ICACCI),
2017, pp. 793–798.

[25] L. Gao and X. Lin, “A method for accurately segmenting images of medicinal
plant leaves with complex backgrounds,” Comput. Electron. Agric., vol. 155, pp.
426–445, 2018.

131
Classification Of Indian Medicinal Leaves Using Transfer Learning Based Convolutional Neural
Networks

[26] C. Sivaranjani, L. Kalinathan, R. Amutha, R. S. Kathavarayan, and K. J.


Jegadish Kumar, “Real-Time Identification of Medicinal Plants using Machine
Learning Techniques,” in 2019 International Conference on Computational
Intelligence in Data Science (ICCIDS), 2019, pp. 1–4.

[27] D. Pechebovicz et al., “Plants recognition using embedded Convolutional Neural


Networks on Mobile devices,” in 2020 IEEE International Conference on Industrial
Technology (ICIT), 2020, pp. 674–679.

[28] M. R. Bhuiyan, M. Abdullahil-Oaphy, R. S. Khanam, and M. S. Islam,


“MediNET: A Deep Learning Approach to Recognize Bangladeshi Ordinary
Medicinal Plants Using CNN,” in Soft Computing Techniques and Applications,
Springer, 2021, pp. 371–380.

[29] S. Bhattacharya, A. Mukherjee, and S. Phadikar, “A deep learning approach for


the classification of rice leaf diseases,” in Intelligence enabled research, Springer,
2020, pp. 61–69.

[30] S. Roopashree and J. Anitha, “Medicinal leaf dataset,” Mendeley Data, vol. 1,
2020.

132

You might also like