Statistical Machine Learning for Medicinal Plant Leaves Classification

Jayani P. Gamage, Thiyanga S. TalagalaarXiv 2026 · arXiv

This paper presents MEDIPI (MEDIcinal Plant Identification), a hierarchical machine learning framework designed to classify medicinal plants using leaf photographs. By combining 52 interpretable features with a structured classification tree, the researchers achieved up to 100% accuracy on a newly released dataset of Sri Lankan medicinal plants, offering a transparent alternative to "black-box" deep learning models.

TL;DR

The authors introduce MEDIPI, a hierarchical statistical machine learning approach that classifies medicinal plant leaves using 52 interpretable features across shape, texture, color, and "scagnostics." Along with the framework, they released MedLEA, an open-source R package and dataset of Sri Lankan medicinal plants, achieving 100% classification accuracy while highlighting significant challenges in model generalization across different datasets.

What Problem Does This Paper Address?

Identifying medicinal plants accurately is critical for both traditional medicine and conservation. Currently, this process relies heavily on the experience of practitioners, which is difficult to scale and prone to human error. While computer vision offers a solution, existing methods face two major hurdles:

  1. Interpretability: Most state-of-the-art models use Deep Learning (CNNs), which require massive computational power and offer little insight into why a specific leaf was classified as a certain species.
  2. Data Scarcity: There is a lack of high-quality, standardized image databases for specific regions, such as Sri Lanka, which boasts high medicinal plant diversity but lacks digital repositories.

As shown in Figure 1, Sri Lanka ranks highly in medicinal plant diversity relative to its total flora, making it a vital region for automated botanical tools.

Figure 1: Sri Lanka is in the top 15 for medicinal plant diversity among countries with published estimates. (a) Number of medicinal plant species and (b) percentage of medicinal plants relative to total flora in 15 countries; Sri Lanka is highlighted. Data: Schippmann et al. [2006], Table 1.

Methods

The researchers developed a pipeline consisting of image processing, feature extraction, and hierarchical classification.

  • Feature Extraction: Instead of raw pixels, the model uses 52 hand-crafted, interpretable features. These include standard metrics (shape, color, texture) and a novel application of scagnostics (statistical graphics diagnostics) to leaf contours to capture complex geometric properties.
  • Hierarchical Classification: Rather than a "flat" classification (predicting species directly), the model uses a three-level hierarchy:
  • Shape (e.g., Diamond, Round, Needle, Heart)
    1. Edge Type (e.g., Smooth, Toothed, Lobed, Crenate)
    2. Species
  • Algorithms: The study compared eight algorithms, including Random Forest (RF), XGBoost, Support Vector Machines (SVM), and Artificial Neural Networks (ANN).

Datasets

The study utilized four distinct datasets to train and validate the model:

  • MedLEA (Medicinal Leaf Dataset for Evaluation and Analysis): A new primary dataset introduced by the authors containing 1,099 color images of 31 Sri Lankan medicinal plant species. It is available as an R package.
  • Flavia: 1,907 color images of common plants.
  • Swedish Leaf Dataset: 1,125 color images.
  • Kaggle Leaf Dataset: 1,584 binary (black and white) images.

Key Insights and Ideas

  • The Power of Hierarchy: Moving from a flat model to a hierarchical one provided a small but consistent boost in accuracy (about 1%). More importantly, it allows the model to use different features at different levels—for instance, shape features are vital for the top level, while scagnostics become more important for distinguishing species at the bottom level.
  • Beyond Shape: While many botanical studies focus solely on leaf shape, this paper demonstrates that adding color, texture, and scagnostic features raised shape-level accuracy from 90% to 97%.
  • Visualizing the "Black Box": By using Linear Discriminant Analysis (LDA), the authors could visualize how the model separates different leaf types. They found that needle-shaped leaves are the easiest to distinguish, while diamond and round shapes often overlap in feature space, leading to most classification errors.
  • The Generalization Gap: A sobering finding was that models performing perfectly on their "home" dataset failed significantly when tested on images from other datasets (dropping to 23–50% accuracy). This suggests that differences in camera quality, lighting, and background "noise" remain a massive hurdle for real-world deployment.

Key Results

  • Top Performance: The Hierarchical Random Forest was the clear winner, achieving 100% overall accuracy on the MedLEA dataset.
  • Algorithm Comparison: Tree-ensemble methods (Random Forest, XGBoost, Gradient Boosting) consistently outperformed traditional neural networks and SVMs in this feature-based approach.
  • Economic Context: The paper notes that Sri Lanka’s medicinal plant exports are growing rapidly (Figure 2), underscoring the economic importance of accurate identification for trade and quality control.
Figure 2: Global trade in medicinal plants is growing, but Sri Lanka’s share is small. (a) Global export value of HS 1211 plants, 2016–2025 (2025 is provisional); (b) top 20 exporting economies of HS 1211 plants in 2024. Source: ITC Trade Map, https://www.trademap.org.

Limitations and Future Work

The primary limitation is cross-dataset generalization. The model is highly sensitive to the specific conditions under which the training images were taken. Furthermore, while 31 species is a start, Sri Lanka has over 1,400 medicinal plant species that need to be cataloged.

Future work will focus on:

  • Expanding the MedLEA dataset to include more diverse species.
  • Testing the model on "in-the-wild" images taken by non-experts in varied environments.
  • Directly comparing the accuracy-vs-interpretability trade-offs between this statistical approach and modern deep-learning methods.

Summary updated

Abstract

Medicinal plants are usually identified using practitioners' experience, but reproducible, image based methods can complement this knowledge. We present MEDIPI (MEDIcinal Plant Identification), a statistical machine learning approach that classifies medicinal plant leaves from photographs. From each leaf image we extract 52 interpretable features covering shape, texture, color, and a new scagnostics category. We then classify leaves using a three level hierarchy: shape, then edge type, then species. We also release MedLEA, an open R package with 1,099 leaf images of 31 Sri Lankan medicinal plant species. On this dataset, a hierarchical Random Forest achieved the best overall accuracy (100%) in our comparison of hierarchical and non-hierarchical approaches and eight algorithms: Random Forest, XGBoost, Gradient Boosting, linear discriminant analysis, k-nearest neighbor, support vector machine, probabilistic neural network, and artificial neural network. Adding texture, color, and scagnostic features to shape features raised shape level accuracy from 90% to 97%. Linear discriminant analysis plots show how the trained model separates leaf shapes. Accuracy dropped sharply (23-50%) when training and test data came from different datasets, so generalization across datasets remains a challenge.
BibTeX
@misc{gamage2026statistical,
  author = {Jayani P. Gamage and Thiyanga S. Talagala},
  title = {{Statistical Machine Learning for Medicinal Plant Leaves Classification}},
  year = {2026},
  eprint = {2611.04193},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.04193},
}
Figure