Medleaf Detection using Image Processing Algorithm

Download Full-Text PDF Cite this Publication

Text Only Version

Medleaf Detection using Image Processing Algorithm

Prof. Archana Ekbote Department of Information and Technology.

Vidyavardhinis College of Engineering and Technology Vasai, India

Mohanish Bharambe Department of Information and Technology.

Vidyavardhinis College of Engineering and Technology Vasai, India

Yash A. Meghani

Department of Information and Technology Vidyavardhinis College of Engineering and Technology Vasai,India

Shruti U. Menon

Department of Information and Technology.

Vidyavardhinis College of Engineering and Technology Vasai, India

Abstract India has a prodigious history of utilizing plants as a source of medicines; construed as Ayurveda. But still somewhere in the pace with medicinal science and technology, India has slipped away the essence of Ayurveda.Researchers and healthful practitioners nowadays, in spite of trope that medical care medicines are created utilizing sure plant extracts, are oblivious concerning the healthful the properties of plants.The objective behind the papers is to eradicate this quandary, and hence strives to avail probable users make better utilization of plants with medicinal properties. The dataset consists of numerous images of variants of leaves. The relegation of the leaves is done with the avail of a decision tree. Such a system is a facility to utilize applications which are expeditious in execution additionally. So there is a need to develop an application for leaf for retrieving the medicinal properties of plants. The perception of leaves is done by extracting the features of the leaves from the images.Thus it suggests that such a system obliges is to understand the scrape of not so important properties of many plants and provides insight about the identification and medicinal qualities of leaves.


    Ayurveda, a 5,000 year old natural system or process of healing which has its origins in Indian Vedic culture. Ayurveda is a science of life where Ayur means life and Veda means knowledge or science. Ayurveda reminds us that health is a balanced and dynamic integration between our body, mind, spirit and environment by providing rules on daily and seasonal behavior, routines and diet. Thus, the identification of the ayurvedic or medicinal plants requires an expertise in the field of ayurveda and medicinal plants,but there is a shortage of such experts all across the globe.To conserve and protect the 5,000 year old process there is a need for concrete knowledge about the medicinal plants.One such initiative involves an automated system that would acknowledge and give all the information regarding the plant. Identification of the plant can be done from leaves, fruits, roots, etc. But for a computer vision to identify a 3D object is very difficult. Except for the leaf, all other parts are 3D objects and increase the complexity. However, plant leaves are 2D objects which carry sufficient information to recognize the plant. The process involves leaf image acquisition by camera or other electronic devices,feature extraction and classification of the leaf is done.


    T. Sathwik, R. Yasaswini et al. [1] developed a plant recognition and identification method using texture features,where a statistical and algebraic approach has been used which gives the quantitative measure of the pixel arrangements in a region.P. Pallavi, V.S. Veena Devi et al. [2] used the Zernike moment methodology and extracted the features of the leaf.The limitation of this paper was that the methodology did not work efficiently for complex images and it did not showed proper results for big size images.Amala Sabu,Sreekumar K.,Rahul Nair et al. [3], a new approach for plant leaf classification in which treat Histogram of oriented Gradients (HOG) as a new representation of shape and Speed Up Robust Feature (SURF) features in combination .Janani et al. [4] identify the medicinal plants based on leaf feature using Artificial Neural Networks(ANN).Manojkumar P.,Surya C.,Varun P. Gopi et al. [5] used Binary image for morphological erosion and dilation. GLCM technique was used for extraction of texture features and Weka classifier for identifying the plant leaf. Vijayashree T., Dr.A. Gopal et al.

    [6] converted the leaf image into grayscale on which the edge detection was done by using Sobel Edge detection rather than Perwitt edge detection.They extracted 8 textural features from GLCM of the leaf image and used these for classification using least dissimilarity method.. E.Sandeep Kumar and Viswanath Talasila et al. [7] discussed the Gaussian distribution of the leaf feature that serves as an effective classifier. In this paper, a survey on various algorithms like Probabilistic Neural Network(PNN) Support Vector Machine(SVM), Principal Component Analysis and the texture base analysis used to detect a plant leaf.


    1. Database

      There was no standard database or dataset of medicinal plant leaves for conducting the experiments. Different medicinal leaf images were collected from a botanical garden and plant leaves from other sources were combined together to form a dataset. 20 leaves were collected from 100 different plant species used for

      Ayurvedic medicines.The front and back sides were scanned and the images were stored in .jpeg format for further processing. The images of individual leaves were then separated and transformed to a uniform resolution.The images of leaves of plant species in the database is shown from Fig A (a,b).

      Fig. A(a).Front Side of the Leaves from Dataset

      Fig. A(b). Back Side of the Leaves from Dataset

    2. Model of the Proposed system

      • The image is captured by any of the electronic devices.

      • Image preprocessing is done initially.In which the colored(RGB) image is converted into Grayscale to reduce the complexity of processing the image

      • After preprocessing the plant leaf images, Features of the leaf image is extracted.

      • Global features descriptors quantify the image globally.

      • Some of the commonly used global feature descriptors are Color, Shape and Texture

      • Local features descriptors are feature descriptors that quantifies Scale Invariant Feature Transform, Speeded Up Robust Features, Oriented Fast and Rotated BRIEF, Binary Robust independent Elementary Features.

      • After extracting, concatenating global features and labels from our training dataset, its time to train our system. To do that, we need to create our Machine Learning models.

      • After extraction of the global and local features classification of the sample input image

        Fig B(a). Proposed System Architecture

    3. Feature extraction

      Features are the information or list of numbers that are extracted from an image. These are real-valued numbers

      (integers, float or binary). There are a wider range of feature extraction algorithms in Computer Vision.

      When deciding about the features that could quantify plants and flowers, we could possibly think of Color, Texture and Shape as the primary ones. This is an obvious choice to globally quantify and represent the plant or flower image.

      Global feature descriptor:

      These are the feature descriptors that quantify an image globally. These dont have the concept of interest point thus, takes in the entire image for processing.

      • Color Histogram that quantifies color of the leaf..

      • Hu Moments that quantifies the shape of the leaf.

      • Haralick Texture that quantifies the texture of te leaf.

        Some of the commonly used global feature descriptors are,

      • Color – Color Channel Statistics (Mean, Standard Deviation) andColor Histogram.

      • Shape Hu moments,Zernike moments.

      • Texture -Haralick Texture, Local Binary Patterns(LBP)

      • OthersHistogram of Oriented Gradients(HOG), Threshold Adjacency Statistics (TAS)

        1. Hu Moments.

          To extract Hu Moments features from the image, we use cv2.HuMoments() function provided by OpenCV. The argument to this function is the moments of the image cv2.moments()flattened. It means we compute the moments of the image and convert it to a vector using flatten(). Before doing that, we convert our color image into a grayscale image as moments expect images to be grayscale.

        2. Haralick Textures.

          To extract Haralick Texture features from the image, we make use of the mahotas library. The function we will be using is mahotas.features.haralick(). Before doing that, we convert our color image into a grayscale image as haralick feature descriptor expects images to be grayscale.

        3. Color Histogram

          To extract Color Histogram features from the image, we use cv2.calcHist() function provided by OpenCV. The arguments it expects are the image, channels, mask, histSize (bins) and ranges for each channel [typically 0- 256). We then normalize the histogram using the normalize() function of OpenCV and return a flattened version of this normalized matrix using flatten().

        4. Local feature descriptor:

        These are the feature descriptors that quantify local regions of an image. Interest points are determined in the entire image and image patches/regions surrounding those interest points are considered for analysis. Some of the commonly used local feature descriptors are

      • SIFT (Scale Invariant Feature Transform)

      • SURF (Speeded Up Robust Features)

      • ORB (Oriented Fast and Rotated BRIEF)

      • BRIEF (Binary Robust Independent Elementary Features)

        Combining Global feature:

      • For global feature vectors, we just concatenate each feature vector to form a single global feature vector.

        This is the approach we will be using in this tutorial.

      • For local feature vectors as well as a combination of global and local feature vectors, we need something called a Bag of Visual World (BOVW). This approach is not discussed in this tutorial, but there are lots of resources to learn this technique. Normally, it uses Vocabulary builder, K-Means clustering, Linear SVM, and Tf-Idf vectorization.

    4. Classification tools

    K-NN Classifier:

    The K-NN classifier is given some of the data points for training and also a new unlabeled data for testing.The main objective is to find the class label for the new point.The algorithm has different behavior based on K,(where k is the number of neighbors in consideration)K-nearest neighbor algorithm,a method for classifying objects based on the closest training examples in the feature space.Training process for this algorithm consist of only of the storing feature labels and vectors of the training images. In the classification process, the unlabeled point is assigned to the label of its k nearest neighbors. Eventually, the object is classified based on the labels of its k nearest neighbors by majority numbers. If k=1, the object is simply classified as the class of the object nearest to it.


    Multilayer perceptron is a neural network connecting multiple layers which lead to a directed graph.MLP identifies images more accurately. MLP is a very efficient classifier and is mainly used for solving binary classification problems.The future works of Manoj Kumar P.,Surya C.,Varun P. Gopi et al. [5] suggests to use SVM or MLP classifier for having accuracy in the results.

    Random Forest Classifier:

    Random Forest, like its name implies, consists of a large number of individual decision trees that operate as an assembly. Each individual tree in a random forest spits out a class prediction and the class with the most votes becomes our models prediction. A large number of relatively uncorrelated models operating as a committee will outformany of the individual constituent model.

    Fig D.a Classification of Classifiers based on data.


    Fig 4.a Classified test image.


    The extracted features can be calculated for different types of medicinal leaves and thus can be stored in the database which will be the trained as a dataset with result values.The test image will be converted into grayscale image.The image is then pre-processed.Edge detection is done with various algorithms.After Edge detection,feature extraction can be done from GLCM or SURF and HOG.Classification can be done from SVM or MLP classifier.A possible future work is to set up an exhaustive database of medicinal plants and test the proposed methods. An extended database may demand additional feature sets.Venation features is a good choice in this respect. To get better accuracy from classifiers more samples need to be collected from each plant.The proposed methods are not suitable for tiny leaves or plants without a proper leaf. Efforts may be made to develop methods to identify these types of plants. The algorithms may be implemented on a standalone single board computer connected to a scanner and a portable system may be developed for field use.After this future work will be on framing a robust algorithm and making it a trained model with leaf datasets so that when the user gives a dataset in the real-time ,the algorithm matches it with the trained dataset. It then gives to which plant it belongs to and the medicinal values are displayed to the user.


    We thank Prof. Archana Ekbote,Department of Information and Technology,Vidyavardhinis College of Engineering and Technology,Vasai who provided insight and expertise that greatly assisted throughout this project. Also for her constant encouragement and support throughout the work and helping a lot for the preparation of this paper.


  1. T. Sathwik, R. Yasaswini, Roshini Venkatesh and A. Gopal, Classification of Selected Medicinal Plant Leaves Using Texture Analysis, 4th ICCCNT, 4 -6 July 2013.

  2. Pallavi P1 , V.S Veena Devi, Leaf Recognition Based on Feature Extraction and Zernike Moments,International Conference On

    Advances in Computer & Communication Engineering (ACCE – 2014), 21-22 April 2014.

  3. Amala Sabu,Sreekumar K.,Rahul Nair,Recognition of ayurvedic medicinal plants from leaves: A computer vision approach, Fourth International Conference on Image Information Processing (ICIIP),21-23 Dec. 2017.

  4. R. Janani,A. Gopal, Identification of selected medicinal plant leaves using image features and ANN,2013 International Conference on Advanced Electronic Systems (ICAES) 2013.

  5. P. Manoj Kumar,C. M. Surya,Varun P. Gopi, Identification of ayurvedic medicinal plants by image processing of leaf samples,2017 Third International Conference on Research in Computational Intelligence and Communication Networks (ICRCICN), 2017.

  6. Vijayashree T., Dr.A. Gopal, Leaf Identification for the Extraction of Medicinal Qualities Using Image Processing Algorithm,2017 International Conference on Intelligent Computing and Control (I2C2),2017.

  7. E. Sandeep Kumar, Viswanath Talasila, "Recognition of Medicinal Plants based on its Leaf Features", Froc. Of National Systems Conference, llT- Jodhpur, India, December 2013.

  8. D. Venkataraman, Narasimhan, S., Shankar, N., S. Sidharth, V., and D. Prasath, H., Leaf recognition algorithm for retrieving medicinal information, Advances in Intelligent Systems and Computing, vol. 530, pp. 177-191, 2016..

Leave a Reply

Your email address will not be published. Required fields are marked *