SlideShare a Scribd company logo
Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 
INTERNATIONAL JOURNAL OF COMPUTER ENGINEERING & 
17 – 19, July 2014, Mysore, Karnataka, India 
TECHNOLOGY (IJCET) 
ISSN 0976 – 6367(Print) 
ISSN 0976 – 6375(Online) 
Volume 5, Issue 9, September (2014), pp. 11-19 
© IAEME: www.iaeme.com/IJCET.asp 
Journal Impact Factor (2014): 8.5328 (Calculated by GISI) 
www.jifactor.com 
11 
 
IJCET 
 
© I A E M E 
 
USING K-MEANS CLUSTER AND FUZZY C MEANS FOR DEFECT 
SEGMENTATION IN FRUITS 
VaniAshok1, Dr. D.S. Vinod2 
 
1(Computer Science  Engineering, Sri Jayachamarajendra College of Engineering, Mysore, 
Karnataka, India) 
2(Information Science  Engineering, Sri Jayachamarajendra College of Engineering., Mysore, 
Karnataka, India) 
 
 
ABSTRACT 
Quality and safety are the key factors in modern food industries. The quality of fruits and 
vegetables is a common combination of characteristics, attributes and properties that have 
significance and make for acceptability. One of the most popular applications of computer vision is 
to inspect qualities of food products based on form, color and presence of defects. Appearance 
factors such as size or dimension, shape, surface texture, surface color, and external or surface 
defects define external quality and directly influence consumers in purchasing a product, and they 
can be evaluated by means of computer vision techniques. The proposed paper presents defect 
segmentation of fruits based on surface color features with unsupervised K-Means clustering and 
Fuzzy C-Means algorithms. As the first step, the digital color images of defective apples are pre-processed 
using Gaussian low-pass filter (GLPF) smoothing operator to remove noise. The images 
are then segmented with the purpose of separating the defects from the edible regions using proposed 
clustering algorithms. A comparison analysis is also performed among the two methods. 
Keywords: Image segmentation, Clustering, Histogram, Filtering, K-means, Fuzzy C-Means (FCM) 
1. INTRODUCTION 
Quality and safety are the key factors in modern food industries. Increasing consciousness of 
quality, particularly in the food and health sector, strongly demands research activities regarding the 
production of defined quality, the preservation of quality during marketing, and thus also the 
possibilities of evaluating quality parameters and of integrating this into production processes. The 
pallet of possible damage to fruit and vegetables is extremely extensive and is often a criterion of
Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 
17 – 19, July 2014, Mysore, Karnataka, India 
quality determination methods, for example, malformations, rust fungi, formation of cork, splits, 
bitter pit, insect damage, rots, scalds, temperature damage, and glassiness or other physiological 
diseases of the storage phase. In addition, there are various risks for injuries during harvest and 
transport [1]. With the increasing quality awareness among consumers, the expectation for improved 
quality in agricultural and food products has increased the need for enhanced quality monitoring. 
There is a need to develop various image analysis techniques to meet the demand of the growing 
population. Moreover there is growing demand for automation in food industries due to the fact that 
the traditional labor intensive manual inspection processes are inefficient, inaccurate and ineffective. 
The application of computer vision in agriculture has increased considerably in recent years due to 
the fact that it provides substantial amounts of information about the nature and attributes of the 
objects present in a scene. 
12 
 
The use of this technology has spread rapidly in inspecting agri-food commodities, including 
meat quality assessment, automated poultry carcass inspection, quality evaluation of fish, 
visualization of sugar distribution of melons, measuring ripening of tomatoes, defect detection of 
pickling cucumber, and classification of wheat kernels [2]. The computer vision is particularly used 
more in automatic inspection of fruits and vegetables, since it is more reliable and objective than 
human inspection [3]. 
Quality assessment of fruits and vegetables is done based on the analysis of external features 
like color, size, shape, texture and presence of damage. As consumers are mostly influenced to 
choose or reject a particular fruit by its color, it is the most important attribute for assessing the 
quality of fruits. The most widely used color spaces in computers and digital images are RGB, HSI 
and L*a*b*. In RGB the color of a pixel in image is expressed as three coordinates of primary colors 
red, green and blue in a color space. HIS is the color space which is closer to the human perception 
of color, like the hue, saturation and intensity. However, RGB and HSI are non-uniform color spaces 
and hence uniform color space like L*a*b* is used to implement the proposed algorithms. 
The defect segmentation of fruits based on surface color feature can be considered as an 
instance of image segmentation where we are segmenting only the defective portion of the fruit. 
Image segmentation is the process of partitioning the image into several constituent components. It 
partitions the digital image into disjoint (non-overlapping) regions. Segmentation is an essential step 
in computer vision and automatic pattern recognition processes based on image analysis of foods as 
subsequent extracted data are highly dependent on the accuracy of this operation. Food image 
segmentation is still an unsolved problem because of its complex and under constrained attributes 
[4]. 
Image segmentation methods are generally based on one of two fundamental properties of the 
intensity values of image pixels: similarity, where the image is partitioned into regions that are 
similar according to a set of predefined criteria, and discontinuity, where the image is partitioned 
based on sharp changes in intensity values. Based on the discontinuity or similarity criteria, many 
segmentation methods have been introduced which can be broadly classified into six categories: (1) 
Histogram based method, (2) Edge Detection, (3) Neural Network based segmentation methods, (4) 
Physical Model based approach, (5) Region based methods (Region splitting, Region growing and 
merging), (6) Clustering (Fuzzy C-means clustering and K-Means clustering) [5]. The unsupervised 
clustering algorithms are particularly appropriate for the exploration of interrelationship among the 
data points to make an assessment of the structure where there is little a priori information available 
about the data [6]. 
2. RELATED WORKS 
Physical appearances of food extremely vary causing difficulties for computer vision 
systems. Fruits, in particular, have numerous kinds of defects and highly varying skin color. Hence,
Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 
17 – 19, July 2014, Mysore, Karnataka, India 
they pose even more problems for computer vision-based quality inspection systems. Paul Martinsen 
and Peter Schaare [7] have proposed a method for predicting chemical component distribution in 
kiwifruit using imaging spectroscopy techniques. The author used partial least- squares method for 
data modeling. J Blasco et al. [8] proposed the segmentation procedure, based on a Bayesian 
discriminant analysis, to allow fruits to be precisely distinguished from the background. The machine 
vision system thus developed detected the external defects of the apples with 86% accuracy. The 
feasibility of NIR spectroscopy in combination with powerful multivariate calibration techniques, 
such as Partial Least Squares regression (PLS), to measure quality attributes of fruit and vegetables 
has been demonstrated by B.M. Nicolai et al. [9]. J. Tan [10] suggested filtering, background 
removal, segmentation of fat from muscles, isolation of the LD muscle and segmentation of marbling 
from the LD muscle to assess the quality attributes of meat images. K.Vijayarekha [11] discusses the 
multivariate image analysis technique applied to the defect segmentation of apple fruit in 
multispectral range. 
13 
 
An intensive study on apple quality inspection is carried out by Unay [12]. The apple images 
were captured through color/monochrome camera in diffusely illuminated tunnel with two different 
light sources (fluorescent tubes and incandescent spots). To improve the image quality a noise 
removal operation was performed before applying the image segmentation operation to detect the 
defect type. The image intensity and texture based shape features were extracted from each 
segmented portion of the image. The performance of several classification methods (Linear 
Discriminant Classifier (LDC), k-Nearest Neighbors (k-NN), Fuzzy k-NN, Support Vector Machine 
(SVM), Decision Tree and Multi-layer Perceptrons (MLP) were studied for defect segmentation and 
detection. They identified bruise, flesh damage, frost damage, hail, hail with perforation, limb rub, 
scar tissue, rots, russet and scald defects. 
Gabriel Leiva et al. [13] devised methodology to classify blueberries with fungal decay, 
shrivelling and mechanical damage using statistical pattern recognition techniques: extracting the 
most possible features, selecting the best ones, training the best classification algorithm. The feature 
extraction strategies used were Sequential Forward Selection (SFS), with objective functions: Fisher 
discriminant, K-Nearest Neighbour (KNN), Linear and Quadratic Discriminant Analysis (LDA and 
QDA); and other feature extractors without objective function used were: Forward orthogonal search 
algorithm by maximizing the overall dependency, Least Squares Ellipse Fitting (LSEF) and Rank 
key features by class separability criteria. With the selected features, decision lines, planes or hyper 
planes classifiers were implemented using LDA, QDA, minimal distance, Mahalanobis Distance 
(MD), KNN (with 4 to 30 nearest neighbours), Support Vector Machine (SVM) and different Neural 
Networks techniques (NN). 
Apart from fruit quality assessment researchers are trying to investigate fruit characteristics 
that can be used for fruit grading process. V. Leemans et al. [14] have achieved fruit grading is six 
steps: image acquisition; ground colour classification; defect segmentation; calyx and stem 
recognition; defects characterization and finally the fruit classification into quality classes. They 
realized color grading using a simple neural network with no hidden layer, using the three 
luminances (red, green and blue) of the considered pixel as input. The calyx and stem ends, which 
appear on an image as defects, were detected using a correlation pattern recognition technique and 
defect segmentation was done using Gaussian model of the fruit color, measuring the Mahalanobis 
distance separating the mean color of the fruit and of each pixel. 
Yousef Al Ohali [15] has designed computer mediated date fruit quality assessment and 
sorting system. He has used the color intensity distribution in the image as an estimate of flabbiness 
of date fruit. Back Propagation Neural Network (BPNN) is used to classify the dates into three 
groups, Grade-1: fruits having good shape, high flabbiness, Grade 2: fruits with distorted shape, low 
flabbiness and Grade 3: fruits having defects.
Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 
17 – 19, July 2014, Mysore, Karnataka, India 
i x −μ (2) 
μ : (3) 
= = (5) 
14 
3. CLUSTERING ALGORITHMS 
 
In this section, the basic sets of definitions are presented to provide the preliminaries of the 
clustering methods. First we define the K-means clustering method. The second part discusses about 
Fuzzy C- means (FCM) clustering. 
3.1 K-Means Clustering Algorithms 
K-means method is an unsupervised clustering method that classifies the input data objects 
into multiple classes on the basis of their inherent distance from each other [5]. Clustering algorithm 
assumes that a vector space is formed from the data features and tries to identify natural clustering in 
them. The objects are clustered around the centroids i = 1 i μ 
…..k which are computed by 
minimizing the following objective 
  −μ 
= Î 
V = 2 
j (x ) 
1 x S 
j i 
i 
k 
i 
(1) 
Where k is the number of clusters i.e. Si, i = 1, 2…., k and i μ is the mean point or centroid of all the 
points j i x ÎS . 
The algorithm of an iterative version K-means clustering is as follows: 
Step 1. Compute the distribution of the intensity values. 
Step 2. Using k random intensities initialize the centroids. 
Step 3. Cluster the image points based on the distance of their intensity values from the centroid 
intensity values. 
(i ) c := arg minj 
2 
( ) 
j 
Step 4. Compute new centroid for each cluster. 
 
1{ } 
 
= 
= 
c j x 
= 
= 
= m 
i 
i 
m 
i 
i 
i 
i 
c j 
1 
( ) 
1 
( ) 
( ) 
1{ } 
where k is the number of clusters, i iterates over all the intensity values, j iterates over all the 
centroids. 
Step 5. Repeat Step 3 and Step 4 until the labels of the cluster do not change any more. 
3.2 Fuzzy C-Means Clustering Algorithms 
Fuzzy C-means (FCM) is a clustering technique which differs from hard K-means that 
employs hard partitioning [16]. The FCM employs fuzzy partitioning such that a data point can 
belong to all groups with different membership grades between 0 and 1. FCM is an iterative 
algorithm. The aim of FCM is to find cluster centers (centroids) that minimize a dissimilarity 
function. To accommodate the introduction of fuzzy partitioning, the membership matrix (U) is 
randomly initialized according to, 
 =  = 
= 
u j n 
c 
i 
ij 1, 1,...., 
1 
(4) 
The dissimilarity function used in FCM is given by, 
2 
c 
c i J U c c c J u d 
1 2 ( , , ,...., ) ij 
1 i 
1 1 
n 
j 
m 
ij 
c 
i 
= = = 
Uij is between 0 and 1; 
Cij is the centroid of cluster i;
Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 
17 – 19, July 2014, Mysore, Karnataka, India 
dij is the Euclidean distance between ith centroid(ci) and jth data point; 
mÎ [1,] is a weighting exponent or fuzziness parameter 
1 (6) 
S S U U u u (8) 
15 
 
To reach a minimum of dissimilarity function there are two conditions which are given in 
Equation (6) and Equation (7). 
 
 
u x 
= 
= = n 
j 
m 
ij 
j 
n m 
j ij 
i 
u 
c 
1 
 = 
− 
 
  
 
 
  
 
= 
c 
k 
m 
ij 
kj 
ij 
d 
d 
u 
1 
2 /( 1) 
1 
(7) 
Precisely speaking, initially the uij and the centers of the clusters are assigned randomly and 
the uij is updated in each iteration. The iterative process stops when 
( ) ( 1) ( ) ( 1) p e max − − − = − s 
ij 
S 
ij 
The FCM that iteratively updates the cluster centers and the membership grades for each data 
point is as follows: 
Step 1. Randomly initialize the membership matrix (U) that has constraints as given in Equation (4) 
Step 2. Calculate centroids (ci) by using Equation (6). 
Step 3. Compute dissimilarity between centroids and data points using equation (5). Stop if its 
improvement over previous iteration is below a threshold. 
Step 4. Compute a new U using Equation (7). If condition given in Equation (8) is False, go to 
Step 2. 
FCM iteratively moves the cluster centers to the right location within a data set. 
4. DEFECT SEGMENTATION 
In this section, the implementation of K-means and Fuzzy C-means clustering algorithms for 
defect segmentation in apple fruits is presented. 
4.1 Using K-Means Clustering 
Step 1. Read the input image of defective fruit. 
Step 2. In order to remove the image noise and reduce detail levels the Gaussian low-pass filter 
(GLPF) smoothing operator is applied. 
Step 3. Transform the image from RGB to L*a*b* color space as all of the color information is 
present in the a* and b* layers only. 
Step 4. Calculate the histograms of the image to decide the number of clusters. 
Step 5. Classify colors using K-means clustering in a*b* space, with Euclidean distance to measure 
the distance between two colors.
Proceedings of the 2nd International Conference on 
Step 6. Label each pixel in the image from the results of K 
labeled with its cluster index. 
Step 7. Generate different images for each cluster. 
4.2 Using Fuzzy C-Means 
ICCTEM -2014 
Step 1. Read the input image of defective fruit. 
Step 2. In order to remove the image noise and reduce detail levels the Gaussian low 
(GLPF) smoothing operator is applied. 
Step 3. Calculate the histograms of the image to decide the number of clusters. 
Step 4. Classify pixel intensities using FCM algorithm (initial value of 
number of clusters as determined in Step 3. 
Step 5. Generate image by allocating different intensity levels for each subclass of the image. 
5. EXPERIMENTAL RESULTS 
To determine the performance of the clustering approaches, we have considered apples as a 
case study. The data set consists of various images of apples with defects such as apple scab, rot and 
blotch for the purpose of defect segmentation. Fig. 1 
apples from the data set. 
(a) 
Fig. 1: 
Fig. 2, Fig. 3 and Fig. 4 show defect segmentation result 
means clustering. 
(a) (b) 
Fig. 2: K-Means 
(a) Filtered Image (b) First Cluster 
Current Trends in Engineering and Management 
17 – 19, July 2014, Mysore, Karnataka, India 
16 
K-means. Every pixel of the image will be 
ead m = 2 and 
represents some of the images of defective 
(b) (c) 
Sample Images from the Dataset 
results of sample apple fruits using K 
(c) (d) 
eans Defect Segmentation of an Apple with Scab 
(c) Second Cluster (d) Third Cluster (e) Histogram 
 
low-pass filter 
e = 0.01) with 
K- 
(e)
Proceedings of the 2nd International Conference on 
(a) (b) 
Fig. 3: K-Means D 
600 
500 
400 
300 
200 
100 
0 
0 50 
Defect Segmentation of an Apple with Blotch 
(a) Filtered Image (b) First Cluster 
(a) (b) 
Fig. 4: K-Means Defect Segmentation 
100 150 200 250 
egmentation of a Rotten Apple (a) Filtered Image (b) First Cluster 
(c) Second C 
Current Trends in Engineering and Management 
17 – 19, July 2014, Mysore, Karnataka, India 
(c) (d) 
(c) Second Cluster (d) Third Cluster (e) Histogram 
(c) (d) 
Cluster (d) Third cluster (e) Histogram 
We have segmented the input image into three clusters depending on the data provided by the 
histogram shown in Fig. 2(e), Fig. 3(e) and Fig. 4(e). Fig. 2(a), Fig. 3(a) and Fig. 4(a) show the 
preprocessed image filtered by Gaussian low 
different clusters second cluster correctly segments the defective portion of the image whereas the 
first cluster demonstrates the non-defective defect 
part of the fruit. 
Fig. 5, Fig. 6 and Fig. 7 illustrate the resultant images ob 
(a) 
low-pass filter smoothing operator. Among the images in 
Fig. 5: Fuzzy C-Means Defect Segmentation 
(a) 
Fig. 6: Fuzzy C-Means Defect Segmentation 
(a) Filtered Image (b) FCM Processed Image 
17 
obtained from FCM. 
(b) 
of an Apple with Scab (a) Filtered Image (b) FCM 
Processed Image 
(b) 
of an Apple with Blotch 
ICCTEM -2014 
 
(e) 
(e)
Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 
17 – 19, July 2014, Mysore, Karnataka, India 
18 
 
(a) (b) 
Fig. 7: Fuzzy C-Means Defect Segmentation of a Rotten Apple 
(a) Filtered Image (b) FCM Processed Image 
The filtered images are shown in Fig. 5(a), Fig. 6(a) and Fig. 7(a). The FCM segmented 
images with three clusters are shown in Fig. 5(b), Fig. 6(b) and Fig. 7(b). The amount of defect in a 
given sample using K-Means and FCM clustering is tabulated in Table 1. FCM, being unsupervised 
fuzzy clustering algorithm, is motivated by the need to find interesting patterns or groupings in a 
given set of data. The cluster allocation in FCM is based on the high membership value and less on 
distance. 
Table 1: Amount of Defect in Selected Fruit Samples 
SI. 
No. 
Data 
Sample 
K-Means FCM 
1 Figure 1(a) 60% 52% 
2 Figure 1(b) 44% 40% 
3 Figure 1(c) 10% 9% 
6. CONCLUSION 
The automated inspection of agricultural products, fruits in particular, is an important process 
as it reduces human interaction with the inspected goods, classify generally faster than humans and 
tend to be more consistent in classification. The segmentation of defects in fruits is proposed and 
evaluated in this paper. The proposed approach used K-Means clustering and Fuzzy C-Means 
clustering to segment defects in apple images. Experimental results suggest that the algorithms are 
able to segment the defects more accurately. The major drawback of K-Means is that, there may be a 
skewed clustering result if the cluster number estimate is incorrect. It is overcome to certain extent in 
the proposed method by determining the number of clusters using the histogram of the image. The 
image is also pre-processed to remove noise. 
7. REFERENCES 
1. Peter Butz, Claudia Hofmann, Bernhard Tauscher, Recent Developments in Noninvasive 
Techniques for Fresh Fruit and Vegetable Internal Quality Analysis, Journal Of Food Science, 
Vol. 70, Nr. 9, 2005. 
2. Sun, D.-W, Hyperspectral imaging for food quality:A non-destructive tool for food quality and 
safety evaluation and inspectio”, London: Academic, 2010. 
3. Sergio Cubero, Nuria Aleixos, Enrique Moltó, Juan Gómez-Sanchis, Jose Blasco, Advances 
in Machine Vision Applications for Automatic Inspection and Quality Evaluation of Fruits and 
Vegetables, Food Bioprocess Technol 4: 2011, 487–504. 
4. Domingo Mery, Franco Pedreschi, Segmentation of colour food images using a robust 
algorithm, Journal of Food Engineering 66, 2005, 353–360.
Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 
17 – 19, July 2014, Mysore, Karnataka, India 
19 
 
5. Shiv Ram Dubey, Pushkar Dixit, Nishant Singh, Jay Prakash Gupta, Infected Fruit Part 
Detection using K-Means Clustering Segmentation Technique, International Journal of 
Artificial Intelligence and Interactive Multimedia, 2013, Vol. 2, No.2. 
6. Jaskirat Kaur, Sunil Agarwal, Venu Vig, Performance analysis of clustering based image 
segmentation and optimization methods, CSIT-CSCP, 2012, 245-254. 
7. Paul Martinsen, Peter Schaare, Measuring soluble solids distribution in kiwifruit using near-infrared 
imaging spectroscopy, Postharvest Biology and Technology 14014, 1998, 271–281. 
8. J. Blasco, N. Aleixos, E. Molto, Machine Vision System for Automatic Quality Grading of 
Fruit, Biosystems Engineering, 2003, 85 (4), 415–423. 
9. Bart M. Nicolai, Katrien Beullens, Els Bobelyn, Ann Peirs, Wouter Saeys, Karen I. Theron, 
Jeroen Lammertyna, Nondestructive measurement of fruit and vegetable quality by means of 
NIR spectroscopy: A review, Postharvest Biology and Technology, 46, 2007, 99–118. 
10. J. Tan, “Meat quality evaluation by computer vision”, Journal of Food Engineering 61, 2004, 
27–35. 
11. K. Vijayarekha, Multivariate image analysis for defect identificationof apple fruit images, 
IEEE Transactions, 2008. 
12. Unay, Dervim, Multispectral Image Processing and Pattern Recognition Techniques for 
Quality Inspection of Apple Fruit, Ph.D. Thesis, 2006, Facult´e Polytechnique de Mons, 
Belgium. 
13. Gabriel Leivaa, Germán Mondragónb, Domingo Meryb, José Miguel Aguilera, The automatic 
sorting using image processing improves postharvest blueberriesstorage quality, 2011, ICEF. 
14. V. Leemans, H. Mageinb, M.-F. Destain, On-line Fruit Grading according to their External 
Quality using Machine Vision, Biosystems Engineering, 2002, 83 (4), 397–404. 
15. Yousef Al Ohali, Computer vision based date fruit grading system: Designand 
implementation, Journal of King Saud University – Computer and Information Sciences, 2011, 
23, 29–36. 
16. Ebrahim Aghajari, Gharpure Damayanti, Incorporating FCM and Back Propagation Neural 
Network for Image Segmentation, International Journal of Computer  communication 
Technology, 2011, Volume-2, Issue-VIII.

More Related Content

PDF
IRJET- Food (Fruit) Quality Recognition by External Appearance and InternalFl...
PDF
Analysis And Detection of Infected Fruit Part Using Improved k-means Clusteri...
PDF
Classification of Macronutrient Deficiencies in Maize Plant Using Machine Lea...
PDF
IRJET- A Food Recognition System for Diabetic Patients based on an Optimized ...
PDF
SEED IMAGE ANALYSIS
PDF
IRJET- Identify Quality Index of the Fruit Vegetable by Non Destructive or wi...
PDF
IRJET- A Fruit Quality Inspection Sytem using Faster Region Convolutional...
PDF
Plant Monitoring using Image Processing, Raspberry PI & IOT
IRJET- Food (Fruit) Quality Recognition by External Appearance and InternalFl...
Analysis And Detection of Infected Fruit Part Using Improved k-means Clusteri...
Classification of Macronutrient Deficiencies in Maize Plant Using Machine Lea...
IRJET- A Food Recognition System for Diabetic Patients based on an Optimized ...
SEED IMAGE ANALYSIS
IRJET- Identify Quality Index of the Fruit Vegetable by Non Destructive or wi...
IRJET- A Fruit Quality Inspection Sytem using Faster Region Convolutional...
Plant Monitoring using Image Processing, Raspberry PI & IOT

What's hot (17)

PDF
IRJET- Applications of different Techniques in Agricultural System: A Review
PDF
La2418611866
PDF
Classify Rice Disease Using Self-Optimizing Models and Edge Computing with A...
PDF
528Seed Technological Development – A Survey
PDF
Identification and Classification of Fruit Diseases
PDF
Grading and quality testing of food grains using neural
PDF
Grading and quality testing of food grains using neural network
PDF
Computer Vision based Model for Fruit Sorting using K-Nearest Neighbour clas...
PDF
Weed and crop segmentation and classification using area thresholding
PDF
IRJET- Automatic Fruit Quality Detection System
PDF
A Study of Image Processing in Agriculture
PDF
The quality identification of fruits in image processing using matlab
PDF
1825 4925-1-pb
PDF
Quality Evaluation Technique For Phyllanthus Emblica(Gooseberry) Using Comput...
PDF
Classification of Mango Fruit Varieties using Naive Bayes Algorithm
PDF
IRJET - Survey on Soil Classification using Different Techniques
PDF
IRJET- Texture based Features Approach for Crop Diseases Classification and D...
IRJET- Applications of different Techniques in Agricultural System: A Review
La2418611866
Classify Rice Disease Using Self-Optimizing Models and Edge Computing with A...
528Seed Technological Development – A Survey
Identification and Classification of Fruit Diseases
Grading and quality testing of food grains using neural
Grading and quality testing of food grains using neural network
Computer Vision based Model for Fruit Sorting using K-Nearest Neighbour clas...
Weed and crop segmentation and classification using area thresholding
IRJET- Automatic Fruit Quality Detection System
A Study of Image Processing in Agriculture
The quality identification of fruits in image processing using matlab
1825 4925-1-pb
Quality Evaluation Technique For Phyllanthus Emblica(Gooseberry) Using Comput...
Classification of Mango Fruit Varieties using Naive Bayes Algorithm
IRJET - Survey on Soil Classification using Different Techniques
IRJET- Texture based Features Approach for Crop Diseases Classification and D...
Ad

Viewers also liked (16)

PDF
Segmentation of unhealthy region of plant leaf using image processing techniques
PPT
Buscadores del mundo-1[1]
PPTX
Buscadores y Traductores
PPTX
Los servicios de google
PDF
Buscadores
PDF
Buscadores y traductores
PPT
Traductores y Buscadores
PPT
Buscadores Y Traductores En Internet
PPTX
la computadora
PPTX
TRADUCTORES ONLINE
PPTX
traductores y buscadores del año 2013
PDF
Fuzzy c-Means Clustering Algorithms
PPT
Fuzzy c-means clustering for image segmentation
PDF
Buscadores y traductores[1]
PPTX
Buscadores y traductores
PPTX
Los mejores buscadores y traductores de la web
Segmentation of unhealthy region of plant leaf using image processing techniques
Buscadores del mundo-1[1]
Buscadores y Traductores
Los servicios de google
Buscadores
Buscadores y traductores
Traductores y Buscadores
Buscadores Y Traductores En Internet
la computadora
TRADUCTORES ONLINE
traductores y buscadores del año 2013
Fuzzy c-Means Clustering Algorithms
Fuzzy c-means clustering for image segmentation
Buscadores y traductores[1]
Buscadores y traductores
Los mejores buscadores y traductores de la web
Ad

Similar to Using k means cluster and fuzzy c means for defect segmentation in fruits (20)

PDF
REAL FRUIT DEFECTIVE DETECTION BASED ON IMAGE PROCESSING TECHNIQUES USING OPENCV
PDF
Paper id 42201614
PDF
Gq3611971205
PPTX
phase 1 ppt dal adulteration.pptx
PDF
Stem Removal of Citrus Fruit by Finest StemcompleteRm Thresholding Method
PDF
SADCNN-ORBM: a hybrid deep learning model based citrus disease detection and ...
PDF
Gw3512081212
PDF
AN IMAGE PROCESSING APPROACHES ON FRUIT DEFECT DETECTION USING OPENCV
PDF
IRJET- AI Based Fault Detection on Leaf and Disease Prediction using K-means ...
PDF
IRJET- Leaf Disease Detecting using CNN Technique
PDF
Plant Diseases Prediction Using Image Processing
PDF
IRJET-Android Based Plant Disease Identification System using Feature Extract...
PDF
Machine learning applications to non-destructive defect detection in horticul...
PDF
Exploring Deep Learning Models for Image Recognition: A Comparative Review
PDF
EXPLORING DEEP LEARNING MODELS FOR IMAGE RECOGNITION: A COMPARATIVE REVIEW
PDF
Plant Leaf Disease Detection and Classification Using Image Processing
PDF
IRJET- Food(Fruit) Quality Recognition by External Appearance and Interna...
PDF
IRJET - Paddy Crop Disease Detection using Deep Learning Technique by using D...
PDF
K010516270
PDF
Optimized deep learning-based dual segmentation framework for diagnosing heal...
REAL FRUIT DEFECTIVE DETECTION BASED ON IMAGE PROCESSING TECHNIQUES USING OPENCV
Paper id 42201614
Gq3611971205
phase 1 ppt dal adulteration.pptx
Stem Removal of Citrus Fruit by Finest StemcompleteRm Thresholding Method
SADCNN-ORBM: a hybrid deep learning model based citrus disease detection and ...
Gw3512081212
AN IMAGE PROCESSING APPROACHES ON FRUIT DEFECT DETECTION USING OPENCV
IRJET- AI Based Fault Detection on Leaf and Disease Prediction using K-means ...
IRJET- Leaf Disease Detecting using CNN Technique
Plant Diseases Prediction Using Image Processing
IRJET-Android Based Plant Disease Identification System using Feature Extract...
Machine learning applications to non-destructive defect detection in horticul...
Exploring Deep Learning Models for Image Recognition: A Comparative Review
EXPLORING DEEP LEARNING MODELS FOR IMAGE RECOGNITION: A COMPARATIVE REVIEW
Plant Leaf Disease Detection and Classification Using Image Processing
IRJET- Food(Fruit) Quality Recognition by External Appearance and Interna...
IRJET - Paddy Crop Disease Detection using Deep Learning Technique by using D...
K010516270
Optimized deep learning-based dual segmentation framework for diagnosing heal...

More from IAEME Publication (20)

PDF
IAEME_Publication_Call_for_Paper_September_2022.pdf
PDF
MODELING AND ANALYSIS OF SURFACE ROUGHNESS AND WHITE LATER THICKNESS IN WIRE-...
PDF
A STUDY ON THE REASONS FOR TRANSGENDER TO BECOME ENTREPRENEURS
PDF
BROAD UNEXPOSED SKILLS OF TRANSGENDER ENTREPRENEURS
PDF
DETERMINANTS AFFECTING THE USER'S INTENTION TO USE MOBILE BANKING APPLICATIONS
PDF
ANALYSE THE USER PREDILECTION ON GPAY AND PHONEPE FOR DIGITAL TRANSACTIONS
PDF
VOICE BASED ATM FOR VISUALLY IMPAIRED USING ARDUINO
PDF
IMPACT OF EMOTIONAL INTELLIGENCE ON HUMAN RESOURCE MANAGEMENT PRACTICES AMONG...
PDF
VISUALISING AGING PARENTS & THEIR CLOSE CARERS LIFE JOURNEY IN AGING ECONOMY
PDF
A STUDY ON THE IMPACT OF ORGANIZATIONAL CULTURE ON THE EFFECTIVENESS OF PERFO...
PDF
GANDHI ON NON-VIOLENT POLICE
PDF
A STUDY ON TALENT MANAGEMENT AND ITS IMPACT ON EMPLOYEE RETENTION IN SELECTED...
PDF
ATTRITION IN THE IT INDUSTRY DURING COVID-19 PANDEMIC: LINKING EMOTIONAL INTE...
PDF
INFLUENCE OF TALENT MANAGEMENT PRACTICES ON ORGANIZATIONAL PERFORMANCE A STUD...
PDF
A STUDY OF VARIOUS TYPES OF LOANS OF SELECTED PUBLIC AND PRIVATE SECTOR BANKS...
PDF
EXPERIMENTAL STUDY OF MECHANICAL AND TRIBOLOGICAL RELATION OF NYLON/BaSO4 POL...
PDF
ROLE OF SOCIAL ENTREPRENEURSHIP IN RURAL DEVELOPMENT OF INDIA - PROBLEMS AND ...
PDF
OPTIMAL RECONFIGURATION OF POWER DISTRIBUTION RADIAL NETWORK USING HYBRID MET...
PDF
APPLICATION OF FRUGAL APPROACH FOR PRODUCTIVITY IMPROVEMENT - A CASE STUDY OF...
PDF
A MULTIPLE – CHANNEL QUEUING MODELS ON FUZZY ENVIRONMENT
IAEME_Publication_Call_for_Paper_September_2022.pdf
MODELING AND ANALYSIS OF SURFACE ROUGHNESS AND WHITE LATER THICKNESS IN WIRE-...
A STUDY ON THE REASONS FOR TRANSGENDER TO BECOME ENTREPRENEURS
BROAD UNEXPOSED SKILLS OF TRANSGENDER ENTREPRENEURS
DETERMINANTS AFFECTING THE USER'S INTENTION TO USE MOBILE BANKING APPLICATIONS
ANALYSE THE USER PREDILECTION ON GPAY AND PHONEPE FOR DIGITAL TRANSACTIONS
VOICE BASED ATM FOR VISUALLY IMPAIRED USING ARDUINO
IMPACT OF EMOTIONAL INTELLIGENCE ON HUMAN RESOURCE MANAGEMENT PRACTICES AMONG...
VISUALISING AGING PARENTS & THEIR CLOSE CARERS LIFE JOURNEY IN AGING ECONOMY
A STUDY ON THE IMPACT OF ORGANIZATIONAL CULTURE ON THE EFFECTIVENESS OF PERFO...
GANDHI ON NON-VIOLENT POLICE
A STUDY ON TALENT MANAGEMENT AND ITS IMPACT ON EMPLOYEE RETENTION IN SELECTED...
ATTRITION IN THE IT INDUSTRY DURING COVID-19 PANDEMIC: LINKING EMOTIONAL INTE...
INFLUENCE OF TALENT MANAGEMENT PRACTICES ON ORGANIZATIONAL PERFORMANCE A STUD...
A STUDY OF VARIOUS TYPES OF LOANS OF SELECTED PUBLIC AND PRIVATE SECTOR BANKS...
EXPERIMENTAL STUDY OF MECHANICAL AND TRIBOLOGICAL RELATION OF NYLON/BaSO4 POL...
ROLE OF SOCIAL ENTREPRENEURSHIP IN RURAL DEVELOPMENT OF INDIA - PROBLEMS AND ...
OPTIMAL RECONFIGURATION OF POWER DISTRIBUTION RADIAL NETWORK USING HYBRID MET...
APPLICATION OF FRUGAL APPROACH FOR PRODUCTIVITY IMPROVEMENT - A CASE STUDY OF...
A MULTIPLE – CHANNEL QUEUING MODELS ON FUZZY ENVIRONMENT

Recently uploaded (20)

PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Big Data Technologies - Introduction.pptx
PDF
Approach and Philosophy of On baking technology
PPTX
Cloud computing and distributed systems.
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPT
Teaching material agriculture food technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Encapsulation theory and applications.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
A Presentation on Artificial Intelligence
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Big Data Technologies - Introduction.pptx
Approach and Philosophy of On baking technology
Cloud computing and distributed systems.
Mobile App Security Testing_ A Comprehensive Guide.pdf
Teaching material agriculture food technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Unlocking AI with Model Context Protocol (MCP)
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
Spectral efficient network and resource selection model in 5G networks
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
A comparative analysis of optical character recognition models for extracting...
Encapsulation theory and applications.pdf
NewMind AI Weekly Chronicles - August'25-Week II
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Advanced methodologies resolving dimensionality complications for autism neur...

Using k means cluster and fuzzy c means for defect segmentation in fruits

  • 1. Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 INTERNATIONAL JOURNAL OF COMPUTER ENGINEERING & 17 – 19, July 2014, Mysore, Karnataka, India TECHNOLOGY (IJCET) ISSN 0976 – 6367(Print) ISSN 0976 – 6375(Online) Volume 5, Issue 9, September (2014), pp. 11-19 © IAEME: www.iaeme.com/IJCET.asp Journal Impact Factor (2014): 8.5328 (Calculated by GISI) www.jifactor.com 11 IJCET © I A E M E USING K-MEANS CLUSTER AND FUZZY C MEANS FOR DEFECT SEGMENTATION IN FRUITS VaniAshok1, Dr. D.S. Vinod2 1(Computer Science Engineering, Sri Jayachamarajendra College of Engineering, Mysore, Karnataka, India) 2(Information Science Engineering, Sri Jayachamarajendra College of Engineering., Mysore, Karnataka, India) ABSTRACT Quality and safety are the key factors in modern food industries. The quality of fruits and vegetables is a common combination of characteristics, attributes and properties that have significance and make for acceptability. One of the most popular applications of computer vision is to inspect qualities of food products based on form, color and presence of defects. Appearance factors such as size or dimension, shape, surface texture, surface color, and external or surface defects define external quality and directly influence consumers in purchasing a product, and they can be evaluated by means of computer vision techniques. The proposed paper presents defect segmentation of fruits based on surface color features with unsupervised K-Means clustering and Fuzzy C-Means algorithms. As the first step, the digital color images of defective apples are pre-processed using Gaussian low-pass filter (GLPF) smoothing operator to remove noise. The images are then segmented with the purpose of separating the defects from the edible regions using proposed clustering algorithms. A comparison analysis is also performed among the two methods. Keywords: Image segmentation, Clustering, Histogram, Filtering, K-means, Fuzzy C-Means (FCM) 1. INTRODUCTION Quality and safety are the key factors in modern food industries. Increasing consciousness of quality, particularly in the food and health sector, strongly demands research activities regarding the production of defined quality, the preservation of quality during marketing, and thus also the possibilities of evaluating quality parameters and of integrating this into production processes. The pallet of possible damage to fruit and vegetables is extremely extensive and is often a criterion of
  • 2. Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 17 – 19, July 2014, Mysore, Karnataka, India quality determination methods, for example, malformations, rust fungi, formation of cork, splits, bitter pit, insect damage, rots, scalds, temperature damage, and glassiness or other physiological diseases of the storage phase. In addition, there are various risks for injuries during harvest and transport [1]. With the increasing quality awareness among consumers, the expectation for improved quality in agricultural and food products has increased the need for enhanced quality monitoring. There is a need to develop various image analysis techniques to meet the demand of the growing population. Moreover there is growing demand for automation in food industries due to the fact that the traditional labor intensive manual inspection processes are inefficient, inaccurate and ineffective. The application of computer vision in agriculture has increased considerably in recent years due to the fact that it provides substantial amounts of information about the nature and attributes of the objects present in a scene. 12 The use of this technology has spread rapidly in inspecting agri-food commodities, including meat quality assessment, automated poultry carcass inspection, quality evaluation of fish, visualization of sugar distribution of melons, measuring ripening of tomatoes, defect detection of pickling cucumber, and classification of wheat kernels [2]. The computer vision is particularly used more in automatic inspection of fruits and vegetables, since it is more reliable and objective than human inspection [3]. Quality assessment of fruits and vegetables is done based on the analysis of external features like color, size, shape, texture and presence of damage. As consumers are mostly influenced to choose or reject a particular fruit by its color, it is the most important attribute for assessing the quality of fruits. The most widely used color spaces in computers and digital images are RGB, HSI and L*a*b*. In RGB the color of a pixel in image is expressed as three coordinates of primary colors red, green and blue in a color space. HIS is the color space which is closer to the human perception of color, like the hue, saturation and intensity. However, RGB and HSI are non-uniform color spaces and hence uniform color space like L*a*b* is used to implement the proposed algorithms. The defect segmentation of fruits based on surface color feature can be considered as an instance of image segmentation where we are segmenting only the defective portion of the fruit. Image segmentation is the process of partitioning the image into several constituent components. It partitions the digital image into disjoint (non-overlapping) regions. Segmentation is an essential step in computer vision and automatic pattern recognition processes based on image analysis of foods as subsequent extracted data are highly dependent on the accuracy of this operation. Food image segmentation is still an unsolved problem because of its complex and under constrained attributes [4]. Image segmentation methods are generally based on one of two fundamental properties of the intensity values of image pixels: similarity, where the image is partitioned into regions that are similar according to a set of predefined criteria, and discontinuity, where the image is partitioned based on sharp changes in intensity values. Based on the discontinuity or similarity criteria, many segmentation methods have been introduced which can be broadly classified into six categories: (1) Histogram based method, (2) Edge Detection, (3) Neural Network based segmentation methods, (4) Physical Model based approach, (5) Region based methods (Region splitting, Region growing and merging), (6) Clustering (Fuzzy C-means clustering and K-Means clustering) [5]. The unsupervised clustering algorithms are particularly appropriate for the exploration of interrelationship among the data points to make an assessment of the structure where there is little a priori information available about the data [6]. 2. RELATED WORKS Physical appearances of food extremely vary causing difficulties for computer vision systems. Fruits, in particular, have numerous kinds of defects and highly varying skin color. Hence,
  • 3. Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 17 – 19, July 2014, Mysore, Karnataka, India they pose even more problems for computer vision-based quality inspection systems. Paul Martinsen and Peter Schaare [7] have proposed a method for predicting chemical component distribution in kiwifruit using imaging spectroscopy techniques. The author used partial least- squares method for data modeling. J Blasco et al. [8] proposed the segmentation procedure, based on a Bayesian discriminant analysis, to allow fruits to be precisely distinguished from the background. The machine vision system thus developed detected the external defects of the apples with 86% accuracy. The feasibility of NIR spectroscopy in combination with powerful multivariate calibration techniques, such as Partial Least Squares regression (PLS), to measure quality attributes of fruit and vegetables has been demonstrated by B.M. Nicolai et al. [9]. J. Tan [10] suggested filtering, background removal, segmentation of fat from muscles, isolation of the LD muscle and segmentation of marbling from the LD muscle to assess the quality attributes of meat images. K.Vijayarekha [11] discusses the multivariate image analysis technique applied to the defect segmentation of apple fruit in multispectral range. 13 An intensive study on apple quality inspection is carried out by Unay [12]. The apple images were captured through color/monochrome camera in diffusely illuminated tunnel with two different light sources (fluorescent tubes and incandescent spots). To improve the image quality a noise removal operation was performed before applying the image segmentation operation to detect the defect type. The image intensity and texture based shape features were extracted from each segmented portion of the image. The performance of several classification methods (Linear Discriminant Classifier (LDC), k-Nearest Neighbors (k-NN), Fuzzy k-NN, Support Vector Machine (SVM), Decision Tree and Multi-layer Perceptrons (MLP) were studied for defect segmentation and detection. They identified bruise, flesh damage, frost damage, hail, hail with perforation, limb rub, scar tissue, rots, russet and scald defects. Gabriel Leiva et al. [13] devised methodology to classify blueberries with fungal decay, shrivelling and mechanical damage using statistical pattern recognition techniques: extracting the most possible features, selecting the best ones, training the best classification algorithm. The feature extraction strategies used were Sequential Forward Selection (SFS), with objective functions: Fisher discriminant, K-Nearest Neighbour (KNN), Linear and Quadratic Discriminant Analysis (LDA and QDA); and other feature extractors without objective function used were: Forward orthogonal search algorithm by maximizing the overall dependency, Least Squares Ellipse Fitting (LSEF) and Rank key features by class separability criteria. With the selected features, decision lines, planes or hyper planes classifiers were implemented using LDA, QDA, minimal distance, Mahalanobis Distance (MD), KNN (with 4 to 30 nearest neighbours), Support Vector Machine (SVM) and different Neural Networks techniques (NN). Apart from fruit quality assessment researchers are trying to investigate fruit characteristics that can be used for fruit grading process. V. Leemans et al. [14] have achieved fruit grading is six steps: image acquisition; ground colour classification; defect segmentation; calyx and stem recognition; defects characterization and finally the fruit classification into quality classes. They realized color grading using a simple neural network with no hidden layer, using the three luminances (red, green and blue) of the considered pixel as input. The calyx and stem ends, which appear on an image as defects, were detected using a correlation pattern recognition technique and defect segmentation was done using Gaussian model of the fruit color, measuring the Mahalanobis distance separating the mean color of the fruit and of each pixel. Yousef Al Ohali [15] has designed computer mediated date fruit quality assessment and sorting system. He has used the color intensity distribution in the image as an estimate of flabbiness of date fruit. Back Propagation Neural Network (BPNN) is used to classify the dates into three groups, Grade-1: fruits having good shape, high flabbiness, Grade 2: fruits with distorted shape, low flabbiness and Grade 3: fruits having defects.
  • 4. Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 17 – 19, July 2014, Mysore, Karnataka, India i x −μ (2) μ : (3) = = (5) 14 3. CLUSTERING ALGORITHMS In this section, the basic sets of definitions are presented to provide the preliminaries of the clustering methods. First we define the K-means clustering method. The second part discusses about Fuzzy C- means (FCM) clustering. 3.1 K-Means Clustering Algorithms K-means method is an unsupervised clustering method that classifies the input data objects into multiple classes on the basis of their inherent distance from each other [5]. Clustering algorithm assumes that a vector space is formed from the data features and tries to identify natural clustering in them. The objects are clustered around the centroids i = 1 i μ …..k which are computed by minimizing the following objective −μ = Î V = 2 j (x ) 1 x S j i i k i (1) Where k is the number of clusters i.e. Si, i = 1, 2…., k and i μ is the mean point or centroid of all the points j i x ÎS . The algorithm of an iterative version K-means clustering is as follows: Step 1. Compute the distribution of the intensity values. Step 2. Using k random intensities initialize the centroids. Step 3. Cluster the image points based on the distance of their intensity values from the centroid intensity values. (i ) c := arg minj 2 ( ) j Step 4. Compute new centroid for each cluster. 1{ } = = c j x = = = m i i m i i i i c j 1 ( ) 1 ( ) ( ) 1{ } where k is the number of clusters, i iterates over all the intensity values, j iterates over all the centroids. Step 5. Repeat Step 3 and Step 4 until the labels of the cluster do not change any more. 3.2 Fuzzy C-Means Clustering Algorithms Fuzzy C-means (FCM) is a clustering technique which differs from hard K-means that employs hard partitioning [16]. The FCM employs fuzzy partitioning such that a data point can belong to all groups with different membership grades between 0 and 1. FCM is an iterative algorithm. The aim of FCM is to find cluster centers (centroids) that minimize a dissimilarity function. To accommodate the introduction of fuzzy partitioning, the membership matrix (U) is randomly initialized according to, = = = u j n c i ij 1, 1,...., 1 (4) The dissimilarity function used in FCM is given by, 2 c c i J U c c c J u d 1 2 ( , , ,...., ) ij 1 i 1 1 n j m ij c i = = = Uij is between 0 and 1; Cij is the centroid of cluster i;
  • 5. Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 17 – 19, July 2014, Mysore, Karnataka, India dij is the Euclidean distance between ith centroid(ci) and jth data point; mÎ [1,] is a weighting exponent or fuzziness parameter 1 (6) S S U U u u (8) 15 To reach a minimum of dissimilarity function there are two conditions which are given in Equation (6) and Equation (7). u x = = = n j m ij j n m j ij i u c 1 = − = c k m ij kj ij d d u 1 2 /( 1) 1 (7) Precisely speaking, initially the uij and the centers of the clusters are assigned randomly and the uij is updated in each iteration. The iterative process stops when ( ) ( 1) ( ) ( 1) p e max − − − = − s ij S ij The FCM that iteratively updates the cluster centers and the membership grades for each data point is as follows: Step 1. Randomly initialize the membership matrix (U) that has constraints as given in Equation (4) Step 2. Calculate centroids (ci) by using Equation (6). Step 3. Compute dissimilarity between centroids and data points using equation (5). Stop if its improvement over previous iteration is below a threshold. Step 4. Compute a new U using Equation (7). If condition given in Equation (8) is False, go to Step 2. FCM iteratively moves the cluster centers to the right location within a data set. 4. DEFECT SEGMENTATION In this section, the implementation of K-means and Fuzzy C-means clustering algorithms for defect segmentation in apple fruits is presented. 4.1 Using K-Means Clustering Step 1. Read the input image of defective fruit. Step 2. In order to remove the image noise and reduce detail levels the Gaussian low-pass filter (GLPF) smoothing operator is applied. Step 3. Transform the image from RGB to L*a*b* color space as all of the color information is present in the a* and b* layers only. Step 4. Calculate the histograms of the image to decide the number of clusters. Step 5. Classify colors using K-means clustering in a*b* space, with Euclidean distance to measure the distance between two colors.
  • 6. Proceedings of the 2nd International Conference on Step 6. Label each pixel in the image from the results of K labeled with its cluster index. Step 7. Generate different images for each cluster. 4.2 Using Fuzzy C-Means ICCTEM -2014 Step 1. Read the input image of defective fruit. Step 2. In order to remove the image noise and reduce detail levels the Gaussian low (GLPF) smoothing operator is applied. Step 3. Calculate the histograms of the image to decide the number of clusters. Step 4. Classify pixel intensities using FCM algorithm (initial value of number of clusters as determined in Step 3. Step 5. Generate image by allocating different intensity levels for each subclass of the image. 5. EXPERIMENTAL RESULTS To determine the performance of the clustering approaches, we have considered apples as a case study. The data set consists of various images of apples with defects such as apple scab, rot and blotch for the purpose of defect segmentation. Fig. 1 apples from the data set. (a) Fig. 1: Fig. 2, Fig. 3 and Fig. 4 show defect segmentation result means clustering. (a) (b) Fig. 2: K-Means (a) Filtered Image (b) First Cluster Current Trends in Engineering and Management 17 – 19, July 2014, Mysore, Karnataka, India 16 K-means. Every pixel of the image will be ead m = 2 and represents some of the images of defective (b) (c) Sample Images from the Dataset results of sample apple fruits using K (c) (d) eans Defect Segmentation of an Apple with Scab (c) Second Cluster (d) Third Cluster (e) Histogram low-pass filter e = 0.01) with K- (e)
  • 7. Proceedings of the 2nd International Conference on (a) (b) Fig. 3: K-Means D 600 500 400 300 200 100 0 0 50 Defect Segmentation of an Apple with Blotch (a) Filtered Image (b) First Cluster (a) (b) Fig. 4: K-Means Defect Segmentation 100 150 200 250 egmentation of a Rotten Apple (a) Filtered Image (b) First Cluster (c) Second C Current Trends in Engineering and Management 17 – 19, July 2014, Mysore, Karnataka, India (c) (d) (c) Second Cluster (d) Third Cluster (e) Histogram (c) (d) Cluster (d) Third cluster (e) Histogram We have segmented the input image into three clusters depending on the data provided by the histogram shown in Fig. 2(e), Fig. 3(e) and Fig. 4(e). Fig. 2(a), Fig. 3(a) and Fig. 4(a) show the preprocessed image filtered by Gaussian low different clusters second cluster correctly segments the defective portion of the image whereas the first cluster demonstrates the non-defective defect part of the fruit. Fig. 5, Fig. 6 and Fig. 7 illustrate the resultant images ob (a) low-pass filter smoothing operator. Among the images in Fig. 5: Fuzzy C-Means Defect Segmentation (a) Fig. 6: Fuzzy C-Means Defect Segmentation (a) Filtered Image (b) FCM Processed Image 17 obtained from FCM. (b) of an Apple with Scab (a) Filtered Image (b) FCM Processed Image (b) of an Apple with Blotch ICCTEM -2014 (e) (e)
  • 8. Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 17 – 19, July 2014, Mysore, Karnataka, India 18 (a) (b) Fig. 7: Fuzzy C-Means Defect Segmentation of a Rotten Apple (a) Filtered Image (b) FCM Processed Image The filtered images are shown in Fig. 5(a), Fig. 6(a) and Fig. 7(a). The FCM segmented images with three clusters are shown in Fig. 5(b), Fig. 6(b) and Fig. 7(b). The amount of defect in a given sample using K-Means and FCM clustering is tabulated in Table 1. FCM, being unsupervised fuzzy clustering algorithm, is motivated by the need to find interesting patterns or groupings in a given set of data. The cluster allocation in FCM is based on the high membership value and less on distance. Table 1: Amount of Defect in Selected Fruit Samples SI. No. Data Sample K-Means FCM 1 Figure 1(a) 60% 52% 2 Figure 1(b) 44% 40% 3 Figure 1(c) 10% 9% 6. CONCLUSION The automated inspection of agricultural products, fruits in particular, is an important process as it reduces human interaction with the inspected goods, classify generally faster than humans and tend to be more consistent in classification. The segmentation of defects in fruits is proposed and evaluated in this paper. The proposed approach used K-Means clustering and Fuzzy C-Means clustering to segment defects in apple images. Experimental results suggest that the algorithms are able to segment the defects more accurately. The major drawback of K-Means is that, there may be a skewed clustering result if the cluster number estimate is incorrect. It is overcome to certain extent in the proposed method by determining the number of clusters using the histogram of the image. The image is also pre-processed to remove noise. 7. REFERENCES 1. Peter Butz, Claudia Hofmann, Bernhard Tauscher, Recent Developments in Noninvasive Techniques for Fresh Fruit and Vegetable Internal Quality Analysis, Journal Of Food Science, Vol. 70, Nr. 9, 2005. 2. Sun, D.-W, Hyperspectral imaging for food quality:A non-destructive tool for food quality and safety evaluation and inspectio”, London: Academic, 2010. 3. Sergio Cubero, Nuria Aleixos, Enrique Moltó, Juan Gómez-Sanchis, Jose Blasco, Advances in Machine Vision Applications for Automatic Inspection and Quality Evaluation of Fruits and Vegetables, Food Bioprocess Technol 4: 2011, 487–504. 4. Domingo Mery, Franco Pedreschi, Segmentation of colour food images using a robust algorithm, Journal of Food Engineering 66, 2005, 353–360.
  • 9. Proceedings of the 2nd International Conference on Current Trends in Engineering and Management ICCTEM -2014 17 – 19, July 2014, Mysore, Karnataka, India 19 5. Shiv Ram Dubey, Pushkar Dixit, Nishant Singh, Jay Prakash Gupta, Infected Fruit Part Detection using K-Means Clustering Segmentation Technique, International Journal of Artificial Intelligence and Interactive Multimedia, 2013, Vol. 2, No.2. 6. Jaskirat Kaur, Sunil Agarwal, Venu Vig, Performance analysis of clustering based image segmentation and optimization methods, CSIT-CSCP, 2012, 245-254. 7. Paul Martinsen, Peter Schaare, Measuring soluble solids distribution in kiwifruit using near-infrared imaging spectroscopy, Postharvest Biology and Technology 14014, 1998, 271–281. 8. J. Blasco, N. Aleixos, E. Molto, Machine Vision System for Automatic Quality Grading of Fruit, Biosystems Engineering, 2003, 85 (4), 415–423. 9. Bart M. Nicolai, Katrien Beullens, Els Bobelyn, Ann Peirs, Wouter Saeys, Karen I. Theron, Jeroen Lammertyna, Nondestructive measurement of fruit and vegetable quality by means of NIR spectroscopy: A review, Postharvest Biology and Technology, 46, 2007, 99–118. 10. J. Tan, “Meat quality evaluation by computer vision”, Journal of Food Engineering 61, 2004, 27–35. 11. K. Vijayarekha, Multivariate image analysis for defect identificationof apple fruit images, IEEE Transactions, 2008. 12. Unay, Dervim, Multispectral Image Processing and Pattern Recognition Techniques for Quality Inspection of Apple Fruit, Ph.D. Thesis, 2006, Facult´e Polytechnique de Mons, Belgium. 13. Gabriel Leivaa, Germán Mondragónb, Domingo Meryb, José Miguel Aguilera, The automatic sorting using image processing improves postharvest blueberriesstorage quality, 2011, ICEF. 14. V. Leemans, H. Mageinb, M.-F. Destain, On-line Fruit Grading according to their External Quality using Machine Vision, Biosystems Engineering, 2002, 83 (4), 397–404. 15. Yousef Al Ohali, Computer vision based date fruit grading system: Designand implementation, Journal of King Saud University – Computer and Information Sciences, 2011, 23, 29–36. 16. Ebrahim Aghajari, Gharpure Damayanti, Incorporating FCM and Back Propagation Neural Network for Image Segmentation, International Journal of Computer communication Technology, 2011, Volume-2, Issue-VIII.