arXiv:2611.04193cs.CVNov 2026

Manuscript Offprint

arXiv:2611.04193

Statistical Machine Learning for Medicinal Plant Leaves Classification

Jayani P. Gamage, Thiyanga S. Talagala

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

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. Therefore, generalization across datasets remains a challenge.

Keywords image processing · feature extraction · statistical machine learning · hierarchical classification · medicinal plants · leaf image classification · interpretable machine learning

1 Introduction

Located in the tropics, Sri Lanka is home to many plant species with medicinal properties. Generations of Sri Lankans have used them as herbal treatments, and the traditional medicine system, which has been practiced for more than 3000 years, is still in use today [Waisundara and Watawana, 2014]. It includes Ayurveda, Unani, and Deshiya Chikitsa [Gunawardana and Jayasuriya, 2019]. Traditional treatments are used to manage many conditions, including diseases with complicated causes such as diabetes, arthritis, and cancer [Waisundara and Watawana, 2014, Devalaraja et al., 2011], and a wide range of plants is used for this purpose [Gunawardana and Jayasuriya, 2019, Goyal et al., 2018].

Medicinal plants are important worldwide. An estimated 50, 000 to 70, 000 plant species are used for medicinal purposes [Schippmann et al., 2006], and the World Health Organization's Global Traditional Medicine Strategy 2025–2034 stresses that traditional medicines should be used safely and based on scientific evidence [World Health Organization, 2025]. Sri Lanka has about 550 medicinal plant species out of a total of 3, 314 plant species (16.6%) [Schippmann et al., 2006]. Among the 15 countries with available data [Schippmann et al., 2006], Sri Lanka ranks 13th in the number of medicinal plant species and 7th in the percentage of medicinal plants compared with its total flora (Figure 1). Estimates

*Corresponding author.

A PREPRINT

of the number of medicinal plants in Sri Lanka differ between sources; recent surveys report as many as 1432 species [Nilaweera, 2010].

Figure

Figure

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.

Sri Lanka also exports medicinal plants and plant materials. According to ITC Trade Map data for HS code 1211, which covers plants and plant parts used mainly in perfumes, medicines, and insecticides [International Trade Centre, 2026], Sri Lanka's export value rose from USD 3.9 million in 2016 to USD 17.1 million in 2025, more than four times the 2016 value. Over the same period, global exports rose from USD 3.2 billion to USD 4.6 billion (Figure 2a). Even so, Sri Lanka's share of the global market remains small, at about 0.4%. In 2024, the five largest exporters were China, India, Canada, Germany, and Egypt, while Sri Lanka ranked 41st (Figure 2b).

Figure

Figure

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.

Despite this demand, there is no standard way to identify medicinal plants. Many medicinal plants grow in backyards with little care, and some are even treated as weeds [Waisundara and Watawana, 2014]. Most Sri Lankans know the traditional system and use the plants growing near their homes without the advice of a practitioner, relying on knowledge passed down by their ancestors [Saslis-Lagoudakis et al., 2014]. Identifying plants by hand, however, needs a lot of botanical expertise, and it is costly, slow, and difficult for the general public. Misidentification also matters for conservation. Nearly 15,000 medicinal plant species are threatened worldwide, and 280 plant species are threatened in Sri Lanka. Of the medicinal plants in Sri Lanka, 100–200 species are threatened [Nilaweera, 2010], including Abarema begimena, the Ashoka tree (Saraca asoca), the Beautiful Leaf (Calophyllum trapezifolium), and Aglala apiocarpa. The IUCN classes threatened plants as Critically Endangered, Endangered, or Vulnerable.

Automatic identification from images is a promising solution, but existing work has several gaps. Most algorithms learn from images, so image quality strongly affects performance. Researchers therefore use the built-in cameras of mobile

A PREPRINT

devices [Waldchen and Mader, 2018] or special cameras and scanners, and there are rules for taking the photographs, such as a single leaf, good lighting, no shadows, and a fixed line of sight angle [Goyal et al., 2018]. Most studies use secondary datasets such as Flavia and Swedish [Goyal et al., 2018, Waldchen and Mader, 2018]. These datasets contain few plant species [Goyal et al., 2018, Waldchen and Mader, 2018], so researchers often collect their own images, and no database of Sri Lankan medicinal plant leaves was available.

Images of leaves, flowers, bark, and fruit [Waldchen and Mader, 2018] have all been used to train classification models. Leaves carry many useful features and are easy to collect, so most researchers use them, and most work focuses on shape features [Goyal et al., 2018]. Shape features alone, however, are not enough to train a reliable model, which raises the question of which features matter most for classifying plant species. Existing algorithms are mostly built on CNN, ANN, PNN, and KNN architectures. These models need a lot of memory and computing power, and although they can predict well, they are hard to interpret. We address these gaps with an image feature-based statistical machine learning algorithm.

Our main objective is to develop an automatic algorithm that classifies medicinal plants from leaf images using statistical machine learning. To reach it, we pursue four supporting objectives. First, we build and share a repository of medicinal plant leaf images from Sri Lanka. Gathering leaf samples is slow, so sharing the database gives other researchers data to train and test their own algorithms. Second, we identify features that are useful for classifying medicinal plants from leaf images, which contain a large and diverse set of features such as shape, veins, edges, and apices, and we develop an algorithm to extract and quantify them. Third, we use high-dimensional visualization to show what happens inside the trained algorithm. Fourth, we release the algorithm as open-source software for identifying Sri Lankan medicinal plants from leaf images.

This research can help avoid misidentification of medicinal plants in Sri Lanka, which supports conservation and ecological efforts. Leaves are easy to collect without damaging the plant, so developing and using the algorithm does no harm to the plants. The algorithm is also hierarchical: users can follow its first two levels even if they do not know the exact species name, which may reduce misidentification and computation time.

The remainder of this paper is organized as follows. Section 2 describes the materials and methods, including the datasets, the image processing and feature extraction pipeline, the hierarchical classification framework, and an exploratory analysis of leaf morphology in the Ruhuna dataset. Section 3 presents the results: the two classification experiments, a comparison with benchmark algorithms, visualization of the trained model using linear discriminant analysis, and feature importance at each level of the hierarchy. Section 4 discusses the findings and their limitations, and Section 5 concludes and outlines future work.