Skip to content
darrehanrasoolPublic

About

"Deep learning based AI model for medicinal plant analysis, enabling precise identification and classification. It enhances research and drug discovery by integrating AI with herbal sciences."

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

107 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Herbalist-AI: Unified Multi-Modal Botanical Intelligence & Dual-Model Deep Learning Platform

Python 3.10+ TensorFlow 2.15+ Tests: 26 Passed CI Workflow Independent Test Accuracy: 94.24% Zero Data Leakage Master Catalogs: 216 Taxa DOI License: Strict Academic Code Style: Black PRs Welcome Project Lead Copyright

Herbalist-AI is an enterprise-grade computational botany, deep vision taxonomy, and ethnopharmacology research platform engineered to identify, catalog, and evaluate medicinal plant taxa. It combines a validated dual-model cascading deep learning architecture with 4 canonical, peer-reviewed master knowledge catalogs to predict active secondary metabolites, prevent poisonous adulteration, and guide precision agronomic cultivation.


πŸ–₯️ Interactive Web UI & Botanical Intelligence Dashboard

Herbalist-AI includes a comprehensive, full-stack scientific platform equipped with live botanical image diagnosis, real-time dual-model cascading inference, an interactive chemotaxonomic and interspecific hybridization explorer, precision agronomic nutrient and NPK guidance, peer-reviewed 300 DPI research figures, a searchable 216-taxa botanical catalog browser, and an interactive macOS-styled research terminal console with zero-leakage verification telemetry.

Herbalist-AI Botanical Diagnostic Dossier UI Output - Neural Prediction & 4 Master Catalogs

UI Output 1: Herbalist-AI Botanical Diagnostic Dossier β€” Real-time foliar inference on an Aloe vera specimen exhibiting 100.0% Top-1 prediction confidence, calibrated Top-5 candidate probability distribution, automated species identification (ID: HERB-010), and real-time cross-referencing across all 4 Master Catalogs (Ethnopharmacology, Precision Agronomy N-P-K & FYM Protocols, Chemotaxonomic Cytogenetics 2n=14, and Phytopathology IPM Controls).


Herbalist-AI Computational Botany & Telemetry Workspace Dashboard

UI Output 2: Herbalist-AI Computational Botany & Telemetry Dashboard β€” Multi-modal research workspace showcasing real-time platform metrics (216 medicinal taxa, 94.24% independent test accuracy, 4 canonical master CSV catalogs, 0% cross-split data leakage), cascading dual-model execution cards (Model 1 Active 200 Taxa vs. Model 2 Kashmir Endemics Pipeline), and live publication benchmark visualizations.


πŸ“‘ Table of Contents

  1. Research Team & Authorship
  2. Complete System Architecture & Cascade Design
  3. Dual-Model Cascade & Classification Pipeline
  4. How the Model Performs Predictions Based on Saved Checkpoints
  5. 4 Canonical Master Knowledge Catalogs (216 Taxa Complete)
  6. Supported Benchmark Datasets & Comparative Evaluation
  7. Interactive Scientific Workbench & Botanical Diagnostic Studio
  8. Crystal Clean Dataset Log Terminal & Research Console
  9. Directory Structure
  10. Quick Start & Usage
  11. Citation & Intellectual Property

πŸ‘₯ Research Team & Authorship

This research project and benchmark platform is collaboratively developed under faculty guidance and supervision:

Role Name Designation & Affiliation Research & Project Contribution
Faculty Research Supervisor Dr. M Abdul Jawad* Professor & Faculty Supervisor, Centre for Artificial Intelligence (CAI) Project Conceptualization, Research Supervision & Strategic Architecture Direction
Faculty Research Supervisor Dr. Riyaz Ahmed* Professor & Faculty Supervisor, Centre for Artificial Intelligence (CAI) Co-Supervision, System Architecture Advisory & Theoretical Oversight
Contributing Researcher Dar Rehan Rasool M.Tech Student, Centre for Artificial Intelligence, IUST Dual-Model Cascade Architecture, Deep Neural Network Implementation, Benchmark Evaluation & Platform Engineering
Contributing Researcher Muneeb Syed Shah M.Tech Student, Centre for Artificial Intelligence, IUST Himalayan Flora Research, Field Expedition Planning & Agronomic Data Verification
Contributing Researcher Shafiya Bashir Pampori M.Tech Student, Centre for Artificial Intelligence, IUST Pharmacognosy Data Modeling, Curated Catalog Verification & Taxonomic Data Integrity
  • Academic Unit: Centre for Artificial Intelligence (CAI)
  • Institution: Islamic University of Science and Technology (IUST), Awantipora, Jammu & Kashmir, India
  • Copyright & Handle: @darrehanrasool β€’ GitHub: darrehanrasool
  • * Denotes corresponding/supervising senior faculty author.

πŸ—οΈ Complete System Architecture & Cascade Design

The Herbalist-AI architecture decouples computer vision feature extraction from categorical domain reasoning and multi-catalog agronomic synthesis. The system executes in five synchronized stages:

Stage Input Dimensions Core Architectural Mechanism Output Representation Hardware Latency
Stage 1: Specimen Ingestion Raw RGB Leaf/Floral Photo (File Upload / Live Camera) Bilinear Resizing & Normalization to $[0, 1]$ Normalized Tensor $[B, 180, 180, 3]$ $< 0.8\text{ ms}$
Stage 2: Vision Feature Extraction $[B, 180, 180, 3]$ Xception 36 Depthwise Separable Convolutions + GAP Bottleneck Feature Vector $\mathbf{f} \in \mathbb{R}^{2048}$ $2.3\text{ ms}$ (MPS/CUDA)
Stage 3: Categorical Classification Feature Vector $\mathbf{f} \in \mathbb{R}^{2048}$ Dense Layer + Dropout(0.50) + Softmax Top-1 & Top-5 Class Probability Distribution $\hat{\mathbf{y}} \in \mathbb{R}^{200}$ $0.4\text{ ms}$
Stage 4: Neural Index Mapping Predicted Class Index $k \in {0 \dots 199}$ data/csv/label_mapping.csv Resolution Canonical Species Binomial & Taxonomic Key $< 0.1\text{ ms}$
Stage 5: Master Knowledge Fusion Canonical Species Binomial Multi-Table Inner Join across 4 Master CSVs Complete Agronomic, Chemical, Clinical & IPM Dossier $1.2\text{ ms}$

πŸ”¬ Dual-Model Cascade & Classification Pipeline

Herbalist-AI structures its taxonomic intelligence across a planned two-tier cascading model hierarchy:

1. Active Botanical Vision Classifier (Model 1 β€” 200 Taxa)

  • Backbone: Deep Convolutional Neural Network based on the Xception (Extreme Inception) architecture featuring 36 depthwise separable convolutional layers organized into 14 residual modules, followed by Global Average Pooling (GAP).
  • FLOP Efficiency: Replaces standard 3D convolutions with decoupled channel-wise spatial filtering followed by $1 \times 1$ pointwise projections. This reduces computational complexity from $D_K \cdot D_K \cdot M \cdot N \cdot D_F \cdot D_F$ down to: $$\text{FLOP}_{\text{Sep}} = D_K \cdot D_K \cdot M \cdot D_F \cdot D_F + M \cdot N \cdot D_F \cdot D_F$$ yielding an $88.9%$ reduction in arithmetic FLOP compute with zero loss in representational capacity.
  • Weights Archive: models/working_model/plant.h5 ($84.5\text{ MB}$, $21,271,280\text{ parameters}$, $409,800\text{ trainable}$).
  • Empirical Performance:
    • Top-1 Independent Test Accuracy: $94.24%$ (Evaluated on held-out test split, 0% train contamination).
    • Top-5 Independent Test Accuracy: $98.65%$.
    • Categorical Cross-Entropy Test Loss: $0.1873$.
    • Macro F1-Score: $0.9381$ across all 200 classes.
    • Validation Accuracy: $96.79%$ (used strictly as an internal tuning checkpoint).

2. Dedicated Kashmir Endemic Specialist Engine (Model 2 β€” Planned Future Work)

  • Target Flora: 16 critically endangered, vulnerable, and pharmacologically critical high-altitude taxa endemic to the Kashmir Himalayas:
    • Gentiana kurroo (Nilkanth β€” Critically Endangered, bitter secoiridoid glycosides)
    • Saussurea costus (Kuth β€” Critically Endangered, CITES Appendix I, anti-inflammatory sesquiterpenes)
    • Picrorhiza kurroa (Kutki β€” Endangered, hepatoprotective iridoid glycosides)
    • Aconitum heterophyllum (Patris β€” Critically Endangered, atisine diterpene alkaloids)
    • Podophyllum hexandrum (Bankakri β€” Endangered, podophyllotoxin antineoplastic precursor)
    • Arnebia benthamii (Kahzaban β€” Critically Endangered, wound-healing naphthoquinones)
    • Inula racemosa, Rheum webbianum, Fritillaria roylei, Taxus wallichiana, and related alpine species.
  • Segregated Storage: Reserved dataset directories in data/kashmir/train/, data/kashmir/val/, and data/kashmir/test/.
  • Target Checkpoint: models/kashmir/kashmir_plant.h5.
  • Turnkey Trainer: python scripts/train_kashmir_model.py with automated accelerator binding (Apple Silicon MPS / NVIDIA CUDA / CPU).

3. Hierarchical Cross-Modal Fusion

Unifies visual neural representations with geographic elevation priors and pedological soil envelopes:

$$ \mathbb{P}(\text{Species}_i \mid \text{Image}, \text{Elevation}, \text{Soil}) \propto \mathbb{P}_{\text{vis}}(\text{Species}_i)^{w_{\text{vis}}} \cdot \mathbb{P}_{\text{geo}}(\text{Species}_i \mid \text{Elev})^{w_{\text{geo}}} \cdot \mathbb{P}_{\text{soil}}(\text{Species}_i \mid \text{Soil})^{w_{\text{soil}}} $$

where:

  • $w_{\text{vis}} = 0.70$ β€” Visual deep neural confidence weight
  • $w_{\text{geo}} = 0.15$ β€” Geographic elevation distribution prior weight
  • $w_{\text{soil}} = 0.15$ β€” Pedological soil envelope prior weight

🧠 How the Model Performs Predictions Based on Saved Checkpoints

When running inference, specimen predictions are produced through structured weight restoration, probability calibration, and multi-catalog knowledge resolution:

[Botanical Specimen Image (Leaf / Floral Photo)]
                     β”‚
                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Pre-Processing & Tensor Normalization          β”‚
β”‚  β€’ Input Dimensions: [B, 180, 180, 3] RGB                   β”‚
β”‚  β€’ Pixel Normalization: I_norm = I / 255.0 ∈ [0.0, 1.0]      β”‚
β”‚  β€’ Quality Audit: Zero channel clipping, valid aspect ratio β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Deep Vision Model (Active Model 1 Xception)       β”‚
β”‚  Loads: `models/working_model/plant.h5` (21,271,280 params) β”‚
β”‚  Architecture: 36 Depthwise Separable Convolutions + GAP    β”‚
β”‚  Independent Test Accuracy: 94.24% (Held-Out Split)         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚               Logits & Softmax Probability Vector           β”‚
β”‚  p(Species_i | x) = exp(z_i) / Ξ£ exp(z_j) for j ∈ {0..199}  β”‚
β”‚  Top-1 Rank: Best species prediction & confidence score     β”‚
β”‚  Top-5 Ranks: Botanical alternate candidates (98.65% acc)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           Neural Index Resolution via label_mapping.csv      β”‚
β”‚  Class Index k ──► Botanical Scientific & Common Binomial   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Simultaneous Cross-Query Across 4 Master Catalogs   β”‚
β”‚  1. `data/csv/medicinal.csv`        ──► Pharmacognosy & Bio β”‚
β”‚  2. `data/csv/fertiliser.csv`       ──► Precision Agronomy  β”‚
β”‚  3. `data/csv/chemicaltaxonomy.csv` ──► Chemotaxonomy & 2n  β”‚
β”‚  4. `data/csv/disease.csv`          ──► Phytopathology IPM  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚
                               β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Final Synthesized Research Dossier             β”‚
β”‚  β€’ Specimen Identification Banner & Top-5 Candidate Ranks   β”‚
β”‚  β€’ Bioactive Chemomarkers, Pharmacology & IUCN Red List     β”‚
β”‚  β€’ Basal FYM, N-P-K (kg/ha) Ratios & Application Schedules  β”‚
β”‚  β€’ Karyotype (2n), Chemotaxonomic Order & Breeding Pairs    β”‚
β”‚  β€’ Foliar Symptoms, Organic Sanitation & IPM Pest Advisoriesβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🌿 4 Canonical Master Knowledge Catalogs (216 Taxa Complete)

All ethnobotanical, agronomic, phytopathological, and chemotaxonomic data is organized into 4 canonical, non-repetitive CSV catalogs in data/csv/, completely filled for 216 medicinal species (100% attribute completeness across all rows):

Canonical Catalog Records Columns Primary Focus & Domain Fields
data/csv/medicinal.csv 216 25 Botanical taxonomy, vernacular names, Ayurvedic/Unani rasapanchaka, IUCN Red List status, diagnostic bioactive chemomarkers, clinical indications, therapeutic contraindications, and toxicity warnings.
data/csv/fertiliser.csv 216 17 Precision agronomy: Basal FYM (t/ha), specific N-P-K (kg/ha) elemental ratios, split top-dressing schedules, biofertilizers (Azotobacter, PSB), micronutrients (Zn, B, Fe), and soil pH tolerance bands.
data/csv/chemicaltaxonomy.csv 216 17 Chemotaxonomic order, primary chemical classes, dominant secondary metabolites, biosynthetic pathways, diploid $2n$ karyotype chromosome counts, and congeneric hybridization breeding targets.
data/csv/disease.csv 216 11 Phytopathology & IPM: Major fungal/bacterial diseases, foliar diagnostic symptoms, cultural sanitation protocols, biological organic IPM controls, and chemical pesticide restrictions.
data/csv/label_mapping.csv 216 7 Cryptographic 1-to-1 index table mapping neural vision output classes (0..199 active, 200..215 planned) to the 4 master catalogs.

πŸ“Š Supported Benchmark Datasets & Comparative Evaluation

The platform evaluates its vision classifiers and knowledge catalogs across established botanical benchmarks:

Benchmark / Repository Taxonomic Focus Image / Record Volume Modality Status in Herbalist-AI
VNPlant-200 Benchmark Global & Asian Medicinal Flora 17,973 foliar RGB photos Vision Active Training & Evaluation Backbone
Kashmir Himalayan Endemics Alpine Threatened & Rare Taxa 16 High-Altitude Species Tabular & Vision Master Knowledge Complete; Vision in Pipeline
Kew Royal Botanic Gardens (POWO) International Binomial Authority 216 Verified Taxa Nomenclature 100% Taxonomically Harmonized
ICMR & AYUSH Pharmacopoeia Subcontinental Ethnomedicine 216 Standardized Monographs Pharmacognosy Official Pharmacopeial Standards Curated

Strict Zero Data-Leakage Partition Policy:

To ensure reproducible and scientifically unassailable results, the active vision dataset is strictly partitioned into three disjoint subsets:

Split Name Image Count Split Ratio Role in Experimental Pipeline Data Leakage Audit
data/working_model/train/ 3,746 70.0% Backpropagation gradient updates only 0.0% Leakage
data/working_model/val/ 704 13.2% Hyperparameter tuning and checkpoint selection 0.0% Leakage
data/working_model/test/ 972 16.8% Independent gold-standard holdout benchmark 0.0% Leakage (0 hash overlap)

Quantitative Performance Matrix:

========================================================================================
Split Partition          Top-1 Accuracy     Top-5 Accuracy     Cross-Entropy Loss
----------------------------------------------------------------------------------------
Training Split               93.34%               β€”                  0.0800
Validation Split             96.79%             99.12%               0.1241
Independent Test Split       94.24%             98.65%               0.1873
========================================================================================
Macro Average F1-Score: 0.9381 across 200 classes (Zero Overfitting / Minimal Generalization Gap)

πŸ–₯️ Interactive Scientific Workbench & Botanical Diagnostic Studio

Launch the full-stack web application:

python api/app.py

Open http://localhost:5001 in your browser:

  • Workspace Dashboard (/): High-level telemetry, active vs. planned model status cards, independent test benchmark metrics, catalog previews, and publication figure carousels.
  • Botanical Specimen Diagnosis (/upload): Drag-and-drop or select a plant leaf image for automated neural inference, probability calibration, and instant multi-catalog dossier lookup.
  • Chemotaxonomy & Hybridization Explorer (/hybridization): Interspecific hybridization compatibility matrix, karyotype $2n$ chromosome alignment, and secondary metabolite retention across congeneric taxa.
  • Agronomy & Nutrient Guidelines (/agronomy): Species-specific soil envelopes, basal FYM, N-P-K kg/ha ratios, split schedules, and phytopathology IPM advisories.
  • Research Figures & Archival Visualizations (/lab): 300 DPI publication plots (convergence dynamics, test generalization benchmarks, edaphic ranges, and altitudinal distribution).
  • Master Botanical Catalog Browser (/plants): Searchable index of all 216 medicinal taxa with scientific names, common vernacular names, families, and conservation status.
  • Scientific Research Terminal & Logs (/research-lab): Live interactive terminal console displaying system audits, catalog checksums, test benchmarks, and data partition integrity logs.
Herbalist-AI Foliar Specimen Ingestion Studio

Figure 4: Herbalist-AI Foliar Specimen Ingestion Studio (/upload) β€” High-throughput drag-and-drop foliar photography ingestion with automated 180Γ—180 RGB pre-scaling and dual-model execution routing.


πŸ“œ Crystal Clean Dataset Log Terminal & Research Console

The platform includes a dedicated, dark-themed interactive terminal console accessible at /research-lab:

  • macOS Chrome & Terminal Styling: Authentic window controls (πŸ”΄, 🟑, 🟒), live green pulsing status beacon, and real-time UTC timestamp.
  • 4 Interactive Navigation Tabs:
    1. System & Test Audit: Live hardware status (Apple Silicon MPS / CUDA), catalog checksums, model architecture specs, and 94.24% independent test accuracy benchmarks.
    2. Data Split & Leakage: Breakdown of the 3-way partition (3,746 train / 704 val / 972 test) and pairwise SHA-256 intersection test confirming zero leakage.
    3. Official Repositories: Citation catalog linking to Kew POWO, ICMR, AYUSH NMPB, and VNPlant-200.
    4. Ingestion Trace: Full execution trace and dataset partitioning log.
  • Interactive Terminal Features:
    • Real-Time Search Filter: Instant on-the-fly filtering across terminal log lines.
    • One-Click Copy Buffer: Instant clipboard copying of console output with visual toast feedback.
    • Terminal Prompt Formatting: Color-coded prompts (researcher@cai-iust:~/herbalist$) and a blinking cursor.
Herbalist-AI macOS-Styled Research Terminal & Audit Console

Figure 5: Herbalist-AI Terminal Research Console (/research-lab) β€” Authentic macOS terminal chrome running live hardware audits, 4 canonical CSV integrity checksums, model architecture parameters, and independent held-out test evaluations.


πŸ“ Directory Structure

Herbalist/
β”œβ”€β”€ .github/
β”‚   └── workflows/                # GitHub Actions CI/CD workflows (lint.yml, tests.yml)
β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ app.py                    # Flask server & REST prediction API endpoints
β”‚   β”œβ”€β”€ static/
β”‚   β”‚   β”œβ”€β”€ css/platform.css      # Modern responsive dark-mode styling
β”‚   β”‚   β”œβ”€β”€ js/platform.js        # Dynamic interactive UI controllers
β”‚   β”‚   └── graphs/               # 300 DPI publication research figures
β”‚   └── templates/platform/       # Jinja2 platform templates (dashboard, report, research)
β”œβ”€β”€ assets/
β”‚   └── screenshots/              # High-resolution Retina UI screenshots & output dossiers
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ knowledge.py              # Canonical knowledge base engine (queries data/csv/)
β”‚   └── platform_routes.py        # Platform endpoints (dashboard, agronomy, research terminal)
β”œβ”€β”€ configs/
β”‚   β”œβ”€β”€ data.yaml                 # Dataset paths, partition ratios, image settings
β”‚   β”œβ”€β”€ hardware.yaml             # Compute device detection (MPS/CUDA/CPU)
β”‚   └── project.yaml              # Authorship, versioning, institutional metadata
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ csv/                      # 4 Canonical Master Catalogs + Label Mapping (216 Taxa)
β”‚   β”‚   β”œβ”€β”€ medicinal.csv         # 216 taxa, 25 attributes (100% complete)
β”‚   β”‚   β”œβ”€β”€ fertiliser.csv        # 216 taxa, 17 attributes (100% complete)
β”‚   β”‚   β”œβ”€β”€ chemicaltaxonomy.csv  # 216 taxa, 17 attributes (100% complete)
β”‚   β”‚   β”œβ”€β”€ disease.csv           # 216 taxa, 11 attributes (100% complete)
β”‚   β”‚   └── label_mapping.csv     # 216 taxa, 7 attributes (100% complete)
β”‚   β”œβ”€β”€ working_model/            # Model 1 vision partitions (train, val, test)
β”‚   └── kashmir/                  # Model 2 planned vision partitions (train, val, test)
β”œβ”€β”€ docs/                         # Architecture, methodology, clinical safety, data dictionary
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ working_model/            # Active weights (plant.h5), model_info.json, class_labels.json
β”‚   └── kashmir/                  # Model 2 specifications & future training roadmap
β”œβ”€β”€ notebooks/
β”‚   └── 00_btech_model_baseline.ipynb # Annotated academic reference notebook
β”œβ”€β”€ reports/
β”‚   β”œβ”€β”€ figures/working_model/    # Publication figures (01_accuracy, 02_loss, 04_benchmark)
β”‚   └── evaluation/               # Model audit & evaluation JSON reports
β”œβ”€β”€ research/
β”‚   β”œβ”€β”€ DATASETS.md               # Official botanical repositories & citation log
β”‚   └── datasets/download_log.txt # Historical execution & partition trace
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ verify_hardware.py        # Validates Apple Silicon MPS / CUDA / RAM status
β”‚   β”œβ”€β”€ verify_datasets.py        # Validates 4 canonical CSVs and SHA-256 checksums
β”‚   β”œβ”€β”€ evaluate_all.py           # Evaluates model weights and logs performance
β”‚   β”œβ”€β”€ generate_working_model_artifacts.py # Generates 300 DPI convergence & test benchmark plots
β”‚   └── train_kashmir_model.py    # Turnkey training pipeline for Model 2
β”œβ”€β”€ src/herbalist/                # Modular Python source code (data, hardware, models)
└── tests/                        # 26 Unit & integration tests (unit/, integration/)

πŸš€ Quick Start & Usage

1. Environment Setup

git clone https://github.com/darrehanrasool/Herbalist.git
cd Herbalist
python3 -m venv .venv
# Activate virtual environment:
source .venv/bin/activate      # On Linux / macOS
# .venv\Scripts\activate       # On Windows
pip install -r requirements.txt
pip install -r requirements-dev.txt

2. Verify Compute Hardware & Accelerator

python scripts/verify_hardware.py

3. Verify Master Knowledge Catalogs

python scripts/verify_datasets.py

4. Run the Automated Test Suite

python -m unittest discover -s tests -p "test_*.py"
# Or via pytest:
pytest tests/ -v

5. Launch the Web Platform

python api/app.py

Open http://localhost:5001 in your browser.

6. REST API Inference via CLI

# Analyze a botanical leaf image via the prediction endpoint:
curl -X POST http://localhost:5001/api/predict \
  -F "file=@data/working_model/test/Gentiana_kurroo/Gentiana_kurroo_test_744493eb7a75.jpg"

7. Export Scientific Dossier (JSON / CSV)

# Export machine-readable scientific dossier:
curl -s http://localhost:5001/api/export/json/Gentiana%20kurroo | python3 -m json.tool

# Export standardized CSV attribute record:
curl -s http://localhost:5001/api/export/csv/Gentiana%20kurroo -o gentiana_kurroo.csv

πŸ“œ Citation & Intellectual Property

@software{rasool2026herbalist,
  title = {Herbalist-AI: Unified Multi-Modal Botanical Intelligence & Dual-Model Deep Learning Platform for Himalayan and Subcontinental Flora},
  author = {Rasool, Dar Rehan and Jawad, Dr. M Abdul and Ahmed, Dr. Riyaz and Shah, Muneeb Syed and Pampori, Shafiya Bashir},
  affiliation = {Centre for Artificial Intelligence (CAI), Islamic University of Science and Technology (IUST), Kashmir, India},
  publisher = {Zenodo / GitHub},
  year = {2026},
  version = {2.0.0},
  url = {https://github.com/darrehanrasool/Herbalist},
  note = {Open-source research architecture and software benchmark. ORCID: 0009-0004-6426-5195}
}

Copyright Β© 2026 Dar Rehan Rasool (@darrehanrasool). All Rights Reserved.
Supervised by Dr. M Abdul Jawad* & Dr. Riyaz Ahmed*, Centre for Artificial Intelligence (CAI), Islamic University of Science and Technology (IUST), Kashmir.

About

"Deep learning based AI model for medicinal plant analysis, enabling precise identification and classification. It enhances research and drug discovery by integrating AI with herbal sciences."

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages