CASHEW KERNELS CLASSIFICATION USING COLOUR FEATURES

NARENDRA V.G.1*, HAREESH K.S.2
1Department of CSE, Manipal Institute Of Technology, Manipal, Karnataka, India-576 104
2Department of CSE, Manipal Institute Of Technology, Manipal, Karnataka, India-576 104
* Corresponding Author : narendra.vg@manipal.edu

Received : 10-08-2011     Accepted : 06-09-2011     Published : 08-09-2011
Volume : 3     Issue : 2       Pages : 52 - 57
Int J Mach Intell 3.2 (2011):52-57
DOI : http://dx.doi.org/10.9735/0975-2927.3.2.52-57

Conflict of Interest : None declared

Cite - MLA : NARENDRA V.G. and HAREESH K.S. "CASHEW KERNELS CLASSIFICATION USING COLOUR FEATURES." International Journal of Machine Intelligence 3.2 (2011):52-57. http://dx.doi.org/10.9735/0975-2927.3.2.52-57

Cite - APA : NARENDRA V.G., HAREESH K.S. (2011). CASHEW KERNELS CLASSIFICATION USING COLOUR FEATURES. International Journal of Machine Intelligence, 3 (2), 52-57. http://dx.doi.org/10.9735/0975-2927.3.2.52-57

Cite - Chicago : NARENDRA V.G. and HAREESH K.S. "CASHEW KERNELS CLASSIFICATION USING COLOUR FEATURES." International Journal of Machine Intelligence 3, no. 2 (2011):52-57. http://dx.doi.org/10.9735/0975-2927.3.2.52-57

Copyright : © 2011, NARENDRA V.G. and HAREESH K.S., Published by Bioinfo Publications. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution and reproduction in any medium, provided the original author and source are credited.

Abstract

Cashew is a commercial commodity that plays a major role in earning foreign revenue among export commodities in India. The purpose of this research work is to explore image processing techniques and approaches on Indian cashew variety identification based on their kernels. Colour is an important quality factor for grading, marketing, and end users. Our primary objective is to develop a cost-effective intelligent model to identify the cashew kernels. Colour features in the RGB (red-green-blue) colour space are extracted and computed. A feed-forward neural network is trained to classify sample cashew kernels. An intelligent classification system based on computer vision system can be developed for automated grading and sorting to speed up the classification of cashew kernels. This will solve the major problems of many of the cashew export industries also, gives justice to the cashew growing farmers in accurate grading. The classification system is evaluated on cashew kernels of 6 different grades. The result of our study shows that, the system gives about 80% classification rate.

Keywords

Image Processing, colour features, cashew kernel, grading, Neural Network.

Introduction

Cashews are most widely grown crop of India especially in coastal areas. In the recent years, Cashew is a commercial commodity that plays a major role in earning foreign currency among export commodities in India. The Assessment of cashew quality is the function of government agency entrusted to perform cashew kernel grading and it is important for the cashew export industry.
The grading operation is important, as it is the last opportunity for quality control on the kernels. With the exception of a few grading aids, all grading is being done by manually. In the present international market scenario, it is very much essential to keep our products well graded automatically to compete in the market place. For large operations looking towards export markets, it is necessary to grade the kernels to an international level. India, the largest exporter & distributor of Cashew Nuts in the world, cashew nut are of the highest quality and has helped in gaining repute amongst all in the international market.
Grading of cashew kernels is based on inspection of physical quality attributes such as colour, shape, and size. By using these physical attributes, a trained person determines the cashew kernel of which class (i.e. white wholes). The [Table-1] illustrates the Grade designations and definitions of quality of cashew kernels (i.e.white wholes). Reference colour slides are available to assist with the assessment of cashew kernel colour. Despite the training of grading personnel and the availability of reference slides, the current methods for cashew kernel quality evaluation is time consuming, tedious, and inherently inconsistent. An objective and cost–effective computer vision system is needed to segregate cashew kernels. Such a system would not only facilitate cashew grading but also serve as a quality control tool for processing facilities such as elevators, seed cleaning plants, and oil mills.
There have been successful applications of computer vision in agricultural product inspection, but most efforts are still in the research and development stage. Research endeavours have grown rapidly in the past 10 years. Extracting various morphological, tonal, textural, and colour features for classification of grains by variety, grades, and damage has been the focus of the reported research and only a few researchers have reported work on soybean [5] .
The objective of this study was to determine the usefulness of colour features of cashew kernel images in classifying them into white wholes categories. The research entailed the development of an algorithm to segment images of cashew kernels of different shades and colours. The proposed work emphasizes on development of Artificial Neural Networks (ANN) based method for automatic classification of cashew kernel samples instead of using colour histograms. Colour histograms have several inherent limitations for the task of image indexing and retrieval. The images of the cashew kernel were snapshot by a high-resolution (5-megapixel) Sony digital colour camera (Model DSCV3). The cashew kernel images were then segmented, isolating the region of interest from the background and 15 colour parameters were extracted for to identify the particular grading of cashew kernel categories. The 15 distinguishable features are mentioned in [Table-2] . The parameters obtained were used to train a neural network created. Once trained, the network was tested with other cashew kernel for the desired results. All these programs were developed using MATLAB 7.8 version.

Proposed System

The system acquires images of the cashew kernel and this forms an input to the image-processing unit that extracts the necessary features of the cashew kernel in [Fig-1] . The features obtained were the inputs to the neural network, the network is trained using supervised learning to recognize cashew kernel of category White Wholes. To test the network, 6 sets consisting of all white wholes category of each 10 cashew kernels were used.

Materials and Methods

Experiment Samples

Karnataka Cashew Board, Mangalore District, Karnataka State. The samples included cashew kernels of white wholes class. Cashew inspectors manually classify the kernels. Examples of cashew kernels are shown in [Fig-2] .

Collection of sample Images

A high-resolution (5-megapixel) Sony digital colour camera (Model DSCV3) was utilized. The captured images were obtained as JPEG image files.
The cashew kernel samples were photographed at a particular position at specific lighting conditions. The images are likely to have a high resolution since it yields a better image processing result. An example of a sample jpeg image of a Cashew kernel is shown in [Fig-2] .

Image Segmentation

Image segmentation refers to the process of delineating the regions or objects of interest in an image. For this work, the cashew kernel must be isolated from the background before they could be characterized. The first step in image analysis is to find objects. For this, object colour must be different from coloured foreground, based on a given colour threshold set by the user. Thresholding is an important part of image segmentation. The threshold value is generated according to the results of the histogram analysis and was constant for the same environment conditions. This results in a black and white (binary) image from the colour image, where background pixels are painted black and objects painted white. The image must retain the colour information of the cashew kernel when segmentation was processed. All the pixels with intensity value greater than 35 were assigned the value 255, and all pixels with intensity value less than or equal to 35 were not processed in any operation [2] . For the technology to be practically useful, the segmentation algorithm needs to be fast and capable of handling variations in cashew kernels.
The input data will be an image consisting of multiple nuts, so the first step is to segment this image in order to view and extract features from each individual nut separately. The problem is simplified by considering only the grey-scale image [Fig-3] rather than a 3-dimensional colour image.
Due to the nature of the contrast between background and foreground, a thresholding technique has been applied in order to create a binary image: i.e. all nut pixels are represented as ‘1’ and all background pixels are represented a ‘0’ [Fig-3] (c). The value of a suitable threshold has been determined empirically. In this form it becomes straight forward to identify each region by examining groups of connected pixels, and labelling the region appropriately (as shown in [Fig-3] (c) ). A labelled region can be segmented by ignoring all the other labelled regions [Fig-3] (d).
Once segmentation process is over, the image data for each individual nut is stored in a structure array with the following fields:
CASHEWS.colour- N-by-M-by-3 colour image of nut
CASHEWS.grey- N-by-M grey-scale intensity image of nut
CASHEWS.bw - N-by-M binary mask
CASHEWS.label- string containing the class label

Feature Extraction

Image features of the cashew kernels were extracted to characterize the physical quality attributes of cashews. A number of colour features were computed and tested. They included the means and standard deviations of R, G, and B(red, green, and blue); the means of H, S, and I (hue, saturation, and intensity); excess red (2R–G–B), excess green (2G–R–B), and excess blue (2B–R–G). The excess colours correspond more closely to the way humans perceive colours than the RGB representation [4] . Also the other feature has been investigated as morphological characteristics of cashew kernel.
Algorithms were developed in Windows environment using Matlab 7.8 programming tools to extract colour features of individual cashew kernel. From the red (R), green (G), and blue (B) colour bands of an image, hue (H), saturation (S), and intensity (I) were calculated using the following equations [5] :



[ min (R, G, B) ]

Neural Network Classifier

Jayas et al. have indicated that back propagation neural network (BPNN) suits the best in these applications [1] [3] . A feed–forward neural network was trained for classification of the cashew kernel samples into W-180,W-210,W-240,W-320,W-450 and W-500 classes. Inputs to the network were image features computed, and eight outputs formed a three–bit binary number representing the category of classification (000 to black, 001 to W-180, 010 to W-210, 011 to W-240, 100 to W-320, 101 to W-450, 110 to W-500 and 111 to white) (Refer [Fig-5] ).
Levenberg-Marquardt Back Propagation algorithm was used for training. Using an approximation to Newton’s method is called “Levenberg-Marquardt approximation”. This is an improved back propagation method. Levenberg-Marquardt algorithm has the best convergence speeds for small and medium size networks. Tan sigmoid function was used in the hidden layers. Log-sigmoid transfer function was selected because its output (0 to 1) was fit for classification. The network was trained to output a 1 in the correct variety of the output vector and to fill the rest of the output vector with 0. Different numbers of layers and nodes were tested for the network structure. Hidden layers are required, as the patterns belonging to various classes (colours) are linearly non-separable. The mean squared error (MSE) of prediction for the validation data set was used to select an appropriate network structure without over–fitting. Four steps were followed in the training process:
1) Assemble the training data.
2) Create the network.
3) Train the network.
4) Test and validate network response to new inputs.

Result and Discussion

Image Segmentation

A typical segmented image of cashew kernel from the image background is shown in [Fig-2] . The cashew kernels were of different colours but the background colour was fixed. [Fig-3] shows the segmented images along with the mask. The results show that the segmentation algorithm could consistently segment the images. The ability to segment images of cashew kernels of different colours in the same background is important for practical implementation of this technology.
Under laboratory conditions, different background colours may be used for different classes of cashew kernel. Practically, however, cashew kernel of different classes and colours are present in the same sample, and thus they must be imaged with the same background.

Network Structure

The number of neurons in the first layer is ‘n’ which is equal to the number of input pattern vectors. The number of neurons in the output layer is one which is equal to the number of pattern classes that the neural network has been trained to recognize. The network recognizes a pattern vector P as belonging to class Oi if the ith output of the network is “high” while all other outputs are “low”. Trial and error approach was used to find a suitable number of the hidden layer that provided good classification accuracy based on the data input to the neural network. The mean squared errors for the validation data set were compared among different neural network structure (Refer [Fig-5] ).

Classifier Performance

A test sample set, which was not part of either the training or validation samples, was used to test the neural network classifier trained. The test set included 100 randomly selected cashew kernels. The test results of classification are summarized in [Table-3] . Almost all (80%) of the cashew kernels were correctly classified. But classification rate W-500 is 40% because of size, shape and colour is similar to W-450.
As can be seen, using the current features the first 4 grades can be discriminated with no errors. However work still has to be carried out to discriminate between grades ‘450’ and ‘500’.

Conclusion

The results of this study show that colour features and a properly trained neural network can effectively classify cashew kernels. A computer vision–based system could be developed for automated grading and sorting.
The classification accuracy was acquired under laboratory setting, so it had some limits. In future work, a large quantity of cashew kernels will be investigated.

Acknowledgement

The author would like to thank the Zonal Agricultural Research Station, Brahmavar, Udupi Taluka, Udupi District and Balaji Exports Jarkal Karkal Taluka, Udupi District, Karnataka State, India for providing the cashew kernels samples and relevant information.

References

[1] Jayas D.S., Paliwal J. and Visen N.S. (2000) Journal of Agricultural Engg. Research, vol. 7(2), pp. 119-128.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

[2] Liu et al. (2005) J Zhejiang Univ SCI, 6B(11), pp. 1095-1100.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

[3] Rumelhart D. E., Hinton G. E. and Williams R. J. (1986) Nature, 323:533–536.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

[4] Shatadal P.J. (2003) Applied Engineering in agriculture, Vol. 19(1), pp. 65-69.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

[5] Sujata Kotabagi, Desai B.L., Linganagouda K., Patil V.C., Shashidhar, Sudhir Gupta, Smitha Patil, Asha Kulkarni1 and Zoheb Hukkeri (2006) Proceedings of (AFITA 2006) 5th conference of Asian federation for information technology in agriculture.  
» CrossRef   » Google Scholar   » PubMed   » DOAJ   » CAS   » Scopus  

Images
Fig. 1- Block diagram of the system for classification of cashew kernels.
Fig. 2- Images of cahew kernels (a) White wholes-180 (b) White wholes-210 (c) White wholes-240 (d) White wholes-320 (e) White wholes-450 (f) White wholes-500
Fig. 3- (a) Cashew Kernel (b) Gray-scale image (c)Mask (d) Indiviudal Cashew kernel (e) Individual Mask
Fig. 4- Histograms of (a) RGB and (b) HIS components of Cashew kernel
Fig. 5- Neural Network Architecture
Table 1- Cashew Kernels (White Wholes)
Table 2- Extracted Features
Table 3- Classification Results for 'White Wholes'