Keywords

1 Introduction

The nature has given innumerable objects to view and to use them according to our requirements, but before starting to use them, our eyes must discern one object from the other. Once our brain has seen the characteristic features of the object of concern, we name it, and keep a copy of the object for future use. This copy of the image helps a person in segregating one object from the other. In computer based automatic classification of the images, several methods have been proposed in machine vision studies, which try to imitate the human visualization system. In a natural image, one portion of the scene has a boundary clearly demarcated from the other by its edges and ridges. The digital images are full of patterns inclined to angular positions. Therefore, getting appropriate information about the feature pattern helps in proper classification of digital images.

In case of leaves, nature provides two faces to the leaves i.e. dorsal or the front side and the ventral or the back side which is not the case for other types of objects. The classification on the basis of the dorsal side of the objects including leaves has been done by many researchers [13]. The role of ventral side of a leaf image in classification of data set remained untouched, therefore, there is a drastic need to study the role of ventral or the back side of the leaf in discriminating the leaf images because of the presence of prominent venation patterns.

The leaf image classification can be done by using leaf’s geometrical features, texture and shape based features and color features [13] etc. A digital image is composed of pixels of different intensity values, the change in intensity values around the images leads to a scene with visible objects, if there is no change in the intensity, there is no image formation and this change in intensity values occur in a particular direction in the image. The concept of directionality histogram has been used for the characterization of brain micro-device interface using the device capture histology [4] and for 3D microstructure modeling of long fiber reinforced thermoplastics [5]. The concept of directionality also finds its use for finding texture features using the method of directionality histogram on geometric property of images [6].

In statistical jargon, a sample is a subset of values taken out from a digital image for understanding its characteristic properties through which detailed statistical analysis can be performed by utilizing first order statistics like mean, mode, median and standard deviation etc. for discriminating the images into various classes.

This work has tried to extract the various statistical features and directional features from the digital images and observing their effects in automated classification of digital images on the dorsal side, ventral side and combined dorsal-ventral sides. The statistical features like Mean Gray, Median, Integrated density, Skewness, Kurtosis, Standard Deviation, First order spatial moments (XM, YM) and Minimum Gray value have been computed for the dorsal, ventral and combined dorsal-ventral sides. We have computed the directional features like direction, dispersion and fitness etc. on the dorsal, ventral and combined dorsal-ventral sides of the leaf images. These directionality feature sets have been combined with the statistical feature sets for different sides. The classification algorithms like K-Nearest Neighbor (KNN), J48, Classification and Regression Tree (CART) and Random Forest (RF) have been used for classification of statistical features as well as combined statistical-directionality feature sets. The objective of this work is to find out whether the ventral side of the leaf image can be considered for leaf image classification or not and can the classification accuracy be improved by adding directionality features with the statistical features. The paper has been divided into different sections, where Sect. 2 describes the methodology adopted, Sect. 3 highlights the results and analysis and Sect. 4 states the conclusion.

2 Methodology Adopted

2.1 Database Creation

The leaf image data set with dorsal side is available from several sources including that of [79], but to study the objective of this work, i.e. to utilize both the dorsal and the ventral faces of the leaf images, the creation of a leaf image database was required with both the ventral as well as dorsal sides of the leaves. For the experimental research work, we have captured the images of dorsal and ventral sides of the leaves of 10 different plants which include: Helianthus annuus L., Psidium gujava, Alcia rosea, Jasminum sambac, Calotropis acia, Sarace indica, Cordia sebestena, Manilkara zapota, Hibiscus laevis, Ficus religiosa as shown in Fig. 1 using Sony Cybershot HX200V with 18.2MP “Exmor RTM” CMOS Sensor with extra high sensitivity technology, 30x optical zoom. The captured images include 25 dorsal side and 25 ventral side images for each of the above mentioned leaf categories totaling a sample size of 500 images with a pixel size of 1080 × 920.

Fig. 1
figure 1

Colored sample of dorsal and ventral sides of the leaf images

All the colored images were converted into 8-bit gray scale and their size was reduced to 256 × 256 which reduced the size of the database and a stack was created using ImageJ (ver. 1.44) [10].

2.2 Preparation of Statistical Feature Set

Since, there are a variety of images available like X-ray images of the body parts, traffic scene etc., and all the images are different from one another but there are certain features which can be captured so that the images can be represented with minimum number of bits.

In an image, a pixel can take any value randomly from a set of values that appear in the same grid. Therefore a pixel becomes a random variable and the image becomes a random field.

The following statistical features have been extracted from the leaf image dataset for dorsal, ventral and combined dorsal-ventral sides [10]. The scale of calibration has been set in millimeter (mm).

  • Mean Gray value: The mean gray value is calculated by making a selection of the region of the image and then mean value is calculated as mentioned in Eq. (1).

$$ \mu = \frac{1}{{N^{2} }}\sum\limits_{i,j = 1}^{N} {P_{i,j} } $$
(1)
  • Median value: The median value of the pixels in the selection region is the median of the data.

  • Integrated Density (IntDen): The integrated density is a product of Area and Mean gray values.

  • Skewness (Skew) and Kurtosis (Kurt): Spatial moments are a very simple and powerful way to describe the spatial distribution of values. Skewness measures the third order moment about mean, whereas the kurtosis measures the fourth order moment about the mean as mentioned in Eqs. (2) and (3) respectively.

$$ {\text{Skewness}} = \mu_{3} = \frac{1}{{N^{2} \sigma^{3} }}\sum\limits_{i,j}^{N} {\left( {P_{i,j} - \mu } \right)^{3} } $$
(2)
$$ {\text{Kurtosis}} = \mu_{4} = \frac{1}{{N^{2} \sigma^{4} }}\sum\limits_{i,j = 1}^{N} {\left( {P_{i,j} - \mu } \right)^{4} } $$
(3)
  • Minimum Gray Value (Min value): This represents the minimum gray value of the selection region.

  • Standard Deviation (StdDev): Standard Deviation of the gray values finds the mean gray value of the data. Standard Deviation is the square root of variance (\( \sigma \)):

$$ {\text{Variance}} = \sigma^{2} = \frac{1}{{N^{2} }}\sum\limits_{i,j = 1}^{N} {\left( {\left( {P_{i,j} - \mu } \right)^{2} } \right)} $$
(4)
  • First order spatial moments (XM and YM): This is the brightness-weighted average of the x and y coordinates of all pixels in the image or a selection.

2.3 Preparation of Directionality Feature Dataset

A digital image is made up of pixels of various intensity values which may vary over the entire region of the image space. This leads to the formation of texture structures in the images which can be studied with the help of directionality. The basic concept of directionality in the digital images was given by Liu [11]. According to [11], when Gaussian filter as represented by Eq. (5) is applied to the image coordinates (x, y), with different scale (σ), it generates sets of images with different levels of smoothness. The next step is to find the edges in the images which can be obtained by finding the Laplacian of Gaussian (LOG) as mentioned in Eqs. (6) and (7).

$$ g(x,y,\sigma ) = \frac{1}{{2\pi \sigma^{2} }}\exp \left[ {\frac{1}{2}\left( {\frac{r}{\sigma }} \right)^{2} } \right] $$
(5)

Here, \( r^{2} = \left( {x^{2} + y^{2} } \right) \) and \( \left( {x,y} \right) \) represents the image coordinate values.

At the edges, the intensity of the pixels changes rapidly i.e. the zero-crossing detector looks for the places in the image where the Laplacian passes through zero. This results in the generation of binary image with single pixels thickness lines showing the position of zero crossing pixels, which is represented through Eq. (7). The Laplacian highlights the regions of rapid change which is used in edge detection.

$$ L\left( {x,y} \right) = \frac{{\partial^{2} I}}{{\partial x^{2} }} + \frac{{\partial^{2} I}}{{\partial y^{2} }} $$
(6)
$$ {\text{LOG}}\left( {x,y} \right) = \frac{ - 1}{{\pi \sigma^{4} }}\left[ {1 - \frac{{x^{2} + y^{2} }}{{2\sigma^{2} }}} \right]e\left( {\frac{{ - \left( {x^{2} + y^{2} } \right)}}{{2\sigma^{2} }}} \right) $$
(7)

According to Witkin [11], a concept of scale space can be applied to find information in images and it can be expressed as Eq. (8)

$$ \psi \left( {x,y;\sigma } \right) = \left\{ {\left( {x,y;\sigma } \right)|z\left( {x,y;\sigma } \right) = 0;\left( {\left( {\frac{{\partial z^{2} }}{\partial x}} \right) + \left( {\frac{\partial z}{\partial y}} \right)^{2} \ne 0,\sigma > 0} \right)} \right\} $$
(8)

where \( z\left( {x,y;\sigma } \right) = \text{LOG}\left( {x,y} \right)*I\left( {x,y} \right) \) and * here represents convolution operation, \( I\left( {x,y} \right) \) is the image and Eq. (8) shows the scale space as applied to images to find the directional information.

The directionality plugin [12] used produces a histogram for the dorsal and ventral leaf image as shown in the Fig. 2. There are 90 bins for a total orientation of 180° that have been used for generating the histogram for the images. The plugin generates a comma separated values file (CSV) with direction column that reports the center of the Gaussian, the dispersion column that gives the standard deviation of the Gaussian calculated above. The amount column gives the sum of the histogram from the center minus standard deviation to the center plus standard deviation divided by the sum of the histogram. The goodness column reports the goodness of the fit and its value is 1 for good and 0 for bad. We have constructed a normalized directional histogram which shows the angles in the horizontal axis and vertical axis shows the percentage of pixels with different gradient angles as shown in Fig. 2. The major role of directionality is to find the amount of structure in a given direction in the digital image.

Fig. 2
figure 2

Directionality histogram for, a dorsal, b ventral sides of the leaf images

2.4 Application of Classification Algorithms

To find the classification accuracy, the KNN, J48, CART and RF classification algorithms have been used on the data sets obtained in Sects. 2.2 and 2.3 using “Caret” package under RStudio [13]. The datasets obtained from Sects. 2.2 and 2.3 are combined to find the effect of directionality on the statistical feature sets on the classification accuracy for the dorsal, ventral and combined dorsal-ventral sides of the leaf images [10, 12]. Each data set was split into two groups (Training and Testing sets) in the ratio 70:30. To obtain an accurate estimate to the accuracy of a classifier, k-fold cross validation is run several times, each with a different random arrangement of data sets. We have used 10-fold cross validation for the resampling process.

The accuracy for the analysis purpose have been calculated where the term accuracy refers to the number of times a correct match has been found for a particular leaf image in the dataset.

The classification accuracy for statistical features is shown in Fig. 3a and the combined statistical-directionality features is shown in the Fig. 3b for dorsal, ventral and combined dorsal-ventral sides of the leaf images.

Fig. 3
figure 3

Classification accuracy for, a statistical, b statistical-directionality feature sets

3 Results and Analysis

3.1 Analysis of the Results on the Basis of Statistical Feature Set

As shown in Fig. 3a, the Random Forest (RF) classification algorithm is giving the highest accuracy values for dorsal, ventral and combined dorsal-ventral sides of the leaf images. Statistical feature set alone gives 83.92 % accuracy for ventral side using Random Forest which is more than the accuracy of dorsal (78.87 %) and combined dorsal-ventral (81.81 %) as represented in Fig. 3a.

3.2 Analysis of the Effect of Directionality Features on Combining Them with Statistical Features Sets

By comparing the Fig. 3a, b, it is analyzed that the overall accuracy for classification of leaf image data has been increased with the addition of directionality features into the statistical feature set. As in Fig. 3b, the classification accuracy is 88.54 % for ventral side, 86.18 % for combined dorsal-ventral side and 84.05 % for dorsal side of the leaf images as compared to accuracy shown in Fig. 3a i.e. 83.92, 78.87 and 81.81 % respectively. Therefore the overall accuracy has been increased for all the datasets by adding the directionality features with the statistical feature sets. The directionality features added additional information extracted from leaf images which resulted in improved accuracy results in all the sides of the leaf images.

3.3 Analysis on the Basis of Sides of the Leaf Images

The Random Forest algorithm is an ensemble learning technique used for classification and regression operations and based on the principle of constructing a multitude of decision trees at training time and it outputs the class that is the mode of the classes (in case of classification) or average prediction (in case of regression) of the individual trees. With the help of ensemble learning technique, it allows the algorithm to learn accurately both simple and complex classification features for the dataset.

As we are using a large number of variables in a dataset, and each variable due to its interaction with the other variable creates its own importance. The Random Forest algorithm estimates the importance of the variables by finding out by how much the prediction error increases when out of bag data is presented to the algorithm. The computations are done tree by tree as the random forest is constructed. This methodology of RF algorithm [14] makes it a better classifier as compared to other algorithms used.

As shown in Fig. 4, the ventral side is giving higher accuracy as compared to dorsal and combined dorsal-ventral sides of the leaf images for statistical feature set (83.92 %) and statistical-directionality combined feature set (88.54 %). This proves the assumption of this study, that ventral side can be considered for the classification purpose of the leaf images.

Fig. 4
figure 4

Comparison chart for classification accuracy of different sides of leaf images using RF

4 Conclusion

From Sect. 3.2, and Fig. 3, it has been observed that the directionality features with statistical feature sets improves the classification accuracy for dorsal, ventral and combined dorsal-ventral sides. On the basis of the results shown in Fig. 4 and Sect. 3.3, we propose to consider the ventral side of leaf images for the classification purpose which fulfills the objective of this research.