Classification and Grading of Arecanut Using Texture Based Block-Wise Local Binary Patterns

: Arecanut is a commercial crop typical to high rain fall regions. Arecanut has economic, cultural and medicinal importance, and is categorized into different types depend upon the region which grow and market it consumes.In this paper, an attempt towards grading of Arecanut images is proposed. The proposed approach makes use of global textural feature viz., Local Binary Pattern for feature extraction. Initially, an image is divided into k number of blocks. Subsequently, the texture feature is extracted from each k blocks of the image. The k value is varied and has been fixed empirically. For experimentation purpose, the Arecanut dataset is created using 4 different classes and experimentation is done for whole image and also with different blocks like 2, 4 and 8. Grading of Arecanut is done using Support Vector Machine classifier. Finally, the performance of the grading system is evaluated through metrics like accuracy, precision, recall and F –measure computed from the confusion matrix. The experimental results show that most promising result is obtained for 8 block of the image.


INTRODUCTION
Agriculture plays a predominant role in socio-economic development of the country, Agriculture contributes 18.1% of the gross domestic product of the country and 10% of the country's export is from Agriculture only.No doubt Agriculture is the backbone of Indian economy.In terms of total arable land in the world India stands second largest as over 60 % of India's land area is arable.About 50% of the Indian workforce depend upon Agriculture in the country [1] [2].Being the major contributor for the primary livelihood of mankind, it is a traditional occupation pursued by the majority of population.A stable Agricultural sector assures a nation with food, source of income and source of employment.Arecanut(Areca catechu L.) is one of the important commercial crops of India.The areca tree is a feathery palm that grows to approximately 1.5 m in height and is widely cultivated in tropical India, Bangladesh, Japan, Sri Lanka, south China, the East Indies, the Philippines, and parts of Africa.The tropical palm trees bear fruit all year.The nut may be used fresh, dried, or cured by boiling, baking, or roasting.Arecanut plays a significant role in the social, religious, cultural functions and economic life of people in India.Its cultivation is concentrated in North Western and South Western regions of India.The economic product is the fruit called "betel nut" and is used mainly for masticatory purposes.Arecanut has it's applications in veterinary and Ayurvedic medicines.The habit of chewing Arecanut is typical of the Indian sub-continent and its neighborhood.India accounts for about 57 percent of world Arecanut production [3].The quality, variety and types of Arecanut vary from one place to another.Recent studies of Arecanut have shown that Arecanut has pharmalogical uses such as hypoglycermic effect, mitotic activity etc.It was found that tannins, a by-product from the processing of immature nuts find use in dyeing clothes, tanning leather, as a food colour, as mordant in producing variety of shades with metallic salts etc.The nuts contain 8-12% of fat, which can be extracted and used for confectionery purposes.The refined fat is harder than cocoa butter and can be used for blending.So far human has a prominent role in classifying the grades and variety of the arecanut.

IMPORTANCE AND IMPACT OF THE PRESENT WORK
Although there are several computer based technologies available for most of the crops, to best of our knowledge, in classifying and grading the Arecanut, there is no computer vision based advanced technology available till.That too especially, few works are done based on the Arecanut as a whole.But, none of the work has been reported yet on Arecanut which is cut into pieces after processing.Presently the grading system is carried by the people who have got knowledge from the long practices.The dependency on the skilled labor made the system more cumbersome and it has made entire process dependent on manual labor.As we depend more on manual work the efficiency of the entire process will be reduced as humans are more prone to error.As Areca differs from region to region, the cost on manual labor goes on increasing as we need different set of people for different regions.In manual grading system the chances of miss classification and grading is common as processed Arecanut are much similar.With manual classification and grading system, presently we are achieving a success rate of maximum of 60 to 70%.To address the above issue for Arecanut farmers, there is an increasing demand for computer vision based technology.With this proposed work we can expect the farmers to save more money which they spent on manual labor in classification and grading of Arecanut with better accuracy.Also this automation of Arecanut grading system will save more time of farmers and business people as things will get done with much faster time compared to manual work.Also it will help us to apply this technique to similar Areca market throughout the globe.
There are different types of processed Arecanut is present in the market depend upon the area they grow.Upon harvesting, the Arecanut will undergo various stages like blanching, boiling and drying etc. for 3 to 4 days prior to grading process.Presently Arecanut grading is done based on the requirement of the market, that is, it is mostly the application oriented.In the market the Arecanut is initially graded in to 4 verities based on the maturity and based on the application it consumes.There are four types of Arecanuts are considered for this work, namely Hasa, Bette, Gorabalu and Idi typical to Malnad region of Karnataka state.In the proposed method Arecanuts are classified based on Texture namely using Local Binary Pattern histograms.We have conducted a survey and collected samples from about 20 agricultural fields and five tender markets.

Figure 1. Arecanut Collections from various Regions
Rest of the paper, we described some related works briefly in Section II.Proposed methodology has been discussed in Section III that includes segmentation using Otsu's thresholding, feature extraction using Local Binary Pattern histograms and classification of arecanuts using SVM classifier, and included experimental results and discussion in Section IV.Finally, concluded the paper in Section V.

RELATED WORKS
To the best of our knowledge classification of processed and cut Arecanut has not been done completely using computer vision till.However, few techniques have been proposed for classification of non-processed raw Areca nuts, processed uncut Areca nuts and also for the classification of different seeds, fruits and vegetables.But no work has been reported yet towards classification of Processed Areca which is cut into pieces.Ajith Danthi & Suresha M has proposed several techniques to classify both raw and processed uncut Arecanuts.Few robust algorithms proposed for classification of Arecanut can be given as, Suresha M and AjithDanti [4] proposed a technique for effective grading of Arecanut where the Arecanut RGB image is converted into YCBCR color space.Three sigma control limits on color features are determined for effective segmentation of Arecanuts.Color features are used for the grading of Arecants with the help of support vector machines (SVMs) into two grades i.e. boiling and Non-boiling nuts.Experimental kfold cross validation method demonstrated the efficiency of the proposed approach.SureshaM, AjithDanti and S K Narasimha Murthy [5] proposed a technique to classify the Arecanuts using Haar wavelets.For the purpose of feature extraction the method of Wavelet decomposition was used.The statistical feature energy is derived from the approximation coefficients for each level of decomposition and for classification of Arecanut images, color features are also extracted from Arecanut images.Here for classification of Arecanuts they have used decision tree classifier.Many tree splitting rules are used like gini diversity index, twoing rule and entropy.Proposed algorithm is verified for Arecanut images with cross validation method and achieved good success rate.Suresha M and AjithDanti [6] have also proposed a technique to grade raw Arecanuts as well.For Areca nut grading they have used color as a main feature.Threshold based segmentation algorithm was used initially for the purpose of segmentation.In the segmented region, by suppressing the blue color components only red and green components are used to classify the Arecanuts.Average red and green component of a areca nut is extracted.Based on the extracted features Arecanut is classified into various categories.A combination of SVM and KNN classifier is used to classify different types of areca nuts.Among raw areca nuts, the test result showed that the system have achieved a success rate of up to 98%.Suresha M and AjithDanti [7] have also proposed a technique for classification of Arecanut based on texture features.They have used watershed segmentation to segment the Arecanut images.GLCM features and Mean Around features are extracted in the segmented regions.Here they have used Mean around features, Gray level co-occurrence matrix (GLCM) features and combined (Mean around-GLCM) features for Classification of Arecanut.For the classification of Arecanut, they have used Decision tree classifier, and the classification was done in to six classes (Api, Black Bette, Red Bette, Chali, Minne, Gotu).The technique gives the convincing results as well.For the testing purpose the Cross validation method is used and found that, the GLCM features have given success rate of 97.65%.Mean Around features have given success rate of 98.28%.Mean Around-GLCM features have given success rate of 99.05%.Suresha M, AjithDanti and Narasimha Murthy S K [8] proposed a technique for classification of Arecanut.In this work from respective RGB images, HSV images were obtained.Then with the help of threshold based segmentation method the segmentation was done by extracting the saturation channel.Then for Arecanut images, the LBP have been applied.With the help of LBP, Gabor, Image histogram and GLCM features have been obtained.Then correlation distance metric classification has been done with histogram features, and then classification has been done with Gabor, GLCM and combined (GLCM-Gabor) features using kNN classifier.The obtained results show that combined features gave convincing results and the success rate is directly proportional to k value.Harish Naik T and SureshaM [9] proposed a technique using color features of the components to classify raw Arecanut with husk in to various categories.In this paper they have used HSV, RGB and YCbCr color spaces of Arecanut at the stage of feature extraction.And then kNN and SVM classifiers were used for the purpose of classification.The outcome of the research work is when compared to other color models HSV color model gives the good success rate.Kuo-Yi Huang [10] proposed a technique to classify Arecanut into 3 major categories (Excellent, Good and Bad).In his work detection line (DL) method was used for segmentation of defected Arecanuts with diseases or insects.The feature extraction process was done using Six geometric features namely the Area, Compactness, Principle axis length, Axis number, the secondary axis length, perimeter and, 3 color features, that is, the mean gray level of an Arecanut image on the R, G, and B bands, and defects area were used.And then to sort the quality of the Arecanut the back-propagation neural network classifier was used.The presented methodology gives the accuracy of 90.9%.Siddesha S, S K Niranjan and V N Manjunath Aradya [11] proposed a technique to differentiate color segmentation techniques for crop bunch in Arecanut.In their work they mainly focused on exploring different color segmentation techniques such as, Thresholding, Watershed segmentation, K-means clustering, Fast Fuzzy C Means clustering (FFCM), Fuzzy C Means (FCM), and Maximum Similarity based Region Merging (MSRM).Then with the help of different Arecanut image datasets based on the segmentation results the evaluation was done.Siddesha S, S K Niranjan and V N Manjunath Aradya [12] proposed the texture based grading of Arecanut.In that different texture features are extracted from Arecanut by using Local Binary Pattern (LBP), Wavelet, Gabor, Gray Level Co-Occurrence Matrix (GLCM),Gray Level Difference Matrix (GLDM) and features.For the purpose of classification Nearest Neighbor (NN) classifier technique was used.To demonstrate the proposed model's performance, the test was conducted using a dataset of 700 images belongs to 7 different classes.Along with the help of Gabor wavelet features they have achieved the classification rate of 91.43%.Upon seeing the above quoted works it is clear that not much of the work has been done and reported with respect to Arecanut, especially the nuts which are cut into pieces typical to Malnad region of Karnataka and Kerala.This made us work on the problem which is not addressed so far.

Proposed Model
The different steps followed in the proposed Block wise LBP approach for Arecanut classification is given in the figure 1.It involves various steps like Preprocessing, Segmentation, feature Extraction, classification and validation.
The different stages of proposed model are explained in following subsections.

Figure2. Architecture of the proposed model
In the proposed methodology the samples are segmented using Otsu's thresholding technique and necessary preprocessing is done.Classification and grading of processed Arecanut is usually done based on color, shape and texture.For classification and grading of Arecanut we extracted different external features like Color, Shape and Texture.Although color is a good feature descriptor, variation in color due to external factors does mislead about the actual quality of the Arecanut.Shape is another criterion.However, this criterion poses challenge to the exactness of the system as Arecanut from different growing regions vary in their external shapes.Thus it's difficult to arrive at a common thumb rule in identifying the shape of the Arecanut.Exactitude in classification of the Arecanut is achievable with Texture as the criterion, because Areca types differ in Texture significantly.Interestingly, even though the Hasa and the Bette, typical to malnad region of Kerala and Karnataka, are very similar in Texture, they can be differentiated with minute texture details.
To the fact that colour and shapes are not appropriate features for grading of areca, we have used texture for classification.In this work we explore the usage of LBP for texture description.LBP is most robust in identifying minute difference in the texture patterns.As a next step texture features are extracted in the form of Local Binary Pattern histograms.Initially LBP of the image is obtained as a whole and then as a continued step Local Binary Histogram of an image is extracted in segments using with variable number of blocks by changing the K value and unknown samples are tested using Support Vector Machine classifier.

Preprocessing
In this stage, we recommend two different pre-processing tasks, namely, image resizing and gray scale conversion.In Image resizing, we have converted all the images of Arecanut of dimension M*N to m*n to maintain uniformity in the dimensions of the images.Because in the stage of image acquisition the dataset contain various images with varied size, but for better accuracy it's always recommend to use uniform datasets, so we have resized all the images in to size 480*640.Then, we have converted RGB images in to its equivalent gray scale images as this conversion helps in extracting the texture features from the images.
The different steps of preprocessing can be shown as,

Original RGB Images
Resized Gray Scale Images

SEGMENTATION
In this work, the gray scale image is binarized using OTSU thresholding method.Otsu algorithm returns a single intensity threshold that separate pixels into two classes, foreground and background.This threshold is determined by minimizing intra-class intensity variance, or equivalently, by maximizing inter-class variance.Otsu's thresholding method involves iterating through all the possible threshold values and calculating a measure of spread for the pixel levels each side of the threshold, i.e. the pixels that either falls in foreground or background.The aim is to find the threshold value where the sum of foreground and background spreads is at its minimum [13].The connected component analysis is performed on binary image to extract the contours among which the dominant contour is considered to obtain the mask.The region of interest is computed by fitting a bounding rectangle to the extracted contour.
The different steps in segmentation of images can be shown as,

FEATURE EXTRACTION
In this step, from the Arecanut datasets we extracted texture feature viz.Local Binary Pattern from the images.Whereas the Local Binary Pattern of the images are obtained as a whole to achieve precision.Then the LBP of the image is obtained in segments using with variable number of blocks by changing the K value in an image of dimension say K*K.The LBP is obtained from the each block separately and then the corresponding LBP is combined at the end.

Local Binary Pattern
The basic local binary pattern was originally proposed by Ojala et al. [12], was based on the assumption that texture has locally two complementary aspects, a pattern and its strength with the aim of texture classification.The most predominant features of LBP are its invariance to monotonic gray-scale changes, convenient multi-scale extension and low computational complexity.The philosophy behind LBP is simple and well-structured: unify traditional structural and statistical methods.Local Binary Pattern (LBP) is a simple yet very efficient texture operator which labels the pixels of an image by thresholding the neighborhood of each pixel and considers the result as a binary number.Each neighbor pixel is compared with the center pixel, and the ones whose intensities exceed the center pixels are marked as 1, otherwise as 0. In this way we get a simple circular point features consisting of only binary bits.Typically the feature ring is considered as a row vector, and then with a binomial weight assigned to each bit, the row vector is transformed into decimal code for further use.LBP using circular neighborhoods and linearly interpolating the pixel values allows the choice of any radius, R, and number of pixel in the neighborhood, P, to form an operator, which can model large scale structure.A corresponding equation is shown in equation ( 1). ( -where gc is the gray value of the central pixel, gp is the value of its neighbors. A descriptor for texture analysis is a histogram, h(i), of the local binary pattern shown in equation ( 2) and its advantage is that it is invariant to image translation. ( In order to perform classification of arecanut, each arecanut image in the training and test sets are converted to a spatially enhanced histogram via the process described above.Then Support Vector machine classification is performed on it.

Block Wise LBP
Certain Image Processing operations involve processing an image in sections, called blocks or neighborhoods, rather than processing the entire image at once.The basic idea is to break the input image in to blocks or neighborhoods, and apply the required function on each block or neighborhood, and then reassemble the results into an output image.
This proposed approach makes use of global textural feature viz., Local Binary pattern for feature extraction.Initially, an image is divided into k number of blocks.Subsequently, the texture feature is extracted from each k blocks of the image.The k value is varied and fixed empirically.The experimentation is done for whole image and also with different blocks for 2, 4, 8, 16 and 32 blocks.The Local Binary Pattern for each block is obtained and tabulated for classification purpose.Consider figure 4, an image with the matrix M*N is divided in to equal number of pixels with variable number of blocks.The LBP of the each block is obtained and is tabulated for the for the purpose of classification.

Support Vector Machine Classifier
SVM is a supervised machine learning algorithm which can be used for both classification and regression challenges.However, it is mostly used in classification problems.A Support Vector Machine (SVM) is a discriminative classifier formally defined by a separating hyperplane.In two dimensional space this hyperplane is a line dividing a plane in two parts where in each class lay in either side.SVM solves the classification problem via trying to find an optimal separating hyperplane between multiple classes.It depends on the training cases which are placed on the edge of class descriptor this is called support vectors, any other cases are discarded.SVM algorithm seeks to maximize the margin around a hyperplane that separates a positive class from a negative class [14].Given a training dataset with n samples (a1, y1),(a2, y2),...,(an, bn), where xi is a feature vector in a v-dimensional feature space and with labels yi ∈ −1, 1 belonging to either of two linearly separable classes C1 and C2.Geometrically, the SVM modeling algorithm finds an optimal hyperplane with the maximal margin to separate two classes, which requires to solve the optimization problem, as shown in equations ( 3) and (4).
Maximize n i=1 αi − 1 2 n i,j=1 αiαjbibj .K(ai, aj ) (3) where, αi is the weight assigned to the training sample ai.If αi > 0, ai is called a support vector.For superior generalization capability to be achieved C is a regulation parameter used to trade-off the training accuracy and the model complexity.To measure the similarity between two samples K will be used as a kernel function.There are several kernel functions available and are used based on the requirements.The most used are Linear, Gaussian radial basis function (RBF), Multi-Layer Perceptron MLP and Polynomial of a given degree.These kernels works independently of the problem and it can be used for both discrete and continuous data (Grading of Arecanut on the basis of maturity using Local Binary Pattern Histograms) Either a two class problem or a multiclass SVM suits both of it effectively.Here we have used SVM with suitable kernel type and multi class OVR(one vs Rest classifier) method which helps us to classify Areca images in to four different classes.From tables 2 to 7, it is observed that the classification of Arecanut images yields good results for having number of blocks 08.The result gradually decreases as the number of blocks increases.This is due to the large variation in the size of blocks in the image that we consider for extraction of Local Binary Patterns.
Also, from the above tables, it is clearly observed that, the block of 08 in an image results with maximum accuracy, maximum precision, maximum recall and maximum F-Measure.The graphical analyses of the results are given in the figure 5.

DISCUSSION
With the proposed method we have achieved the success rate of around 95% with the variable k value as 8.We tried image as a whole with global LBP features but the success rate was only around 70%.With block wise approach we can get the detailed analysis of an image with much inner details.Here we have considered both local and global textural features with the technique of block wise Local Binary Patterns.We are succeeded with the success rate of only 95% as there are minor chances of error between the class 1 and class 2 as both of them look alike.
When it comes to cross validation it is recommended to use cross validation to fix the train parameters during training process.This subsequently helps during testing phase.Hence, cross validation is recommended when we are adapting parametric approach for training the model [15].But, in case of non-parametric approach it is not necessary to use the cross validation method for training the model [16].In this regard, we have not recommended the cross validation method in this work for training the model.

CONCLUSION
In this paper a block wise approach in classifying Arecanut in to pre-defined 4 classes is proposed.In classifying Areca image a Local Binary Pattern histogram of every data set is obtained for variable number of image blocks.The various combinations of Test and Training tests are also considered for image classification.Further SVM classifier is used for classification.The effectiveness of the proposed classification system is validated through well-known measures like accuracy, precision, recall and F-Measure.Finally, the paper concludes with an understanding that the promising classification results are obtained for the image with number of blocks as 8.

Figure 6 .
Figure 6.Illustration of different types of Arecanut considered for the work

Figure 7 .
Figure 7.The experimental setup used for the work to capture the datasets

Figure 8 .
Figure 8. Graph Analysis for the results obtained