Professional Documents
Culture Documents
Abstract—This paper presents an efficient method for grading system which is robust enough to classify dates on
automatic grading of date fruit based on computer vision. Color basis of their individual features and sorts the dates with
images of date fruits are used to extract size, shape and wrinkle minimum error, takes less time and is consistent. Image
feature for classification. Prior to classification, a support vector
processing along with neural networks is the emerging
machine (SVM) based image segmentation technique is used for
efficient removal of background pixels and shadows. Size and technique that functions like a human brain and gives very
wrinkles are classified on basis of mean-variance relationship and satisfying results.
threshold value method respectively, whereas backpropagation
In this paper, an automatic date sorter algorithm is
and radial basis function (RBF) neural networks are used for
shape classification giving accuracy of 77% and 96.3% presented using digital image processing tools and neural
respectively. networks for successful classification. Sorting is done on the
basis of size, shape and wrinkles. A comparison is carried out
Keywords—back propagation; Fruit classification; image between back propagation and RBF classifier. Also an
segmentation; pattern recognition; radial basis function; support efficient method for image segmentation is implemented. The
vector machine. paper is organized as follows:
I. INTRODUCTION A literature review is presented briefly on the related work
Date fruit is one of the most consumed fruit in South Asia in agriculture industry for fruit grading based on external
and Middle-East. Saudi Arabia alone produces around 400 quality factors in section 2. In section 3, the proposed
types of dates. Different types of dates have different features methodology is discussed containing detailed explanation of
which are difficult to classify by humans [1]. image processing and pattern recognition tools used to build
the date sorting algorithm along with classification methods
Manual grading and sorting of fruits is a repetitive, labor for each feature (color, size, shape, wrinkles). Classification
intensive and time consuming process and it is carried out by methods are discussed in section 4, followed by
humans manually through visual inspection. Also there has to implementation of these methods in section 5. Section 6
be standardization in date marketing. The dates are graded on provides the results of experiments performed. Finally
basis of their size, shape, color and texture. All these feature conclusions are drawn is section 7.
are difficult to be caught my human eye. It is hard to classify
dates that are in similar colors yet in different types. However, II. LITERATURE REVIEW
due to the different perceptions of the employees, Presently, insufficient research work has been carried out
classification mistakes were made and it leads to regarding date sorting. Extensive research is found on fruit
non-consistent and non-uniform results. sorting based on their external features such as color, texture,
In short the demerits of manual classification are that it is size and shape. These features happen to be a benchmark for
highly expensive, labors demand higher pay to inspect dates. visual inspection of fruits. The present research has been done
By mishandling, damage can occur. According to different of apples, eggplants, oranges and leaf classification [1].
perception of human labors, same date fruit can be classified In 2014 Mohana and Prabhakar graded dates on basis of
as of different size and shape etc. this decreases accuracy and shape and texture. They used contour based shape feature via
leads to non standardization. There must be an automated local binary pattern and curvelet transform. k-NN neighbor
classifier with the grading accuracy of 96.45% was used [2]. A Ohali’s results are based on only 1st coefficient of Fourier
paper written dedicatedly on shape recognition compares transform and his results of 80% accuracy cannot be achieved
different shape signatures and finds that among complex with this little information of shape profile.
coordinates, centroid distance and curvature signature,
The proposed method overcomes this shortcoming by
centroid distance is the significantly better than other shape
taking more than one coefficient of Fourier transform. The 1st
signatures and it gives better results [3]. D.J Lee et al also
value is infact totally neglected and further coefficients are
proposed date size sorting algorithm using connected
used to represent shape feature vector. Experimentally it is
component analysis [4]. D. Zhang et al used short wave
found that 16 coefficients are enough. Less than 16 causes
infrared imaging to classify. Ellipse fitting is used on
inaccurate results and more than 16 causes extra time.
segmented fruit image and fruit size is measures based on
major axis length. The training stage includes the gray-scale Also Ohali incorporated the values of size and wrinkle
histogram normalization and fruit skin threshold for each prior ratio in the input feature vector of BPNN along with one
quality class. Normalized histogram of the test fruit is Fourier coefficient (shape). Whereas the classification on basis
compared with the four predefined classes. To separate of size and number of wrinkles has already been made by
delaminated skin from normal fruit, skin threshold is using mean average relationship and using threshold in his
calculated according to histogram. For grade determination, paper. In proposed method, grading on basis of size and
four levels of delamination are compared based on the wrinkles is done using mean-variance relationship and
delamination percentage. In training stage, 40 date samples are threshold value method respectively. Whereas for shape
used for training. Total 1200 date samples are used for testing. classification RBF is used whose success rate is far better than
The accuracy of their approach was 95% for jumbo and extra BPNN. Fig.1 and fig. 2 show the overall methodology adopted
fancy classes and similarly, for fancy and confection classes to classify dates.
98% accuracy has been achieved [5].
The proposed method uses a better approach for image
A study on external quality features is carried out by segmentation using support vector machine (SVM). Image
Yousef Al Ohali in 2011. Their research focuses on shape, size segmentation is performed by Otsu’s method of thresholding
and texture of dates The system used total 1860 dates which along with SVM. The grayscale image obtained by svm
includes 3 different grades of date fruits such that each grade training of foreground and background is used in Otsu’s
consist of 620 samples. Simple threshold is used in method. The threshold value of svm grayscale image is used to
segmentation. Segmentation is followed by edge detection binarize the image.
using sobel operator. The external features of date fruit are
extracted and then classified by back propagation neural
network. The classification accuracy of 80% was achieved.
For shape feature detection they used centroid distance
formula whose 1st Fourier coefficient is used as the
irregularity measure. For size the area covered by date is
found and wrinkles are found by sobel edge detection
algorithm [1].
III. PROPOSED METHOD
Automatic date sorter algorithm is presented using
computer vision tools and neural networks for successful
classification. A paper written in 2011 by Yousef Al Ohali is
used as a benchmark and a better approach is presented
dealing with the external quality features such as size,
wrinkles and shape. A comparison is carried out between his
work and proposed solution. The areas in which improvements
are done are discussed in following paragraphs.
For shape classification Ohali used centroid distance
formula to find boundary profile of dates and took Fourier
transform of centroid distance. Only 1st coefficient of Fourier
transform is used as the irregularity measure to classify shape.
This is a wrong approach because the first coefficient is the
average value of shape profile and it doesn’t give detailed
shape information. In order to have a detailed and accurate
shape profile of date, more than one coefficients are necessary.
Otsu’s method and then by using Otsu along with SVM. The
proposed SVM based segmentation segments image without
any shadow. Whereas simple basic Otsu based segmentation
yields results with shadow o date and variable lighting in
corner too.
III. IMPLEMENTATION
To classify dates on basis of shape first back propagation is
implemented which is used in Ohali’s paper. After that, radial
basis function neural network is implemented to compare both
neural networks
During the training phase, the network is given sample
inputs and the target classes. An input vector of size 15 by 135
is input to backpropogation neural network. 15 denote the 1st
16 Fourier coefficients of shape minus the dc component. And
total 135 dates are used for training. Input layer has total 15
neurons representing 15 Fourier coefficient of date. The input
feature vector is transferred to hidden layer via input layer.
Hidden layer has 10 neurons. The activation function used in
hidden layer is tan sigmoid. The output layer has 2 neurons
representing class 1 as regular and class 2 as irregular. Batch
training is used.
2) Radial Base Function Network
In RBF, input layer takes one date at a time having 15
Fourier coefficients. The hidden layer has total 135 neurons A confusion matrix of RBF classifier is shown in fig.7.
(equal to no. of dates). Hidden layer uses Gaussian as First two diagonal cells show the number and percentage of
activation function. Output layer has 2 neurons denoting class correct classifications by the trained network. 72 dates are
1 and class 2. correctly classified as class 1 (regular). This corresponds to
53.3% of all 135 dates. Similarly, 58 dates are correctly
IV. EXPERIMENTS AND RESULTS classified as class 2(irregular). This corresponds to 43% of all
dates. 2 dates of class 2(irregular) are incorrectly classified as
Both BPNN and RBF are trained on 135 date samples (75 class 1(regular) and this corresponds to 1.5% of all 135 dates
samples of class 1, 60 samples of class 2). The testing was in the data. Similarly, 3 dates of class1 (regular) are incorrectly
done of 135 samples. Experiment in this study showed that classified as class 2(irregular) and this corresponds to 2.2% of
considering only first 16 coefficients provide good estimation all data. Out of 74 class 1 (regular) predictions, 97.3% are
of shape. The confusion matrix and results of both neural correct and 2.7% are wrong. Out of 61 class 2(irregular)
networks is shown below: predictions, 95.1 % are correct and 4.9% are wrong. Out of 75
class 1 dates (regular), 96% are correctly predicted as class 1
1) Back Propogation Neural Network
and 4 % are predicted as class2. Out of 60 class 2(irregular)
A confusion matrix of BPNN classifier is shown in fig.6. dates, 96.7% are correctly classified as class 2 and 3.7% are
First two diagonal cells show the number and percentage of classified as class 1.
correct classifications by the trained network. 67 dates are
Overall, 77% of the predictions are correct and 23% are wrong
correctly classified as class 1 (regular). This corresponds to
classifications. Results of both BPNN and RBF classifiers are
49.6% of all 135 dates. Similarly, 37 dates are correctly
stated in table 2.
classified as class 2(irregular). This corresponds to 27.4% of
all dates. 23 dates of class 2(irregular) are incorrectly
classified as class 1(regular) and this corresponds to 17% of
all 135 dates in the data. Similarly, 8 dates of class1 (regular)
are incorrectly classified as class 2(irregular) and this
corresponds to 5.9% of all data. Out of 90 class 1 (regular)
predictions, 74.4% are correct and 25.6% are wrong. Out of 45
class 2(irregular) predictions, 82.2 % are correct and 17.8%
are wrong. Out of 75 class 1 dates (regular), 89.3% are
correctly predicted as class 1 and 10.7 % are predicted as
class2. Out of 60 class 2(irregular) dates, 61.7% are correctly
classified as class 2 and 38.3% are classified as class 1.
Overall, 96.3% of the predictions are correct and 3.7% are
wrong classifications.
[1] Y. Al Ohali, "Computer vision based date fruit grading system: Design and implementation," Journal of King Saud
University - Computer and Information Sciences, vol. 23, pp. 29-36, 1// 2011.
[2] M. S. H. a. P. C.J, "A Novel Technique for Grading of Dates using Shape and Texture Features," Machine Learning and
Applications: An International Journal (MLAIJ), vol. Vol.1, p. 15, December 2014 2014.
[3] G. L. Dengsheng Zhang "A comparative Study of Fourier Descriptors for Shape Representation and Retrieval "
presented at the The 5th Asian Conference on Computer Vision, Melbourne, Australia, 2002.
[4] D.-J. Lee, R. Schoenberger, J. Archibald, and S. McCollum, "Development of a machine vision system for automatic
date grading using digital reflective near-infrared imaging," Journal of Food Engineering, vol. 86, pp. 388-398, 6// 2008.
[5] D. Zhang, D.-J. Lee, B. J. Tippetts, and K. D. Lillywhite, "Date quality evaluation using short-wave infrared imaging,"
Journal of Food Engineering, vol. 141, pp. 74-84, 11// 2014.
[6] A. Mizushima and R. Lu, "An image segmentation method for apple sorting and grading using support vector machine
and Otsu's method," Comput. Electron. Agric., vol. 94, pp. 29-37, 2013.
[7] H. K. Mebatsion, F. Boudon, C. Godin, C. Pradal, M. Génard, C. Goz-Bac, et al., "A novel profile based model for
virtual representation of quasi-symmetric plant organs," Computers and Electronics in Agriculture, vol. 75, pp. 113-124,
1// 2011.
[8] M. Hassoun. (1995). Fundamentals of Artificial Neural Networks (MIT Press)