Sie sind auf Seite 1von 5

2012 National Conference on Computing and Communication Systems (NCCCS)

Skin defect detection of Pomegranates using Color Texture Features and DWT
Meenakshi M. Pawar
Dept. of Electronics & Telecommunication
SVERIs College of Engineering Pandharpur,
Maharashtra, India
minakshee2000@gmail.com
Abstract Various Skin disorders lower the quality of fruits
due to environmental stress such as high temperature and
solar radiation some other skin disorders are induced by
chemical treatments and pathogens. Skin defect detection is
important in the development of automatic grading and sorting
system for pomegranate, because manual sorting process is
very expensive and time consuming to automate this process
skin defect can be identified with the help of color texture
feature and discrete wavelet transform. For color texture
feature analysis, acquired image is transformed into HSI color
space, which is further used for generating SGDM matrix.
Total 12 texture features were computed for hue (H),
saturation (S) and intensity (I) images from each image
samples. Then wavelet transform is used to compute statistical
features, Total 3 features were computed for R, G & B
components of each image samples. Best features were used as
an input to Support Vector Machine (SVM) classifier and tests
were performed to identify best classification model. Features
showing optimal results were mean (99%), variance (99.80),
cluster shade (99.88%), cluster prominence (99.88%), Mean
intensity (99.81%).
Keywords- pomegranate; color Co-occurrence method; texture
features; discrete wavelet transform; support vector machine

I.

INTRODUCTION

Pomegranate (Punica granatum) is a high value crop. It is a


fruit-bearing deciduous shrub or small tree that grows to
between five and eight meters tall and is best suited to
climates where winters are cool and summers are hot. The
pomegranate is thought to have been first cultivated 5 to
6,000 years ago and is native to the regions from Iran
through to north India. The main areas of world production
being in India, Iran, Spain and California. Entire tree of
pomegranate is of great economic importance. It can be
consumed as fresh fruit or used in fruit juices, teas,
pharmaceutical and medicinal products and in dyes or as
decoration. Demand in the international market has inspired
the automatic detection of quality of fruit in the agroindustry.
Recently Katyal et al.[1] focused on fruit defect detection
using 2D Gabor filter. Huang et al.[2] detected apple surface
defect using Gabor wavelet transformation and SVM.
Moradi et al.[3,4] extracted the fruit shape by ACM
algorithm and segmentation has done using SHFCM
approach then performed skin defect detection using
background subtraction and segmentation is done using
FCM. Arivazhagan et al.[5] used computer vision strategy

978-1-4673-1953-9/12/$31.00 2012 IEEE

Meghana M. Deshpande
Dept. of Electronics & Telecommunication
SVERIs College of Engineering Pandharpur,
Maharashtra, India
meghana.deshpande24@gmail.com
to recognize a fruit rely on four basic features which
characterize the object on the basis of intensity, color, shape
and texture. Blasco et al.[6] recognized skin damage in
citrus fruit using multispectral data and morphological
features and fruit sorting is done to identify the defect.
Input Image
Cropping of image

Conversion into HSI


Model

Separating RGB
Component

Generation SGDM
Matrix

Computation of DWT
Coefficient

Calculation of
Texture Matrix

Calculation of
Statistical Matrix

Figure 1. Process of developing the database of features

Figure 2.Typical Samples used in Dataset

In order to detect skin defect present in pomegranates HSI


model is used to obtain color texture features and discrete
wavelet transform is used to obtain statistical feature Fig 1.
Shows the process of developing the database features here
input samples of skin infected and uninfected are taken. For
each sample the image is cropped, HSI model is obtained
for each cropped sample from which 12 texture features are
calculated. Simultaneously each sample is transformed in to
R,G,B components to obtain DWT from each layer and
three statistical features are calculated. Fig 2. shows the
typical samples of pomegranate used in dataset. Infected

samples consist of images of Sunburn, Alternaria,


Cercospora diseases. To acquire the original images, we
used a digital camera in this work. The camera with focal
length of 40.6 to 406 mm provided a resolution of 2M pixels
(Spatial resolution of 640 480) The images were captured
along all the angles of pomegranate and stored in JPEG
format.
II.

COLOR CO-OCCURRENCE MATRIX

Kim et al. [7] used the color co-occurrence method for citrus
peel fruit classification. Pydipati et al. [8] utilized the color
co-occurrence method to extract various textural features
from the color RGB images of citrus leaves. There are two
main analysis methods for calculation of texture viz.
1) Structural Approach 2) Statistical Approach
Statistical approach, which is used here, is a quantitative
measure of arrangement of intensities in a region. Statistical
methods use second order statistics to describe the
relationships between pixels within the region by
constructing Spatial Gray-level Dependency Matrices
(SGDM). A SGDM matrix is the joint probability
occurrence of gray levels i and j for two pixels with a
defined spatial relationship in an image. Distanced and
angle are used to define the spatial relationship. If the
texture is coarse and distanced is small compared to the
size of the texture elements, the pairs of points at distance d
should have similar gray levels. In turn, if the texture is fine
and distance d is comparable to the texture size, then the
gray levels of points separated by distance d should often be
quite distinct, so that the values in the SGDM matrix should
be disperse uniformly. Thus, texture directionality can be
analyzed by examining spread measures of SGDM matrices
created at various distanced. Extraction of a numerous
texture features are possible using the SGDM matrices
generated in the above manner.
The following steps were performed to generate SGDM
matrices:
The test image is then cropped such that around 2000
cropped image.
These RGB images are converted into HSI color space
representation.
Then each pixel map is used to generate a color cooccurrence matrix, resulting in three CCM matrices, one for
each of the H, S and I pixel maps.
These matrices measure the probability that a pixel at one
particular gray level will occur at a distinct distance and
orientation from any pixel, given that pixel has a second
particular gray level. For a position operator p, we can
define a matrix Pij that counts the number of times a pixel
1 0 3 0
I ( x, y ) =

2 2 0 3
3 2 0 2
1 3 2 3

P=

1
3

0
0

0
2

1
3

with grey-level i occurs at position p from a pixel with greylevel j. For example, if we have four distinct grey-levels 0,
1, 2 and 3, then one possible SGDM matrix P (i, j, 1, 0) is
given below as shown:
The SGDMs are represented by the function P (i, j, d, )
where i represents the gray level of the location (x, y) in
the image I(x, y), and j represents the gray level of the pixel
at a distance d from location (x, y) at an orientation angle of
. The nearest neighbour mask is exemplified in Fig.3,
where the reference pixel is shown as an asterisk.

Figure 3. Nearest neighbour mask for calculating spatial Gray-level


dependence matrix (SGDM)

Statistical methods use order statistics to model the


relationships between pixels within the region by
constructing Spatial Gray-level Dependency Matrices
(SGDMs). A SGDM matrix is the joint probability
occurrence of gray levels i and j for two pixels with a
defined spatial relationship in an image.
III.

TEXTURE FEATURE CALCULATION

Texture has no unique definition, it is one of the


characteristics that segments images into regions of interest
(ROI) and classifies those regions. It provides information
about the spatial organization of the intensities in an image.
In general, texture can be defined as a characteristic of
image that can provide a higher-order description of the
image and includes information about the spatial
distribution of tonal variations or gray tones. Texture
involves the spatial distribution of gray levels. Hence
SGDM matrices were used to calculate various texture
features. These features are useful in carrying out
differentiation algorithms for skin defect detection purpose
ahead.
For differentiating infected pomegranate from the
uninfected ones the following features were calculated from
the components H, S and I:
Variance:

V=

Ng 1

(i Mi) P (i)

(1)

i =0

Cluster Shade:

Cs =

Ng 1

(i P + j P ) P(i, j )
x

i , j =1

(2)

Cluster Prominence:

Cp =

Ng 1

(i P + j P ) P(i, j )
x

(3)

i , j =1

Mean Intensity:

Mi =

w.x b = 0

Ng 1

iPx (i)

(4)

i =0

Where, Co (i, j) is the (i, j) th entry in SGDM matrix and Ng


is total number of gray levels considered for generation of
SGDM matrix. Px and Py are defined by

Px =

Ng 1 Ng 1

i P(i, j)
i =0

Py =

j =0

Ng 1Ng 1

jP(i, j )

WAVELET FEATURE CALCULATION

Wavelet analysis is an advanced feature extraction


algorithm which is based on windowing technique with
variable sized regions. The window size can be kept wide
for low frequencies and narrow for high frequencies which
lead to an optimum time frequency resolution for complete
frequency range Mukane et al.[9]. A discrete wavelet
transform (DWT) is the wavelet transform process in which
the wavelets in numerical analysis and functional analysis
are discreetly sampled. Temporal resolution is a key
advantage of wavelet transform over Fourier transform in
which it captures both frequency and location information.
In this study single level 2-D wavelet transform
decomposition is used for features extraction. The 2-D
wavelet transform will give four matrices the approximation
coefficients
matrix and
detailed
coefficients
matrices horizontal, vertical, and diagonal, respectively. The
approximation matrix CA is obtained for the three different
layers of red, green and blue from which mean feature is
obtained
Mean :

Mk =

V.

1 N N
x(i, j)
N 2 i =1 j =1

Which implies

ci ( w.xi b) 1

1 i n

Where, xi is input sample and ci output having either 1 or 1, a constant denoting the class. The vector w is
perpendicular to the separating hyperplane and the offset
parameter b allows in increasing the margin. For the linearly
separable training data, these hyperplanes can be considered
to maximize the distance between the extreme points of
each class. The distance between the hyperplanes can be

2/ w

i =0 j =0

IV.

discussion on SVM is available in references Cortes and


Vapnik [11, 12].
For linearly separable data set of {(xi , ci)}, the hyperplane
obtained by SVM for classifying the data into two classes
can be written as:

(5)

SUPPORT VECTOR MACHINE

SVM maps input vectors to a higher dimensional space


where a maximal separating hyperplane is constructed
Pawar et al [10]. SVM maps the input patterns into a higher
dimensional feature space through some nonlinear mapping
chosen a priori. A linear decision surface is then constructed
in this high dimensional feature space. Thus, SVM is a
linear classifier in the parameter space, but it becomes a
nonlinear classifier as a result of the nonlinear mapping of
the space of the input patterns into the high dimensional
feature space. The mathematical background of SVM
formulation is explained briefly in this section. Detailed

. Therefore, maximization of the distance


given as
between the hyperplanes becomes a problem of

. The primal form of optimization


minimization of
problem becomes a quadratic programming optimization
which can be written as,
Minimize

(1 / 2) w

c ( w.x b) 1

i
1 i n
subject to i
The factor of 1/2 is used for mathematical convenience. The
dual form of this optimization problem leads to a
classification problem which is only a function of the
support vectors, i.e., the training data that lie on the margin.
Originally, the SVM algorithm was developed for as a linear
classifier. However, it was further extended Boser et al [13]
to create a nonlinear classifier by applying the kernel trick.
Some common kernels include, Polynomial (homogeneous):

k ( x, x) = ( x, x)d ;
Polynomial

(inhomogeneous):

Radial Basis Function:

k ( x, x) = ( x, x + 1)d

k ( x, x) = exp( x x )

> 0 ; Gaussian Radial Basis Function:


xx
k ( x, x) = exp

2 2

VI.

, for

NUMERICAL RESULTS

Various features are computed from the test images for


components H, S and I which are further used for generating
the 3D plot of each feature independently for analyzing the
infected and uninfected pomegranate over the plot. In Fig. 4,
red color signifies the feature points for the uninfected
pomegranate whereas green color signifies the same for
infected ones. Here X, Y and Z axes represent feature of
image components Hue, Saturation and Intensity

respectively. Variance (Plot a), Cluster Shade (Plot b),


Cluster Prominence (Plot c), Mean Intensity (Plot d) and
Mean (Plot e) features were analyzed. It can be easily
observed that for differentiating the diseased pomegranate
from healthy can be easily done as the data points are
clearly separable.

a) Variance

For classification purposes, it is often anticipated that the


linear separabilty of the mapped samples is enhanced in the
kernel feature space so that applying traditional linear
algorithms in this space could result in better performance
compared those obtained in the original input space. If an
inappropriate kernel is selected, the classification
performance of kernel-based methods can be even worse
than that of their linear counterparts. Therefore, selecting a
proper kernel with good class separabilty plays a significant
role in kernel-based classification algorithms. Here the
Gaussian basis function performs well to do the job. The
contour plots for features Variance (Plot a), Cluster
Prominence (Plot b), Mean Intensity (Plot c) is shown in
Fig. 5 below. two feature classifications for black colored
dashed line shows the separating hyperplane which
separates the two classes of infected and healthy
pomegranate red color shows the support vectors which
forms classification boundary black color shows (x)
Infected class data, and yellow color shows ( ) Healthy
class data, from figures it can be easily conclude that two
classes can be clearly separable using kernel Gaussian
function.

b) Cluster Shade

a) Varience

c) Cluster Prominance

b) Cluster Prominence

d) Mean Intensity

e) Mean
Figure 4. 3D plots for feature analysis a) Variance b) Cluster Shade c)
Cluster Prominance d) Mean Intensity e) Mean

c) Mean Intensity
Figure 5. Contour plot of SVM classifier a) Variance b) Cluster
Prominence c) Mean Intensity

The performance of the SVM classification is measured in


terms of success rate which is the ratio of number correctly
classified sample against the total number of samples used
for classification.
SR=

Nc
*100
N

(6)

Performance of SVM is estimated for different groups of


features as shown in Table 1 SVM is tested for five set of
features viz. Mean, Variance ,cluster shade ,cluster
prominence and Mean Intensity. Almost all features are
showing success rate above 99%.The Overall success rate is
99.67% it shows that the SVM is best suited for this
application.
TABLE I.
Sr. No.
1.
2.
3.
4.
5.

SUCCESS RATE

Feature
Mean
Variance
Cluster Shade
Cluster Prominence
Mean Intensity

Success Rate
99%
99.80%
99.88%
99.8835%
99.81%

VII. CONCLUSION
In this paper, the application of nonlinear feature extraction
for Pomegranate is presented. The features are obtained
using HSI color model and wavelet transform, SVM is used
for classification of the data. The result of skin defect
detection of Pomegranate using SVM shows that all features
are showing success rate above 99%, this gives the
confidence that this algorithm can be used for automatic
detection of quality of fruit.
REFERENCES
[1]

[2]

[3]

[4]
[5]

[6]

[7]

V. Katyal and D. Srivastava Efficient Fruit Defect Detection


and Glare removal Algorithm by anisotropic diffusion and 2D
Gabor filter, International Journal of Engineering Science &
Advanced Technology, Vol. 2 ,pp. 352 357, 2012.
W.Huang , C. Zhang and B. Zhang Identifying Apple Surface
Defects Based on Gabor Features and SVM Using Machine
Vision, journal of computer and computing technologiesin
agriculture(IFIP Advances in Information and Communication
Technology), Vol. 370,pp. 343-350, 2012.
G. Moradi, M. Shamsi ,M. Sedaghi and R. Alsharif, Fruit
defect detection from color images using ACM and MFCM
algorithms, International Conference on Electronic Devices,
Systems and Applications (ICEDSA), 2011, pp. 182 - 186 , 2527 April 2011.
G. Moradi,Apple Defect Detection Using Statistical Histogram
Based Fuzzy C-Means Algorithm, Machine Vision and Image
Processing (MVIP), 2011 7th Iranian, pp. 1-5, 16-17 Nov. 2011.
S.Arivazhagan, R.Newlin Shebiah, S.Selva Nidhyanandhan and
L.Ganesan, Fruit Recognition using Color and Texture
Features, Journal of Emerging Trends in Computing and
Information Sciences, vol. 1 no. 2 , 2010.
J. Blasco, N. Aleixos, J. Gomez-Sanchand E. Molto
Recognition and classification of external skin damage in
citrus fruits using multispectral data and morphological
features, Journal of biosystems engineering, vol.103,pp.137145,2009
D. Kim, Thomas, F. Burks, Q. Jianwei and M. Duke,
Classification of grapefruit peel diseases using colour texture

[8]

[9]

[10]

[11]
[12]
[13]

feature analysis in Int. Journal of agriculture and biological


engineering, vol. 2 no. 3,pp. 41-50, 2009.
R. Pydipati, T.F. Burks and W.S. Lee, Identification of citrus
disease using color texture features and discriminant analysis,
in Science Direct, University of Florida, 225 Frazier-Rogers
Hall, Gainesville, United States, 2006.
M. Mukane, S. Gengaje, and S. Bormane, On Scale Invariance
Texture Image Retrival using Fuzzy Logic and Wavelet Coroccurrence based Features, International journal of computer
applications, Vol.18(3), pp.10-17,2011.
Pawar p. and Jung s,Support Vector Machine based Online
Composite Helicopter Rotor Blade Damage Detection System ,
Journal Of Intelligent Material Systems And Structures, vol. 19,
pp. 1217-1228, 2007.
Cortes C. and Vapnik V. , Support Vector Networks, Machine
Learning, pp.273-297, 1995
Vapnik V.. The Nature of Statistical Learning Theory, SpringerVerlag, New York, 1995.
Boser , I. Guyon, and V. Vapnik , A Training Algorithm for
Optimal Margin Classifiers, Proceedings of the Fifth Annual
workshop on Computational learning Theory Pittsburgh Pennsyl
vania USA, pp.144-152, 1992.

Das könnte Ihnen auch gefallen