Developing A Neural Network-Based Model for Identifying Medicinal Plant Leaves Using Image Recognition Techniques

Herbal plants contribute an important role in people's health and the environment, as they can provide both medical benefits and oxygen. Many herbal plants contain valuable therapeutic elements that can be passed down to future generations. Traditional methods of identifying plant species, such as manual measurement and examination of characteristics, are labor-intensive and time-consuming. To address this, there has been a push to develop more efficient methods using technology, such as digital image processing and pattern recognition techniques. The exact recognition of plants uses methodologies like computer vision and neural networks, which have been proposed earlier. This approach involves neural network models such as CNN, ALexnet, and ResNet for identifying the medical plants based on their respective features. Classification metrics give the 96.82 average accuracies. These results have been promising, and further research will involve using a larger dataset and going more into deep-learning neural networks to improve the accuracy of medicinal plant identification. It is hoped that a web or mobile-based system for automatic plant identification can help increase knowledge about medicinal plants, improve techniques for species recognition, and participate in the preservation of species that are considered ad endangered.


Introduction
There is a desire for an automated plant identification system that can assist users without specialized knowledge or training in botany and plant taxonomy to identify medicinal plants by taking pictures of the plants and inputting them into the system.Many traditional societies around the world have used the natural resources in their environment for medicinal purposes.Herbal remedies have been used since ancient times to maintain health and alleviate diseases.
From Vedic India, we can draw conclusions that our Veda describes a lot about medicinal plants, as Rigveda describes the use of around 67 herbal plants, and Yajurveda and Atharveda mention 81 and 289 herbal plants.The Sushruta and Charaka Samhita also holds a portion on the theuropatic use of around 500 medicinal plants.Nowadays, people from around the globe are switching to traditional medicines because of their low cost and fewer side effects.Conventional medicines are not necessarily based on plants but on some animal products.There has been an increase in medicoethnobotanical research at the national and international levels in recent years.There is a significant lack of knowledge and scientific validation of ethnomedicine in India.
India is known for its abundance of medicinal plants, with many of them being collected for use in the production of drugs and perfumes.Roughly 8,000 herbal treatments are marshaled in the Ayush system in India, i.e., Ayurveda, Unani, Siddha, and folk medicines, out of which Unani and Ayurveda are the most widely practiced in India.
The WHO roughly calculates that around 80% of the global population depends on herbal medicines for their preliminary wellness requisites, under which 21000 herbal plant breeds have the capability to be used as Medicinal plants.In India, various plants such as neem, tulsi, aloe, turmeric, and ginger are widely used to treat a number of ailments and are frequently used as home remedies.The warm, humid climate in India supports the growth of many species of flora, including 12,500 species (Leng et al. 1992 [1]) of seed plants of plants that bear seeds, with more than 740 being indigenous.In peninsular India, there are 2013 recorded herbal plants, with an additional 68 species recently discovered in Gunung Ledang, Johor (Milow et al. 2017 [2], Onrizal et al. 2019 [3]).However, the study of herbal plants in India tends to focus on their utilization and treatment due to their mercantile value, is sluggish and seeks comprehensive understanding and cautious inspection of plant phenotypes.There are several methods for plant identification, including examining characteristics such as colors, flowers, leaves, and textures, but these can be complex due to the large number of plant species and similarities between plants at the brood level.It also seeks a botanist who can recognize the exact species that can be sluggish due to its morphological use of plants as identification keys (Chouhan et al. 2018 [4], Simpson et al. 2019 [5]).An ecologist typically inspects one or more attributes of a plant, such as the shape of the leaf, before focusing on distinct features to determine the species.This process often involves asking a series of questions before the species can be confirmed.Leaves play a crucial role in the recognition of plants because every plant has them, and based on shape, veins, and blades, they can be easily identified.The initial input in plant identification is the leaves, as it is present on every plant, and they can be easily identified based on their distinct features such as blades, veins, and shape.Nevertheless, there are examples where plants share similarities, particularly at the family level, which can make identification formidable even for experienced ecologists.This highlights the need for more well-organized plant recognition methodologies, which can be used in the identification of plants, preservation planning, and treatment of disorders.
Deep learning models, such as convolutional neural networks (CNNs) (Ibrahim et al. 2018[6]), can be helpful in plant identification because they extract hierarchical representations of input data and extract features such as patch size on different -different branches (Ibrahim et al. 2018 [6], Du et al. 2017 [7], Hu et al. 2018 [8]).Unlike traditional methods, CNN significantly reduces the time that identification of plants requires, and thus it can be magnified to a greater extent through the use of graphical user interfaces that give supplementary information about the identified plants.An attempt to model the human visual system as closely as possible is achieved by applying concepts, ideas, and techniques such as computer graphics, artificial intelligence, pattern matching, and digital image processing.Image recognition is a fundamental task in computer vision.While human vision is superior in detecting, identifying, and discriminating objects, computer vision aims to approximate this capability.When you identify a plant based on a specimen that has been previously collected, you are determining the identity of the plant.When you classify a plant, you categorize it based on characteristics that are similar to those of other plants.
Medicinal plants are necessary to balance human lives and nature as they are the major source of medicine.Hence, the identification of medicinal plants is very important since they are a core part of life on Earth and allow human species and other organisms to survive by producing food and oxygen.A modern plant identification system can be brought into play to quickly characterize medicinal plant species without seeking specialist advice, streamlining the process.Hence, it is very important to classify and study plants correctly in order to protect and use those plant species.Recognizing unspecified plants often depends on the intrinsic knowledge and skills of specialist botanists using traditional manual-based methods based on morphological characteristics.

Materials And Methods
When plants get infected with diseases, abrasion occur in their leaves, stems, flowers, or fruits.These visible patterns are usually distinct and specific to the particular disease or pest condition, making them useful for accurate diagnosis.Extension officers are trained to diagnose plant diseases and pests based on visible symptoms.However, manual diagnosis can be subjective and time-consuming, and there may be a shortage of trained personnel in certain areas.As a result, there is a need for efficient and accurate automated methods for the diagnosis of plant diseases and pests.In addressing this issue, many researchers have used techniques like image processing, pattern recognition, and machine learning.These techniques can be used to draw out features from images of infected plants and classify the disease or pest based on these features.Training extension officers can be costly and time-consuming (Amlekar et al 2018 [9]).Non-native diseases and pests may be difficult for farmers and extension officers to identify accurately (Johannes et al 2017 [10], Anand et al. 2016 [11]).Distinguishing anomalies with similar visual characteristics often demands a high level of expertise (Islam et al. 2017 [12], Cruz et al. 2017 [13], Anand R et al. 2016 [11], Padol et al. 2016 [14]), and even highly trained experts may make mistakes due to fatigue, poor lighting, or poor vision.In addition, individual experts often specialize in only a few types of disorders (Cruz et al. 2017 [13], Lu J et al. 2017 [15]).Early disease detection and disease prevention require continuous monitoring, but performing it on an ongoing basis can be tedious, time-consuming, costly, and inefficient.(Islam et al 2017 [12], Cruz et al 2017 [13], Fujita et al 2016 [16], Padol et al 2016 [14], Chouhan et al 2018 [4]).Lab tests can become costly because of the expense of lab equipment and involve destructiveness, as they require collecting plant samples from the field and transporting them to the lab for analysis.There could also be quarantine restrictions on the transportation of samples to the lab (Fujita et al. 2016 [16]).
Begue and colleagues conducted a study in 2017 [17] in which they analyzed the characteristics of multiple leaves from a dataset containing 24 plant species, each with 30 images.They extracted various features, including the number of vertices, length, width, perimeter, area of the hull, and color.The study revealed that they achieved the highest accuracy, 90.1%, by using a random forest classifier.The plant species under investigation in the study originated from the tropical island of Mauritius.
Dissanayake and Kumara, along with their colleagues in 2021, conducted a study comparing the effectiveness of various machine learning algorithms in analyzing herbal, fruit, and vegetable plants based on their leaves.They utilized 3,150 photos of leaves from 25 types of plants and reduced image noise by converting color photos to grayscale and applying a Gaussian filter.The study focused on collecting 17 features in three categories: shape, texture, and color.Several algorithms, including SVM, k-nearest neighbors, multilayer perceptron, random forest, and decision tree, were assessed for classification accuracy, resulting in accuracy rates of 85.82%, 75.45%, 82.88%, 80.85%, and 64.39%, respectively.
In a separate study by Naeem and colleagues in 2021, a machine learning-based medical plant leaf classification was developed using multispectral and texture datasets.They employed six varieties of medicinal plant leaves and used a chi-square feature selection strategy to choose 14 features from a total of 65.To determine the most effective machine learning classifier, they tested five different algorithms, including multilayer perceptron, random forest, logit-boost, basic logistic, and bagging.Among these, the multilayer perceptron classifier achieved the highest accuracy, reaching 99.01%.
In their 2021 study, Chung et al. [20] developed a dual-path CNN model with two separate subnetworks.The subnetworks received input from either the original image or a centrally cropped image.When tested on a dataset consisting of 14 different species of trees commonly found in Taiwan, the model they introduced achieved an accuracy rate of 77.1%."Ahmed and his co-authors in 2016 [24] introduced an algorithm designed to extract approximately 15 shape-related attributes while incorporating feature normalization and dimensionality reduction techniques.For classification, they harnessed the capabilities of a Support Vector Machine (SVM).This method demonstrated its effectiveness by achieving an impressive aggregate accuracy of 87.40% when assessed using the Flavia dataset.
In 2019, Xue and colleagues [21] explored different approaches for identifying 20 distinct Chinese medicinal plant species based on leaf characteristics.They found that an Artificial Neural Network (ANN) model, which used morpho-colorimetric parameters as input, outperformed a visible (VIS)/Near Infrared (NIR) spectral analysis.The ANN model achieved an accuracy of 98.3%, while the spectral analysis achieved an accuracy of 92.5% In a study by Kaur and Kaur in 2019 [22], The Swedish Leaf dataset underwent Gaussian filtering as a preprocessing step.The study then extracted texture and color features, which were classified using a multiclass SVM.The research found that this approach resulted in an accuracy of almost 93.26%.
In 2018 [4], Chouhan and colleagues suggested utilizing Local Binary Patterns and Support Vector Machines (LBP-SVM) for the Swedish Leaf dataset and conducted a comparison with K-Nearest Neighbors (K-NN) and Binarized Neural Network (BNN) classifiers.The LBP-SVM model achieved a higher accuracy of 84%, outperforming the existing BNN and KNN models, which achieved 77% and 75% accuracy, respectively.ANNs with backpropagation were proposed by Aakif et al. 2015 [23].
Their ANN classified their dataset with an accuracy of 96% based on a vector of morphological characteristics, Fourier descriptors (FD).Furthermore, they achieved 96% accuracy for both Flavia and ICL datasets after testing their efficiency.
In 2017, a novel system was introduced by Begue and his research team [17].It was based on their exclusive dataset of leaf images encompassing 24 distinct medicinal plant species.Shape-based attributes were extracted from each image, and a diverse array of classification algorithms, including k-NN, naive Bayes, SVM, neural network, and random forest, were deployed.Impressively, the highest accuracy was achieved by the random forest classifier, with a remarkable precision of 90.1%.
In 2018, an innovative approach for automated shape feature extraction and classification was pioneered by Amlekar and his colleagues [9].Their method utilized a feedforward backpropagation neural network.This approach was rigorously tested on the ICL dataset, resulting in outstanding results with accuracies of 99% for training images and 96% for testing images.

Dataset Collection:
Research in the field of object recognition requires appropriate datasets at all stages, from the training phase to assessing the effectiveness of recognition algorithms.For this research, images were collected from the Internet by searching for the names of specific medicinal plants in various languages, such as Latin, English, German, Serbian, and Hungarian.The images were grouped into 30 different classes, many medicinal plants from various countries were included.[28]   The analysis and visualization of images using computers are encompassed by neural networks.Two primary neural network technologies, namely self-organizing maps and multilayer perceptrons (MLPs), can be employed for plant detection.The operation of neurons in the human brain inspires a system of hardware and/or software known as a neural network.It is also referred to as an artificial neural network.Self-organizing maps (SOMs) represent a category of neural network that is applicable for unsupervised learning, signifying their capacity to apprehend patterns in data without the requirement for labeled training examples.For tasks like data clustering and anomaly detection, SOMs find utility in visualizing high-dimensional data within a low-dimensional space.Multilayer perceptrons (MLPs) constitute a type of neural network comprising numerous layers of artificial neurons, with each layer receiving input from the preceding one and transmitting it to the subsequent layer.MLPs are commonly utilized in supervised learning tasks, including classification and regression, and have demonstrated effectiveness across various applications.

Deep Learning
The use of the term "deep learning (DL)" involves the utilization of multiple tiers of artificial neural networks (ANNs) to represent high-level generalizations rooted in intricate data structures.Varied interpretations of the input data are furnished by these tiers.DL algorithms, drawing inspiration from the information processing of the human brain, make use of substantial datasets to create relationships between inputs and distinct labels.Deep learning architectures encompass various components, including convolutional layers, hidden belief layers, deep neural layers, and recurrent neural layers.These techniques have yielded remarkable outcomes across a range of domains, including digital audio, audio recognition, visual video recognition, computer vision, digital images, natural language processing (NLP), and automatic speech recognition, among others.
In contrast to conventional machine learning, which usually entails distinct stages such as preprocessing, feature retrieval, feature choice, and categorization, deep learning smoothly incorporates feature retrieval and categorization.This characteristic renders it a versatile and scalable learning approach with robust generalization capabilities.However, deep learning necessitates abundant data, complex models, and substantial computational resources, which can be costly.Furthermore, it requires effective strategies to address overfitting, a common challenge when dealing with models le o b ila Ava -1949 -with numerous parameters.Overfitting occurs when the trained model struggles to generalize to unseen test data.
Regularization techniques serve to mitigate overfitting by enhancing the model's adaptability to unknown data, particularly when working with limited training datasets or imperfect optimization methods.Various regularization methods can be applied, including batch normalization, weight decay, data augmentation, Drop Connect, dropout, stochastic pooling, early stopping, as well as ℓ1 and ℓ2 regularization.Deep neural networks have proven highly effective in contemporary machine learning model training.

Convolution Neural Networks
One of the types of deep neural networks that is employed for the identification and classification of specific features in images through convolutional neural networks (CNNs) has been utilized.Their application involves the recognition of images and videos, their classification, the analysis of medical images, and the processing of natural languages.Due to their high level of accuracy, the utilization of CNNs for the recognition of images has been observed across various fields, including medical imaging, smartphones, security systems, and recommendation systems.The term "convolution" in CNN pertains to the convolution function, which denotes a linear operation where two functions are multiplied to generate a third function representing the alteration in the shape of one function by the other.The extraction of features from an image is achieved through the multiplication of two matrixrepresented images.It is beyond question that CNNs exhibit superior performance in pattern classification and image processing when compared to traditional methods.
A CNN is a form of supervised feedforward artificial neural network with the availability of unsupervised and recurrent variants.These neural networks consist of multiple layers, encompassing convolutional, pooling, and fully connected (FC) layers, each of which incorporates nonlinear activation functions analogous to the visual cortex in the human eye.A multitude of CNN architectures and deep learning algorithms originally designed for the ImagesNet Large Scale Visual Recognition Challenge (ILSVRC) have been applied to address this challenge.These encompass DenseNet, Xception, ResNet, AlexNet, and VGG.Remarkable performance has been achieved by these networks in recent years.
CNNs are an integral component of neural networks, and they are used for the detection of objects and the recognition of faces through image recognition and classification.The neurons within a CNN are adaptable, allowing them to learn their weights and biases.These neurons receive multiple inputs, calculate their weighted sums, and subsequently activate to produce outputs.The principal functions of CNNs include image classification, clustering based on similarity, and object recognition.Additionally, CNNs have applications in a variety of other algorithms, including the identification of individuals, street signs, and animals.

ResNet:
The innovation of Residual Neural Network (ResNet) revolutionized the creation of Convolutional Neural Networks (CNNs) in 2015.It established a new belief that deeper layers learn new features from preceding layers by copying their connections to the input of the next layer without affecting the feature and identity extraction from the last layer.Despite having 152 layers, ResNet is less computationally complex than AlexNet and VGG, despite having 20 times more layers.The error rate of ResNet is lower than that of humans after training and implementing on the ImageNet dataset [27].

Alexnet:
A significant milestone was marked by AlexNet when it was introduced as the inaugural deep convolutional neural network (CNN) widely adopted in image classification tasks.Its public debut occurred during the 2012 ImageNet Large Scale Visual Recognition Challenge (ILSVRC), where the prowess of deep CNNs in image classification was demonstrated.Comprising five convolutional layers and three fully connected layers, AlexNet is noted for the introduction of innovations like the technique of Local Response Normalization (LRN), the ReLU activation function, and the utilization of dropouts as a method of regularization.
The architecture of AlexNet is characterized by five convolutional layers, one pooling layer, a ReLU activation function, and three fully connected layers, making it more intricate than the earlier LeNet.RGB images with dimensions of 256x256 pixels are required by AlexNet.Consequently, if the input images do not initially adhere to these dimensions, resizing is necessary for both training and test images [27].

Results and Discussion
This study is performed on 30 distinct species of medicinal plants with a diverse range of leaf textures, shapes, and sizes.Performance metrics allow us to determine which neural network model is most effective on this dataset.In the context of medicinal plant leaf detection, the examination of a classifier's capabilities in identifying leaves in images can be facilitated through the utilization of a confusion matrix.Within this matrix, one can observe the instances in which the presence of a leaf was correctly predicted by the classifier (referred to as True Positives, TP), as well as the instances in which the classifier erroneously predicted the presence of a leaf when it was not present (referred to as False Positives, FP), along with the instances in which the classifier failed to predict the presence of a leaf when it was indeed present (termed as False Negatives, FN), and lastly, the occurrences in which the classifier accurately anticipated the absence of a leaf (denoted as True Negatives, TN).
The comprehensive assessment of classifier performance can be derived from the F1 score, which combines precision and recall.Precision evaluates the accuracy of positive predictions (calculated as True Positives divided by False Positives), while recall measures the correct identification of true positives (determined as True Positives divided by the sum of True Positives and False Negatives).The precision is calculated as 0.8, which is derived from the formula 200 / (200 + 50).The recall is determined to be 1.0, computed using the formula 200 / (200 + 0).The F1 score is found to be 0.89, and it is obtained by applying the formula 2 * (0.8 * 1.0) / (0.8 + 1.0).This F1 score indicates that good stability is exhibited by the classifier across precision and recall, with a high recall (100% of leaves were detected) and a relatively high precision (80% of positive predictions were correct).
In the context of leaf detection, several significant metrics are utilized to evaluate the performance of the machine learning model, including loss function, validation loss, validation accuracy, and accuracy [28].
In the context of leaf detection, a loss function serves as a metric to quantify the dissimilarity between the model's predicted outputs and the ground truth values.In this specific scenario, the loss function may take the form of mean squared error (MSE) when assessing the disparities between predicted and actual bounding boxes for the leaves.The overarching objective is to minimize this loss, signifying an enhancement in the model's capability to accurately detect leaves.
Validation loss is calculated on a validation set, which is a subset of the training data.It measures the average loss over the validation set and helps to analyze if the model is overfitting or underfitting the training data.
The percentage of real predictions conducted by the model on the validation set is referred to as validation accuracy.It facilitates the evaluation of the model's performance on unseen data and serves as a measure to guard against overfitting.
The proportion of actual predictions produced by the model on a distinct test set, separate from the training and validation sets, is known as accuracy.This metric is widely employed to assess the general effectiveness of the model in leaf detection.
By keeping a vigilant eye on these indicators, insights into the model's capabilities and shortcomings can be gained, allowing for essential enhancements to be made to enhance leaf detection performance [28][29][30][31][32].The performance of all the models is depicted in Table 2 with respect to F1 score, Precision, and Recall.
In the context of medicinal plant leaf detection, the F1 score with respect to macro, micro, and weighted is a generally used metric to analyze the performance of these Neural Network models.
A critical function is performed by the loss function in measuring the difference between the model's predicted outputs and the actual values.In the realm of identifying medicinal plant leaves, this particular loss function could assume the guise of mean squared error (MSE) when assessing the variances between the predicted and real bounding boxes for the leaves.The ultimate aim is to minimize this loss, underscoring the model's continual improvement in its leaf detection performance.

Analysis:
The training and testing accuracy results have been visually represented in graphical form as depicted in the figures.In the graphs of Accuracy and Epochs we can also observe that the testing accuracy and training accuracy is increasing as the number of epochs increases.In case of a greater number of epochs these two accuracy values are approximately comparable [28].
In the graphs of Loss Function and Epochs, we can observe that the number of epochs increases as the loss function gradually decreases.

Figure 1 .
Figure 1.Plant Species for training and testing data

Figure 2 :
Figure 2: CNN Architecture Developing A Neural Network-Based Model for Identifying Medicinal Plant Leaves Using Image Recognition TechniquesAvailable online at: https://jazindia.com-1950 -

Figure 3
Figure 3 displays all the leaves of the plants included in the dataset.

Figure 3 .
Figure 3.The same sample from the collected medicinal plant dataset.
For example, if the classifier correctly identified 200 leaves out of 250 in the test dataset and also correctly identified 1000 non-leaf instances out of 1200, the confusion matrix would look like:

Figure 4 .
Figure 4. Confusion matrix for Neural Network models (a) Seven-layer CNN (b) Five layer CNN (c) AlexNet (d) ResNet metrics, one can understand that the CNN 5 layer is more reliable than others.

Figure 6 .
Figure 6.Performance Loss Function bar chart.

Figure 8 .Figure 9 .Figure 10 .Figure 11 .
Figure 8.The accuracy and loss of the 7-layer CNN model during training and validation in relation to epochs were depicted.CNN 5 layer:

Table 1 :
Comparison of different classification methods using CNN architecture

Loss Val Accuracy Image Size Epochs Batch Size
, suggesting that it struggled to fit the training data."AlexNet" falls in between, with an accuracy of 92.87% and a training loss of 0.245.The choice of model architecture significantly impacts the results, with the "CNN 5 layer" model being the most effective for this task.All models were trained with a consistent image size of 256x256, 100 epochs, and a batch size of 32.

Table 2 .
Comparison of different classification methods using CNN architecture on various performance metrics