Journal of Ayurveda and Integrated Medical Sciences

2025 Volume 10 Number 1 JANUARY
Publisherwww.maharshicharaka.in

Identification of Dry Ayurvedic Herbs (Roots and Stems) Through Ai/Computer Vision Technology

Bains R1*, Arora R2, Kumar S3, Gupta R4
DOI:10.21760/jaims.10.1.12

1* Renuka Bains, Post Graduate Scholar, Dept of Dravyaguna Vigyan, Institute for Ayurveda Studies and Research, Kurukshetra, Haryana, India.

2 Ravinder Arora, Associate Professor, Dept of Dravyaguna Vigyan, Institute for Ayurveda Studies and Research, Kurukshetra, Haryana, India.

3 Satyender Kumar, Assistant Professor, Dept of Dravyaguna Vigyan, Institute for Ayurveda Studies and Research, Kurukshetra, Haryana, India.

4 Rahul Gupta, Assistant Professor, Department of Electronics and Communication Engineering, University Institute of Engineering and Technology and Kurukshetra University, Haryana, Haryana India.

This study presents a novel AI-based approach for the identification and quality control of dry Ayurvedic herbs using Convolutional Neural Networks (CNNs). The model was developed to identify 43 types of dry Ayurvedic herbs, comprising 14 stems and 29 roots, based on visual features such as texture, colour, and shape. A dataset of 4,300 high-resolution images was curated using smartphones, and preprocessing techniques like normalization and augmentation were applied to enhance model robustness. The CNN model, with four convolutional layers (32 to 256 filters) and dropout layers, was designed to efficiently extract hierarchical features while preventing overfitting. The model achieved high training accuracy (94%) but encountered challenges in validation accuracy (85%), indicating difficulties in generalization. A confusion matrix revealed strong performance for distinct herb species but highlighted misclassifications among visually similar herbs. This study demonstrates the potential of AI and computer vision technologies to automate herb identification and quality control, reducing human dependency and errors. The system is deployable on mobile devices or servers, offering practical applications in the pharmaceutical and Ayurvedic industries, with significant benefits for consumer confidence and the authenticity of herbal products. Future work will focus on expanding the dataset, refining preprocessing methods, and utilizing enhanced computational resources, such as GPUs and cloud computing, to improve model scalability, efficiency, and generalization.

Keywords: Ayurvedic herbs, Convolutional Neural Networks, Image recognition, Dataset, Validation accuracy, Dry herb identification, AI, Machine learning

Corresponding Author How to Cite this Article To Browse
Renuka Bains, Post Graduate Scholar, Dept of Dravyaguna Vigyan, Institute for Ayurveda Studies and Research, Kurukshetra, Haryana, India.
Email:
Bains R, Arora R, Kumar S, Gupta R, Identification of Dry Ayurvedic Herbs (Roots and Stems) Through Ai/Computer Vision Technology. J Ayu Int Med Sci. 2025;10(1):95-105.
Available From
https://jaims.in/jaims/article/view/3937/

Manuscript Received Review Round 1 Review Round 2 Review Round 3 Accepted
2024-12-06 2024-12-16 2025-01-27 2025-01-07 2024-12-22
Conflict of Interest Funding Ethical Approval Plagiarism X-checker Note
None Nil Yes 11.96

© 2025by Bains R, Arora R, Kumar S, Gupta Rand Published by Maharshi Charaka Ayurveda Organization. This is an Open Access article licensed under a Creative Commons Attribution 4.0 International License https://creativecommons.org/licenses/by/4.0/ unported [CC BY 4.0].

Download PDFBack To ArticleIntroductionMaterials and MethodsResultsDiscussionConclusionReferences

Introduction

Medicinal plants are integral to Ayurveda, India’s ancient system of medicine, but misidentification and adulteration of herbs remain significant challenges in both local and global markets. Visually similar yet therapeutically distinct species are often mislabelled, compromising efficacy and safety.

Examples include Polyalthia longifolia being sold as Saraca asoca while Carica papaya seeds may be misleadingly marketed as Piper longum. The issue extends to internationally traded products as well. A recent data from FSSAI[1] India shows that Cinnamomum cassia, distinct from true Cinnamomum zeylanicum, is frequently substituted or mislabelled.

Traditional identification methods like macroscopic, microscopic, and chemical analyses[2,3], while reliable, are labour-intensive. Modern technologies such as computer vision and AI offer efficient alternatives but remain underexplored for dry Ayurvedic herb identification.

Our research addresses this gap by developing an AI-based system using Convolutional Neural Networks (CNNs) to identify 43 types of dry Ayurvedic herbs - 14 stems or barks and 29 roots - based on visual features like texture, colour, and shape.

The methodology involved dataset creation, preprocessing (normalization and resizing), and building a CNN model with multiple convolutional, pooling, and dropout layers. Hyperparameters were optimized to maximize accuracy while preventing overfitting.

The model demonstrated strong performance during training and validation, accurately identifying unseen herb images. A detailed confusion matrix analysis highlighted strengths and areas for improvement.

The system can be deployed on mobile devices for real-time identification or on servers for large-scale analysis, offering a practical solution to herb adulteration.

By ensuring the authenticity of Ayurvedic herbs, this technology enhances consumer confidence, improves quality control in herbal markets, and supports global trade.

Ultimately, it preserves the efficacy and reputation of Ayurvedic medicine worldwide.

Table 1: List Of Dry Herbs Used In This Project

SNNameBotanical NameFamilyPart Used
1. Daru HaridraBerberis aristataBerberidaceaeStem
2. PalashaButea monospermaFabaceaeStem bark
3. ChavyaPiper retrofractumPiperaceaeStem
4. DalchiniCinnamomum zeylanicumLauraceaeStem bark
5. AgaruAqualaria agallochaThymelaeaceaeHeart wood
6. ArjunaTerminalia arjunaCombretaceaeStem bark
7. KutajaHolarrhena antidysentericaApocynaceaeStem bark
8. ShirishaAlbizia lebbeckMimodoideaeStem bark
9. VarunaCrataeva nurvulaCapparidaceaeStem bark
10.LodhraSymplocos racemosaSymplocaceaeStem bark
11.KatphalaMyrica nagiMyricaceaeStem bark
12.NimbaAzadirachta indicaMeliaceaeStem bark
13.GuduchiTinospora cordifoliaMenispermiaceaeStem
14.AshokaSaraca asocaFabaceaeStembark
15.VidarikandaPueraria tuberosaFabaceaeTuber
16.PippaliPiper longumPiperaceaeRoot
17.PushkarmulaInula racemosaAsteraceaeRoot
18.YashtimadhuGlycyrrhiza glabraFabaceaeRoot
19.AnantamulaDecalepis hamiltoniiApocynaceaeRoot
20.ShatiHedychium spicatumZingiberaceaeRoot
21.VatsanabhaAconitum chasmanthumRanunculaceaeRoot
22.AshwagandhaWithania somniferaSolanaceaeRoot
23.ErandaRicinus communisEuphorbiaceaeRoot
24.AtivishaAconitum heterophyllumRanunculaceaeRoot
25.BalaSida cordifoliaMalvaceaeRoot
26.VriddhadaruArgyreia speciosaConvolvulaceaeRoot
27.MustaCyperus rotundusCyperaceaeRhizome
28.VachaAcorus calamusAraceaeRhizome
29.KutakiPicrorhiza kurroaScrophulariaceaeRoot
30.KantkariSolanum xanthocarpumSolanaceaeRoot
31.ShatavariAsparagus racemosusLiliaceaeRoot
32.JatamansiNardostachys jatamansiValerianaceaeRoot
33.PunarnavaBoerhavia diffusaNyctaginaceaeRoot
34.SarpgandhaRauvolfia serpentinaApocynaceaeRoot
35.HaridraCurcuma longaZingiberaceaeRhizome
36.NishothaOperculina turpethumConvolvulacaceaeRoot
37.PashanbhedaBerginia ligulataSaxifragaceaeRoot
38.ChitrakaPlumbago zeylanicaPlumbaginaceaeRoot
39.ManjishthaRubia cordifoliaRubiaceaeRoot
40.NagarmothaCyperus scariosusCyperaceaeRoot
41.Safed MusliChlorophytum borivilianumLiliaceaeRoot
42.AgnimanthaClerodendrum phlomidisVerbenaceaeRoot
43.ShunthiZingiber officinalisZingiberaceaeRhizome

Materials and Methods

Materials

A comprehensive review of Ayurvedic texts, journals, and modern resources bridged traditional herb knowledge with image recognition technology. A dataset of 4,300 high-resolution images of 43 dry herbs was created using smartphones (iPhone 14, Redmi Note 10) in collaboration with Ayurvedic institutions. Image analysis and model training were supported by Intel Xeon processors, NVIDIA Tesla V100 GPUs, and software like Photoshop, TensorFlow, Keras, and Python libraries (OpenCV, scikit-learn).

Methodology

1. Data Collection: Images were collected to cover diverse views for improved model accuracy.
2. Pre-processing and Augmentation: Images were resized, normalized, and augmented for better model generalization.
3. CNN Model Development: A convolutional neural network (CNN) was trained for herb identification.
4. API and UI Development: An API and user-friendly interface enabled image uploads and classification results.
5. System Integration and Testing: The system was integrated, tested, and deployed, followed by real-world evaluations.

Model Development - Tensor Flow Code Explanation

1. Importing Libraries

  • tensorflow for machine learning.
  • models and layers from tensorflow.keras for neural networks.
  • pyplot for plotting graphs.

2. Hyperparameters:

  • Image size: 150x150 pixels
  • Batch size: 50
  • Channels: 3 (RGB)
  • Epochs: 15

3. Loading and Pre-processing Image Data:

  • The dataset is loaded using image_dataset_from_directory.
  • Images are resized to 150x150 pixels and rescaled to a [0, 1] range.

4. Data Augmentation

  • Random flipping and rotation enhance the model’s robustness.

5. Model Architecture

Convolutional Layers:Three Conv2D layers (32, 64, and 128 filters) extract features at increasing complexity, using ReLU activation for non-linearity.
Pooling Layers:MaxPooling2D layers follow each convolutional layer to downsample feature maps, reducing spatial dimensions while preserving important information.
Fully Connected Layers:A Flatten layer converts 2D feature maps to a 1D vector, followed by a Dense layer with 512 units (ReLU activation) and a final Dense layer for class probabilities (Softmax activation).
Total Parameters:The model comprises 17,179,762 parameters, including 17,179,250 trainable and 512 non-trainable parameters.

6. Training and Evaluation

  • The model uses Adam optimizer and categorical cross-entropy loss.
  • It’s trained over 15 epochs and evaluated using a confusion matrix.

7. Deployment

  • The trained model is deployed via a Streamlit app, allowing users to upload images for herb classification.

Results

1) Model Summary

  • Convolutional Layers: Four layers (filters 32 to 256) for feature extraction, each followed by MaxPooling.
  • Pooling Layers: MaxPooling2D layers down-sample feature maps, reducing dimensions and complexity.
  • Dropout Layers: Applied after MaxPooling and Dense layers to prevent overfitting.
  • Flatten Layer: Converts 2D output to 1D for dense layer input.
  • Dense Layers: Two layers, first with 256 units and dropout; final with 50 units for class prediction.
  • Total Parameters: 17,179,762 (17,179,250 trainable, 512 non-trainable).

jaims_3937_01.JPG
Figure: 1

jaims_3937_02.JPG
Figure: 2


2) Training

The model training shows rapid improvement in early epochs, stabilizes in the mid-phase with consistent accuracy gains, and reaches peak performance by the final epochs (91.86% training, 83.86% validation).

Loss values steadily decrease, indicating strong generalization without overfitting, though a small gap suggests potential for improved generalization on unseen data.

3) Accuracy over Epochs:

  • Training Accuracy: Steady improvement from 88% to 94% shows strong learning without signs of overfitting.
  • Validation Accuracy: Fluctuates with a peak around 85%, indicating less stable generalization.
  • Epoch Variability: Significant oscillations in validation accuracy during mid-to-late epochs suggest challenges in generalizing to new data.

jaims_3937_03.JPG
Figure: 3

4) Loss Over Epoch

  • Training Loss: Sharp initial decrease, reaching minimal error around epochs 12-14, indicating effective learning without overfitting.
  • Validation Loss: Starts high, fluctuates heavily, with instability persisting through epochs 3-14, showing inconsistent generalization.

  • Train-Validation Loss Discrepancy: Early closeness diverges as training loss decreases steadily, while validation loss remains erratic, signalling challenges in generalizing to new data.

jaims_3937_04.JPG
Figure: 4

5) Confusion Matrix Overview

  • Diagonal Dominance: Strong accuracy, especially for distinct classes like Zingiber Officinale Root and Berberis Aristata Stem, with minimal misclassifications.
  • Off-Diagonal Errors: Misclassifications primarily occur between visually similar species, like Aconitum varieties, indicating difficulty in differentiating closely related classes.
  • Overall Performance: High model accuracy with room for refinement to better distinguish similar species, suggesting potential for further optimization.

6) Prediction of Model

  • Dataset Shuffling: Images are shuffled before training, enhancing the model's learning by providing random data order.
  • Image Prediction: The model correctly predicts the herb Asparagus Racemosus Root for the first image, matching its true label.
  • End of Sequence Warning: An "OUT_OF_RANGE" warning appears, indicating that all available data has been processed.

jaims_3937_05.JPG
Figure: 5

jaims_3937_06.JPG
Figure: 6

Visual Predictions and Model Confidence Analysis for Dry Herbs:


jaims_3937_07a.JPG

jaims_3937_07b.JPG

jaims_3937_07c.JPG
Figure: 7

jaims_3937_08a.JPG


jaims_3937_08b.JPG

jaims_3937_08c.JPG
Figure: 8

jaims_3937_9a.JPG

jaims_3937_9b.JPG


jaims_3937_9c.JPG
Figure: 9

jaims_3937_10a.JPG
jaims_3937_10b.JPG
jaims_3937_10c.JPG
Figure: 10


jaims_3937_11a.JPG

jaims_3937_11b.JPG

jaims_3937_11c.JPG
Figure: 11

Discussion

The CNN model for dry Ayurvedic herb identification, designed with four convolutional layers (increasing filters from 32 to 256), effectively captures hierarchical visual features like texture and patterns, while MaxPooling layers reduce dimensionality and Dropout layers mitigate overfitting. With over 17 million parameters, the model balances complexity and efficiency. Performance metrics showed training accuracy improving steadily from 88% to 94%,

demonstrating effective learning, though validation accuracy stabilized around 85%, indicating challenges in generalization. The training loss steadily decreased, but validation loss exhibited fluctuations, suggesting potential overfitting or insufficient dataset diversity. A detailed confusion matrix highlighted high accuracy for certain herbs and occasional misclassifications, particularly among visually similar species, while achieving perfect classification for some herbs, underscoring the model's reliability. The CNN’s architecture efficiently captures subtle visual distinctions, though additional regularization could further enhance generalization.


This model has significant practical implications, offering automation in herb identification and quality control, thereby reducing dependence on expert evaluation.

Conclusion

The study successfully developed a CNN-based model for identifying and ensuring the quality control of dry Ayurvedic herbs using visual features such as texture, colour, and shape, demonstrating strong potential with high classification accuracy and effective feature extraction through four convolutional layers. The model achieved significant training accuracy improvements and steady learning trends, though validation accuracy and loss trends highlighted challenges in generalization. The confusion matrix revealed high accuracy for distinct herbs but misclassifications among morphologically similar species, underscoring the need for advanced features and dataset refinement. Practical applications include real-time herb identification, benefiting the pharmaceutical and Ayurvedic industries by reducing human reliance and errors. Future studies should focus on expanding the dataset to include diverse visual variations, utilizing advanced preprocessing techniques, and upgrading computational infrastructure with GPUs, TPUs, or cloud platforms to enhance scalability, efficiency, and robustness, thereby modernizing Ayurvedic practices and advancing medicinal plant research.

References

1. Food Safety and Standards Authority of India (FSSAI). Guidance note on cinnamon [Internet]. CCASIA; 2014 Mar 10 [cited 2024 Oct 19]. Available from: https://www. fssai.gov.in/upload/advisories/2018/04/5ac47df86d178Guidance_Note_Cinnamon_CCASIA_10_03_2014.pdf [Crossref][PubMed][Google Scholar]

2. World Health Organization. Quality Control Methods for Medicinal Plant Materials. Geneva: WHO; 1992. . [Crossref][PubMed][Google Scholar]

3. Government of India, Ministry of Health and Welfare, Department of AYUSH. The Ayurvedic Pharmacopeia of India. New Delhi: Government of India. . [Crossref][PubMed][Google Scholar]

Disclaimer / Publisher's Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of Journals and/or the editor(s). Journals and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.