Keywords

1 Introduction

Leaf detection and classification is fundamental to agriculture, forestry, rural medicine and other commercial applications. Precision agriculture demands plant leaf disease diagnosis for automatic weed identification [1]; Environment and Forestry needs solutions for automatic tree species identification [2]; rural medicine [3] involves recognition of plant species for deciding upon the suitability of consumption. Freshness of leaves is an important trait for processing tea leaves. The problems in all of the above areas rely upon leaf classification to a larger extent. By taking advantage of the leaf features, advanced machine learning algorithms could be applied for automatic leaf detection. Most of the existing literature on leaf classification focused largely on shape, texture and color based features. In spite of the presence of various big datasets [4] on leaf classification research, learning over high dimensional features of leaf image data is less addressed. This paper proposes deep learning based approaches for plant leaf classification using large feature set in a deep ensemble setting.

2 Related Work

There are many different methods for leaf image classification. Wu et al. [5] adopted multi-spectral image techniques for categorising green leaves. The idea was to use the entropy value of green tea leaf images as texture features. With full training, a support vector machine (SVM) with radial basis function (RBF) kernel successfully identifies the class labels than raw RBF. In addition, a principal component analysis (PCA) at the input of SVM will again improve the classification accuracy [6, 7]. Linear discriminant analysis (LDA) was also used in combination with PCA [8]. Texture estimation [9] is another convincing yet causal research that primarily would contribute to effective leaf classification. Additionally apart from texture features [8], other features like shape, color, venation etc. were also used for improving the classification.

Texture based classification algorithms have been well explored in the recent past [6, 10], scale-invariant feature transform (SIFT) [11], gray level co-occurrence matrix (GLCM), Local Binary Pattern [12], LBP-GLCM [13], wavelet transform and Gabor filter are to name a few. Various improvements to LBP descriptors have also been proposed [14,15,16,17]. Automated leaf image detection literature involves statistical feature matching approaches [18,19,20] for appropriate edge detection. More semantic edge boundaries shall be identified using Arbelaez et al. [18] which is learned over very large datasets [21, 22].

Color and shape feature analysis has been extensively applied over leaf detection literature [23, 24]. Active polygons [25, 26] and active contours [27] are noteworthy to mention. Histograms [28] are widely used for background image separation. For faster detection, leaves required to have a plain white background. Overlapping leaves are also dealt with in literature [28,29,30]. Colour characteristics were predominantly used to distinguish green plants away from soil for leaf area estimation purposes [31,32,33]. Cues like ExG (Excess Green Index) and ExR (Excess Red Index) provided a clear contrast between plants and soil, and has been widely used in separating plants from non-plants [34]. Colour Index of Vegetation Extraction (CIVE) was proposed for measuring growth status of crops. Other combined indices derived upon primary color cues were also proposed [32, 34,35,36].

Alternate algorithms using Mean-Shift methods upon Back Propagation Neural Network (MS-BPNN) and Fisher Linear Discriminant (FLD) proved to improve the quality of segmentation. Other methods like Affinity Propagation-Hue Intensity (AP-HI) and Decision Tree based Segmentation (DTSM) Guo et al. [37] were also proposed. Bai et al. [38] used Particle Swarm Optimization (PSO) based k-means for Lab colour space based clustering. Ye et al. [39] introduced crop image extraction methods for varying illuminations. Other features like leaf tip [40,41,42], leaf base [40,41,42,43], leaf petiole [44,45,46,47,48,49] are also considered for leaf image classification [50,51,52,53,54,55,56,57,58,59]. Texture analysis was combined with shape above margin and base for better classification [60]. Venation of leave [43] was also analysed.

3 Automatic Identification of Leaf Species

The idea is to classify the plant species after proper edge detection and segmentation. The proposed work utilizes Prewitt edge detection algorithm which is discussed in the next subsection.

3.1 Prewitt Edge Detection

Prewitt is a discrete differentiation operator, which computes the gradient approximation of image intensities. In other words, the prewitt operator calculates the point-wise image intensity to capture the smooth variation of leaf image changes at any direction. Horizontal and Vertical intensities are calculated which are then examined for the direction which has the largest possible intensity variations. The operator uses 3 × 3 kernels one each for horizontal and vertical directional changes. For the leaf image, assuming are the two gradient vectors of horizontal and vertical directions respectively, the resulting gradient approximation is given by Eq. (1). The direction of gradient is given by Eq. (1).

$$ G=\sqrt{G_x^2+{G}_y^2} $$
(1)
$$ \Theta = atan2\left({G}_y,{G}_x\right) $$
(2)

3.2 K-Nearest Neighbor Classification

The edge detected leaf images are subjected to classification using k-NN approach. The PSNR value for each image is multiplied by 100 and taken as input to the k-NN code. The k-NN uses Manhattan distance to find the K nearest neighbors and takes a majority vote to classify a particular image. Extra values are taken for normalization and it does not affect the k-NN calculation as same values are used for each dataset, hence distance between them is 0. Leaves of Pipal, Nerium, Neem, Ashoka, Crown flower, Cannonball tree, Hibiscus, Mango, and Curry Tree were considered for examination (Fig 1a). Ten positional variations for each species were captured in mobile phone camera under white background. The algorithm resulted at 72% accuracy for detecting leaf classes across various positions.

Fig. 1
figure 1figure 1figure 1figure 1

(a) Original image of Various Species. (b) Results of Prewitt Edge Detection of various species

Structural similarity values indicated poorer recognition accuracy upon various positions and an overall PSNR evaluated to better values for leaves of Crown flower, Cannonball tree, where lower PSNR values evaluated to worst evaluation for Curry Leaves (Fig 1b). The reason is that the dataset consisted of Neem leaves which are close to Curry leaves’ structure and shape; However crown flower and cannonball tree flowers have distinct characteristics in color, shape, vein and texture which resulted in much higher accuracies (Fig. 2).

Fig. 2
figure 2figure 2

Results of PSNR for k-NN

4 Conclusion

This paper proposed the k-NN approach for leaf image classification for herbal leaf images over various morphological and semantic features. Edge detection approaches performed was robust and convincing to produce close to 72% accuracy. The leaf images were examined for detection across various leaf positions in white background. Extraction of convolutional features and validation using established deep learning algorithms is planned to be explored in future.