Classification of Broken Rice Kernels using 12D Features

Integrating the technological aspect for assessment of rice quality is very much needed for the Asian markets where rice is one of the major exports. Methods based on image analysis has been proposed for automated quality assessment by taking into account some of the textural features. These features are good at classifying when rice grains are scanned in controlled environment but it is not suitable for practical implementation. Rice grains are placed randomly on the scanner which neither maintains the uniformity in intensity regions nor the placement strategy is kept ideal thus resulting in false classification of grains. The aim of this research is to propose a method for extracting set of features which can overcome the said issues. This paper uses morphological features along-with gray level and Hough transform based features to overcome the false classification in the existing methods. RBF (Radial Basis function) is used as a classification mechanism to classify between complete grains and broken grains. Furthermore the broken grains are classified into two classes’ i.e. acceptable grains and non-acceptable grains. This research also uses image enhancement technique prior to the feature extraction and classification process based on top-hat transformation. The proposed method has been simulated in MATLAB to visually analyze and validate the results.


INTRODUCTION
A gricultural Industry is referred to as one of the widespread and largest industry of the world.
Due to the increasing demand of agricultural commodities the need for efficient and automated resource management for this sector is desperately escalating. Recent advancement in technology has encouraged the researchers to work on developing algorithms for automated way of quality assessment hence replacing human inspection by machine intelligence [1]. Amongst all agricultural products rice The quality of rice grains can be evaluated by taking into account some parameters such as shape, size, whiteness and texture. Based on these parameters the rice kernels can be classified as whole kernels or broken kernels. This classification is considered to be an imperative characteristic to determine the quality of rice kernels. With reference to the whole kernel the rice kernel can be assumed as a broken kernel if it is three fourth of its size [4]. The quality assessment based on the number of broken kernels by manual human inspection is neither efficient (i.e. time to assess) nor reliable (i.e. accuracy).
The assessment can be improved in terms of efficiency and reliability by employing machine vision techniques signifying that the images of rice kernels can be acquired by digital camera or scanners [5].
The design of such machine vision systems require set of features to be extracted from the rice kernel images to classify between complete kernels and broken rice kernels.
A thorough research has been carried out to extract features that can enhance the accuracy of the system, these features include geometrical features [6], color based features [7], texture based features [8] and shape based features [9].
In addition to the feature extraction, classification process is given equal importance for efficient quality assessment.
In this paper a rice classification method with a 12D feature vector has been proposed based on morphological [8], gray-level [15] and Hough transform [16] based features to accurately classify the complete rice kernels and broken rice kernels. Furthermore rice kernels will be classified as acceptable rice-kernels and non-acceptable rice kernels.
Radial basis function with exact fitting neurons [17] method has been used for the classification of rice kernels which uses only one hidden layer with exact number of neurons with reference to the number of features used in feature vector. For accurately extracting features from the rice kernel images it is necessary to make the image undergo some pre-processing techniques for enhancing and making the image compatible for further processing, in this regard morphological image processing i.e. top hat transformation [18] has been used for image enhancement prior to the feature extraction process. The reason for employing the proposed method is to eliminate the false rice kernels which are merged with border, hence they are perceived to be the complete rice grains because of their augmented area section and to intensify the accuracy of the classification system. Furthermore, this paper has been divided into five sections where section 2 will deal with the existing work being carried out in the similar field followed by section 3 carrying out the comprehensive discussion on the proposed methodology. Section 4 will highlight the results being procured by implementing the proposed method and section 5 will finally present the conclusion and discussion based on the acquired results. al. [14] proposed an algorithm for rice kernel classification based on color and morphological features, neural networks along with discriminant analysis were used to classify rice kernels for six different varieties. Wee, et. al. [24] proposed sorting algorithm for rice kernels based on Zernike moments and neural networks suggesting that is q-recursive method is used to compute the Zernike moments the overall classification time can be reduced by 25% hence making the classification system fast and less computationally complex. Agustin and Byung-Joo [25] proposed an evaluation framework for determining the quantity of brewers, broken rice and head rice using by using geometric and color based features. Probabilistic neural network classifier is used to characterize defects in rice kernels. Tom Pearson [26] proposed Kaur and Singh [12] proposed the extraction of ten geometric features to classify the defective or broken rice kernels and complete rice kernels. They used maximum variance method to segment out the kernels from the background and multi-class SVM to classify the complete rice kernels and broken rice kernels. Pazoki, et. al. [29] proposed the classification of rice kernels amongst 5 al. [32] proposed that the morphological features to be extracted from hyperspectral images of rice kernels followed by the dimensionality reduction using PCA and finally the classification is performed by employing BPNN.

RELATED WORK
They analyzed seven optimal wavelengths on spectral data to extract the desired features.
The consolidated literature work mostly represent the work for classifying the specific rice kernels amongst different varieties of rice however, a very few paper actually take into account the actual quality assessment parameters i.e. the classification of complete and broken rice kernels within a specific variety of rice kernels. Most of the papers in this section use more than 15 features which increases the computational complexity of the classification system but in the proposed approach we are using 12 features for classification hence making the system less computationally complex.

PROPOSED METHODOLOGY
This paper presents a new approach for grading rice kernels into two main categories which is complete rice kernels and broken rice kernels and further the grading will be applied to the later category for identifying the acceptable kernels and non-acceptable kernels. For accomplishing the said task 12D feature vector has been extracted based on morphological, gray level and Hough transform based features. The phases of ensuing process for execution of kernel grading operation is identified as: (1) Pre-processing for enhancement of rice kernel images which will be accomplished by gray-level homogenization (2) Extraction of features from homogenized image (3) Classifying the pixels which are complete and acceptable rice kernels.

Pre-Processing
Certain constraints affect the feature extraction process of rice kernel images which include noise and poor contrast, to overcome these limitations two processes will be applied to make the image suitable for feature extraction process. The said processes are Background homogenization and image enhancement.

Feature Extraction
This stage aims to characterize the rice kernels using the feature vector in such a way that they can be used to categorize the rice kernels in one of the three classes' i.e. complete rice kernels, broken but acceptable rice kernel and broken and unacceptable rice kernels. Following are the set of features which are used to categorize the rice kernels in one of three categories.

Morphological Features
Average Length is considered to be the simplest feature which determines the absolute length of each rice kernel by measuring the Euclidean distance between the most distant points. In our case the length refers to the Euclidean distance between the major axis length and the minor axis length of the rice kernel and N is total number of rice kernels in the image, the feature of average length can be represented as in Equation (6).
Aspect Ratio Diameter which is a ratio of shortest to the longest diameters as represented in Equation (7).   Region Diameter determine the regions having area with the same diameters and its mathematical expression is given in Equation (11).
Solidity Feature determines the proportion of the pixels.
This feature is used to overcome the problem related to merger of rice kernels as shown in Fig. 1. The two rice kernels which are merged and considered to be single rice kernel can be unmerged using this feature with the threshold level 0.8. This feature can be mathematically expressed as in Equation (12) Where C A is the convex area i.e. which determines the convex hulls passing through the bounding boxes or can be said as the region inside or outside the hull.

Gray-Level Based Features
These

Hough Transform Based Features
This feature employs a voting process of peaks to find the elliptical structures with in a window and to determine whether the formation of elliptical structure is genuine or influenced by any noise in the said window. The motive of the employment of this technique is as the noise level increases votes will also increase till the saturation region occurs where the presence of an elliptical structure dominates the votes to the noise level. Once this level is attained the points are stored as a feature to differentiate between the presence of an elliptical structure and the similar structure generated by the noise level. The last feature can be expressed mathematically as shown in Equation (18).

FIG. 1. MERGER OF RICE KERNELS VERY CLOSE TO EACH OTHER
Where P C is the peak confidence measure, V n is the number of Hough peaks and is the mean of Hough peaks excluding the peak itself and is the standard deviation of peaks. The mathematical representation of these parameters are shown in Equations (19-21).
The feature will take into account the peak confidence measure suggesting that if the peak confidence is less than the threshold level within the window then it is assumed to be the impact of noise level and the feature will return 0, similarly if the peak confidence is greater than the threshold level within the window it will be considered as 1 which refers to the presence of elliptical shape. The threshold is selected as 0.9 as per the experimental tests conducted. By experimental results it is meant that the other values i.e. less than 0.87 and greater than 0.93 were not providing desired results. However, the results in the said range were all yielding the same result therefore threshold value of 0.9 is opted for generalizing this feature. The mathematical representation of the last feature is expressed in Equation (22).

Classification Stage
Each object detected from the rice kernel images will be represented in 12D feature space as shown in Equation The classifier used in the proposed approach is exact fitting version of RBF suggesting that the exact fitting method consists of only one hidden and output layer based on the neurons equivalent to the defined features, in our case 12 neurons will be used for the classification purpose. The training set for the said classifier is expressed in Equation (24).
Where T D , F and C refers to Training data, Feature vector and Classes. Once the training data is established the neural network is trained using OLS (Orthogonal Least Squares) method as used in [17]. When applied the classification on the rice kernel images, each rice kernel will be assigned either class 1 i.e. complete rice kernels or class 2 i.e. broken rice kernels. Further the feature vector is reduced to 9 features as expressed in Equation (25).
For further classification of broken kernels into two classes i.e. class 1 for acceptable rice kernels and class 2 for non-acceptable rice kernels. Training data set based on the feature vector in Equation (25) can be expressed as in Equation (26).

RESULTS AND DISCUSSION
The performance of the classification system depends on the dataset used for training purpose. In this regard, images of the rice kernels are acquired by Nikon D400 camera with zoom lens of 18-25 mm with a fixed aperture size of 3.5, 20 images for each rice kernel i.e. complete grain, broken but acceptable kernel and broken but unacceptable kernel is acquired for training the said system, which makes total of 480 samples of rice kernels as used in [4,12,35]. The proposed method is tested on complete kernels, broken kernels but acceptable and broken kernels but unacceptable kernels.  Table 1 show the selected thresholds for the morphological features taken into account for the proposed method to detect complete rice kernels.  Fig. 5 show the ROC curve based on the results presented in Table 3.  TABLE 3 PERFORMANCE RESULTS OF THE PROPOSED METHOD ON RICE KERNEL IMAGES   e  g  a  m  I  y  t  i  c  i  f  i  c  e  p  S  y  t  i  v  i  t  i  s  n  e  S  e  v  i  t  a  g  e  N  e  u  l  a  V  d  e  t  c  i  d  e  r  P   e  v  i  t  i  s  o  P  e  u  l  a  V  d  e  t  c  i  d  e  r  P  y  c  a  r  u  c