Leaf-based Classification of Important Indigenous Tree Species by Different Feature Extraction Techniques and Selected Classification Algorithms

—The machine learning algorithms, namely, k - Nearest Neighbor (KNN), Support Vector Machine (SVM), Back-Propagation (BP) networks, and Convolutional Neural Networks (CNN) are four of the mostly used classifiers. Different sets of features are required as input in different application domains. In this paper, a set of significant leaf features and classification model was determined with a high accuracy in classifying important indigenous tree species. Leaf images were acquired using a scanner to control the image quality. The image dataset was then duplicated into two sets. The first set was labeled with their correct classes, preprocessed, and segmented in preparation for feature extraction. The leaf features extracted were leaf shape, leaf color, and leaf texture. Then, training and classification was done by KNN, SVM, and BP networks. On the other hand, the second set was unlabeled for training and classification by CNN. A CNN model was built and chosen with the best training and validation accuracy and the least training and validation loss rate. The study concluded that using all three leaf features for classification by BP networks resulted in a 93.48% accuracy with training done by supervised learning. However, the CNN achieved a high accuracy rate of 98.5% making it the best approach for classification of tree species using digital leaf images in the context of this study.


INTRODUCTION
Computer vision is divided into image acquisition, image preprocessing, feature extraction and description, and classification. In the case of plant species classification, an image of a part of a plant is acquired using a camera. The image is then preprocessed in preparation for the next step. Operations include eliminating noise, correcting geometric distortions or degraded image data, and segmentation. The aim is to emphasize the features of the image that are relevant for further processing while suppressing the undesired distortions. After image preprocessing, features are then extracted based on the descriptors established. These descriptors are a set of numbers that describe the part of the plant in the captured image. Finally, the plant species is recognized using all the features that have been extracted [1].
Feature extraction is a vital stage in image-based classification when it comes to the accuracy and precision of the classifier. This is because the underlying machine learning principles utilize the features that are supplied into the network.
Feature extraction techniques need to be selected thoroughly so that the image is well-perceived hence, providing the classifier enough information for a more accurate and precise classification [2].
After all the features of the subject in the image have been understood, classification is done by a mathematical classifier. There are numerous classification algorithms and each one requires a different set of features as input. Among the mostly used classifiers for image processing are k-Nearest Neighbor (KNN) algorithm, Support Vector Machine (SVM), Back-Propagation (BP) networks, and Convolutional Neural Networks (CNN) [2,3,4,5,6,7,8,9]. In this study, the accuracy of classification of each of the algorithms were measured to determine which is best for leaf-based tree species classification.
Leaves are the suitable plant organs for computerized plant classification as these are numerous and acquired for most of the year rather than flowers and fruits since plants produce these in a limited period [10]. This is especially true for trees since it may take years to produce flowers and fruits. The bark of a tree is another organ aside from its leaves that can be used for tree recognition. Although these two organs are present throughout the year, tree recognition based on its bark can be very difficult and can add confusion [11]. In this study, leafbased tree species classification was done using computer vision techniques.
As mentioned previously, the classification algorithms, KNN, SVM, BP networks, and CNN, require different sets of features extracted from an image for an accurate classification. These sets of features will always differ for different application domains. In the case of leaf-based tree species classification, there is a need to determine the significant features to be extracted so that there is a high accuracy in classifying tree leaf species.
The general objective of the study aimed to determine which combination of leaf features and classification algorithm provides an accurate and consistent classification of tree species through tree leaf images. Specifically, this study aimed to: (1) extract features from digital images of leaves of important indigenous tree species using image processing techniques, (2) implement classification algorithms for tree species classification, and (3) evaluate the accuracy of each of the classification algorithms. 35 | P a g e www.ijacsa.thesai.org Tree species classification has always been essential for understanding biodiversity conservation. Forests function well if there is a diversity of trees as they gather nutrients, which are then released when the trees die and decompose. These functions include growing wood to be used for furniture and timber among others, counteract climate change, and prevent soil erosion and regulate the water cycle. Forests that have diverse trees should provide better ecosystem goods and services to humans than those that have monocultured trees [12]. Scientists working to document and study forest flora and fauna, which is key to biodiversity conservation, are overwhelmed with the rich forest species biodiversity due to limited taxonomic expertise making it very difficult to abate the rapid degradation of forests [13]. On the other hand, inexperienced persons will even find it more difficult to classify the surrounding trees. Hence, the development of a program with enough tree taxonomic knowledge that enables recognition of tree species in a quick manner is significant to overcome this challenge. With the proposed tree recognition system, users will now have a tool that can classify trees. Users will be given good information and are likely able to make informed choices about which trees are suitable for biodiversity conservation. This paper continues first by investigating which leaf features are commonly used in leaf classification in previous works. Then, KNN, SVM, BP networks, and CNN are also investigated in previous works. The performance of these classification algorithms against datasets in previous works were noted as well as the leaf features used for leaf classification. Next, the paper explains how the dataset was prepared for supervised and unsupervised learning and for classification. The results are then discussed, and the accuracy of the classifiers are indicated. The paper then concludes which classification algorithm worked best in the context of this study, and recommendations are also mentioned for future work.

A. Leaf Features
There are many techniques that have been introduced to extract features from digital leaf images. Leaf shape is the most common extracted feature for classification. It is often used because of significant differences between leaf shapes of different plants. Important indigenous tree species in Leyte exhibit differences in their leaf shapes as well. Among the various works on leaf classification, the most common extracted representations of shape features are the following: aspect ratio, eccentricity, compactness / roundness, and rectangularity [14,15,16].
In some research, the leaf's texture is also considered in its classification [14,17,18,19]. This is also an effective way of differentiating leaves as some have different textures compared to others, especially at a very small scale. The grey level cooccurrence matrix (GLCM) is commonly used to extract the leaf texture features. There are 14 textural features suggested to be computed [20]. These statistical features determine differences in the intensity of the pixels and the spatial relations between them.
Leaf color can also be used for plant species classification especially when there is a difference in leaf color among different species [17,18]. Leaf color features are usually extracted along with another attribute, usually leaf shape and texture, when there is a subtle difference between leaf color among the species. Leaf color features are represented by the distribution of color in the image in each of the three color planes (red, green, and blue). If an image follows a certain distribution, then the color features can be used to identify the image.

B. Mathematical Classifiers
This study assessed which of the classification algorithms, namely k-Nearest Neighbor, Support Vector Machine, Back-Propagation networks, and Convolutional Neural Networks would provide the most accurate results when classifying tree leaf images of important indigenous tree species. Related research works regarding the use of the algorithms are investigated. The commonly extracted features utilized by the classifiers are also taken into consideration.

1) k-Nearest Neighbor (KNN) algorithm:
The author in [15] implemented the k-Nearest Neighbor (KNN) classifier for tree taxonomy. The leaf's shape features were extracted. It was concluded that the classifier best performed when eccentricity, a moment invariant and maximal indentation depth were the features used. The performance of the KNN classifier was low when all the features were used. This was because some of the features were redundant and hindered the success rate. Also, the success rate improved to almost 90% when the user inspected more nearest neighbors (specifically, when the k-value was 10). The author in [16] used three shape features: slimness (aspect ratio), roundness (compactness), and dispersion for classifying leaves using the KNN algorithm. The Flavia dataset was used which consists of 32 classes of 1907 leaf images. The classifier performed best when the kvalue was 3, with an overall accuracy of 94.37% in classification. The author in [14] combined leaf shape features and leaf texture features for classifying leaves using the KNN algorithm. The shape features included aspect ratio, rectangularity, narrow factor, circularity, and solidity. Meanwhile, contrast, homogeneity, correlation, and energy were the texture features extracted using grey level cooccurrence matrix (GLCM). The classification had an accuracy rate of 94%. The author in [6] used leaf venations in identifying selected dicot plant species. The leaf venations were represented as a graph and relevant graph metrics were computed. Each of the graph metrics of the plant species served as input to different classifiers including the KNN algorithm. The study also used the Support Vector Machine (SVM) and Back-Propagation (BP) networks, specifically, Multilayer Perceptron (MLP), mathematical classifiers which are discussed in the next sections. The KNN classifier achieved an accuracy of 21.64% while the SVM and MLP classifiers reached 24.85% and 23.65%, respectively. According to the authors, this was due to the low cardinality of the dataset which was only ten leaves for each of the 50 plant species. www.ijacsa.thesai.org 2) Back-Propagation (BP) networks: In [21], the accuracy rate of back-propagation (BP) neural networks and k-nearest neighbors (KNN) were compared. It was concluded that the BP networks produced a higher accuracy rate of 93.3% than the KNN, which had an accuracy rate of 85.9%, for a large dataset. For an otherwise small dataset, the KNN classifier outperforms the BP networks approach. The author in [10] also used BP networks in leaf-based classification of plants. The classifier produced 96% accuracy rate in classification. Both studies used the Flavia dataset and used shape features for classification.
3) Support Vector Machine (SVM): The author in [18] utilized SVM for plant leaf recognition. The authors extracted the leaf texture and color features which were used by the classifier. With color features alone, the classifier produced low accurate results. This was because of the high similarity between the colors of the leaf images. But, when texture and color features were used, the accuracy rate of classification went up to 92%. The author in [17] also extracted leaf texture and color features for use of the SVM classifier. According to the authors, SVM performs well when compared to the KNN classifier. The system implemented in their work attained an average accuracy of 93.26%. The author in [19], on the other hand, only extracted texture features for classification using SVM. The classifier had an accuracy of 90.27%. The authors concluded that this may be improved if other leaf features could also be considered.

4) Convolutional Neural Networks (CNN):
In the study [7], CNN was employed for plant leaf recognition. The image dataset used was the Flavia dataset and the sizes were changed to 229x229 to fit the model. The structure of their proposed model had five convolution layers followed by their proposed inception module, then the pooling layer of size 8x8. Input images also included discolored leaves and damaged leaves. Despite the discoloration and damage of the leaves, the system has a recognition rate of above 94%. Another work in [8], uses a deep convolutional network model. It consists of 16 weight layers: 13 convolutional layers and 3 fully connected layers. The Flavia dataset was used, and the input images were resized into 224x224 pixels. Data augmentation was also performed which added the transformations of the initial image dataset as input. Because of this, using deep convolutional neural network, the system achieved an accuracy of 99.9%. The author in [9] also used data augmentation on the Flavia dataset. In their work, the images were resized to 256x256 pixels. There were three convolutional layers with an addition of a PReLU activation function after each convolution. The accuracy rate for the trained model is greater than 94.6% on 32 kinds of plants.

III. METHODOLOGY
The tree species identified were limited to important indigenous tree species in Leyte due to the small number of tree classes which can all be classified through the tree's leaves. The 25 tree species to be classified are listed in Table I. The leaves of important indigenous trees were collected from the forest reserve of the Visayas State University. The trees from which the leaves were collected have already matured spanning the ages between 15-20 years old. The framework shown in Fig. 1 depicts the different processes that were involved in the study which mainly applies image processing and the leaf classification techniques. Supervised learning is when the dataset was labeled. This was when KNN, SVM, and BP networks were used for training. Meanwhile in unsupervised learning, the dataset used was unlabeled and CNN was used for the training phase.

A. Image Acquisition and Preparation
With the help of an expert on taxonomic classification of important indigenous tree species, leaves were collected and scanned immediately using a scanner to control the image quality. The images were manually categorized according to its species and stored in their respective folders. A sequence of pre-processing techniques was performed that would make these images appropriate for extracting related information. The techniques included cropping, to emphasize the region of interest; scaling, to reduce the image size; and applying noise removal operation, to improve the image quality.

B. Image Segmentation
The leaf images were first converted into grayscale. Afterwards, Gaussian filter of size (25, 25) was applied to smooth the image. Next, adaptive image thresholding using Otsu's thresholding method was applied. Lastly, morphological closing was applied to close any holes present in the leaf. Fig. 2 shows how the image was transformed in preparation for feature extraction.

C. Feature Extraction
Feature extraction was performed to get useful information that served as basis for leaf classification. Shape, color, and texture features were extracted from the leaf images. Boundary extraction was first done before calculating the shape features. Leaf boundary extraction was done using contours. The shape features that were calculated from the leaf images are area, roundness, aspect ratio, eccentricity, and rectangularity. For leaf color feature extraction, the original colored image was converted from RGB to HSV to get the hue, saturation, and value. The mean, standard deviation, skewness, and kurtosis of the HSV values were calculated. The texture features were extracted using the grey level co-occurrence matrix (GLCM). The 14 Haralick textural features (angular second moment, contrast, correlation, etc.) were computed. The original colored image was converted from RGB to grayscale before computing for the 14 features.

D. Feature Selection
All the extracted features, especially the texture features, may be correlated to each other. This means that there may be redundant features that do not contribute information for classification. So, feature selection was employed to find the most suitable features to improve the accuracy of classification. Feature selection was done using Pearson's correlation through the Waikato Environment for Knowledge Analysis (Weka) tool.

E. Training and Classification Phase
The training dataset was composed of 80% of the total number of acquired images. To determine which set of leaf features was best for classification, shape, texture, and color features were first used individually for training and classification then, a combination of two features, and finally, all three leaf features were used as basis for classification. The KNN, BP, and SVM classification algorithms were used for training and classification of the tree leaf species through the Weka tool.
For training and classification through CNN, TensorFlow was used to build the classification model. 80% of the image dataset was also used for training and 10% of the image dataset was used for validation. The mini-batch gradient descent learning algorithm was applied on the dataset with 32 batches processed at each time. This means that 789 batches per epoch were processed to go over the 25,271 images. The learning process went for 250 epochs and the validation dataset was used as reference to determine the performance of the model for each epoch. When compiling the model, the standard cross-entropy loss was used to calculate the error rate of prediction from the original value. Categorical class classification was used to predict from 25 tree species/classes. The adam optimizer was used to adjust how the model learns during the training process. Finally, the accuracy was used to determine how the model can correctly predict the tree species using the validation dataset during training phase. www.ijacsa.thesai.org

F. Testing Phase
The remaining 20% of the total number of images was used as test dataset. The same feature extraction processes were performed on the dataset and then classification was carried out by the classifiers. For testing the best CNN model, 10% of the image dataset was used. The accuracy of the classifiers was computed using (9)

G. Building the CNN Model
The CNN architecture used in this study, shown in Fig. 3, was inspired by a similar architecture albeit with modifications to the parameters and configurations used in [22]. The dataset first passes through convolution layers followed by activation layers, and then pooling layers. This sequence of layers is repeated twice to add more hidden layers. Lastly, the fully connected network acts as the classifier for the model. The convolutional layers extract features from the input images. The number of filters follows the trend of 32-64-128 filters. Rectified Linear Unit (ReLU) activation was used for the activation layers. Pooling layers have a filter size of 2x2 with a stride of two which shrinks the dimensions of the data by half. After passing through the convolution-activationpooling sequence twice, the final output was flattened into a vector and fed into a fully connected dense network. The first dense layer has 256 nodes followed by a batch normalization layer which standardizes the input before being activated by a ReLU function. Dropout layer follows next to prevent overfitting. The last dense layer has 25 nodes activated by softmax activation layer which allows the model to predict from 25 tree species with the highest probability. Table II depicts the layers and their corresponding output shape as well as the number of parameters.

IV. RESULTS AND DISCUSSIONS
The total number of leaf images scanned is 31,508. This includes both the top and underneath sides of the leaf. The distribution of the images per tree species is shown in Table III.

A. Supervised Learning Results
The shape, color, and texture features were computed through Python code and saved in a .csv file. These were then used for training and classification by KNN, SVM, and BP networks using Weka. Fig. 4 shows the accuracy of the classifiers with the corresponding leaf features as input. The individual sets of leaf features produced relatively low values of accuracy, the lowest being only 51.3% using the leaf color features by the SVM classifier. As the number of leaf features used was added, the accuracy improved. Among the two sets of leaf features used, color and texture features produced the best accuracy by the three classifiers with BP classifier having an accuracy of 90.65%. With the color, shape, and texture features used, the KNN classifier displayed 91.873% accuracy, and the SVM classifier displayed 89.873% accuracy. Meanwhile, the BP classifier showed the best accuracy among the three with 93.4762%. Table IV shows the time taken to build the models with the corresponding combination of leaf features extracted. Using the model built through back-propagation network, a confusion matrix was derived. Table V shows a high performance of the BP model in classifying tree species through leaf images with up to 99% precision.

B. CNN Model Results
The training and validation performance of the CNN model is shown in   The trained CNN model at epoch 249 was used for classifying the testing image dataset. Out of 3,151 images, the model was able to correctly classify 3,104 leaves according to their tree species. Therefore, the model has an accuracy rate of 98.5%.
A confusion matrix was derived from classifying the 25 tree species using the CNN model. Evaluation metrics were derived from the confusion matrix as shown in Table VII. This reflects the model's high performance in classifying the 5 tree species especially the bitanghol and tanguile tree species with a recognition rate of 100%.

V. CONCLUSIONS AND RECOMMENDATIONS
The study was able to extract the leaf color, shape, and texture features from digital images of leaves of important indigenous tree species using image processing techniques. A combination of these features was used for classification by three machine learning algorithms: k-Nearest Neighbor algorithm, Backpropagation networks, and Support Vector Machine. Among the possible leaf features combinations, it shows that using all the three features provides higher accuracy of classification compared to using just one or a combination of two leaf features. BP networks also provides the highest accuracy with 93.48% out of the three supervised machine learning algorithms for this study. However, the model built using Convolutional Neural Network has an accuracy rate of 98.5% making it the best approach for classification of tree species using digital leaf images in the context of this study.
It is recommended to include more tree species for classification as well as adding more shape features, and even more leaf features like leaf venation, in the case of supervised learning. This may reduce the likelihood of Type I and Type II classification errors. Modifying the configurations in building the CNN model is also recommended to further increase the accuracy rate. The models could also be trained in order to recognize unknown classes or images that are outside of the training dataset. Additionally, using other devices to acquire more detailed leaf images, such as digital SLR cameras or hyperspectral imaging devices, could also be used to extract more features from leaves for a more accurate classification.