World consumption of potato as one of the most important food crop exceeds
300 million tones (Sokoto and Ibrahi, 2007). Therefore,
computer vision technology (Furferi, 2011) which can
detect some external characteristics of potato has some advantages such as objectivity,
low cost and high precision.
Generally, a computer vision algorithm for a defect detection system includes
two main stages; in the first stage, a proper segmentation algorithm should
be applied on the input image to separate purpose objects from background and
the second stage consists of a proper defect detection algorithm which is used
on the purpose segmented objects. The quality of the segmentation algorithm
plays an important role in improving the output of defect detection stage. Regarding
color based potato detection, the benefit of using color over grayscale is due
to the extra dimensions of color, that is two objects of similar gray tones
might be very different in a color space (Szeliski, 2010);
also, the experiment proposes that potato skin has a characteristic color which
is easily recognized by humans.
There are several examples of using computer vision in potato industry (Rios-Cabrera
et al., 2008; Marique et al., 2006;
Chenglong et al., 2011; Zheng,
2009). Quality inspection by computer vision shows potentially excellent
performance toward mankind based. In traditional reliable quality method, human
operators are used that is usually boring and time consuming and result in a
lot of mistakes in classification (Narendra and Hareesh,
2010). Zhou et al. (1998) used an HSV color
space to segment the green zones which have about 50 images per second classification
speed; an oval shape is then used to characterize potato form and threshold
it to segment green and unripe parts. Noordam et al.
(2000) focused on high speed potato grading and quality inspection and evaluating
the size, shape and external defects. Noordam et al.
(2002) made a suitable system by applying the algorithm on the RGB color
space for image segmentation and detection using a new clustering method called
CSI-FCM; this system had a good performance for multivariate images. Pedreschi
et al. (2006) used a Lab color space for acquiring the images in
a digital format in potato chips. Color values in Lab units were recorded at
different sampling times during frying at the four oil temperatures using the
total color change parameter; in such condition chips fried at higher temperatures
get darker in all 3 dimensions of color spaces. Jin et
al. (2009) used an HSI color space for simulate the human sight; afterwards,
they used an AI (Artificial Intelligence) method for segment potato skin-like
parts. In such time, Hao and Ma (2009) used Blue (B)
of a RGB color space to a feasible and practical segment; this system was simple
and real-time but it couldnt response for other databases by different
intensities. Ebrahimi et al. (2011) used a custom
threshold using R and B colors in RGB image for segment of potatoes; they found
a formula for detect potato skins as 1.02R-G. This system is then filtered by
morphological operations for noise elimination.
Nowadays, Artificial Neural Networks (ANN) have demonstrated a pleasant potency
for modeling complicated systems (Gholizadeh and Darand,
2009). Classification category is an important step of potato segmentation
which needs a proper insulator between potato and environment. The most widely
used neural network model is the Multi layer Percepton (MLP), in which the connection
weight training is normally completed by a back propagation learning algorithm
(Asadollahi-Baboli, 2011; Moallem
and Monadjemi, 2010). As the nomination of network structure and parameters
are most significant, some evolutionary algorithms such as Genetic Algorithm
(GA) (Qu et al., 2008) and Particle Swarm Optimization
(PSO) (Zhang et al., 2000) have shown significant
role in this regard.
There are some inevitable drawbacks of the presented approaches which needs high performance algorithms. In this paper we focused on weight optimization of MLP by an evolutionary algorithm for potato image segmentation; for this reason, we employ a new evolutionary algorithm called Invasive Weed Optimization (IWO). The simulation results demonstrate the effectiveness and potential of the proposed neural network (MLPIWO) for potato segmentation compared with Back Propagation (BP) neural network using the same observed data. In order to reduce random variation of the proposed algorithm itself, each experiment has been run 15 times and the mean values are presented. The method is then compared with traditional BP.
COLOR SPACE SELECTION
A color space is an abstract mathematical model representation of a set of
colors. All of the color spaces like YcbCr (Wang
and Li, 2011), HSI (Al-Bashish et al., 2011)
and Lab (Gongbo et al., 2012) can be derived
from the RGB information supplied by devices such as camera and scanners. In
order to select a proper color space in segmentation step of potato color image,
we define the random vector X for potato color pixels distribution as:
In fact, each dimensions of X which has lower scattering from corresponding mean value shows a lower variation which is better for segmentation of potato color images. Therefore, we use the standard deviation of random vector X for selecting the best dimensions of X.
To find the standard deviation of each component of random vector X, the mean value and standard deviation of each color dimension xi (i = 1,2,
10) is computed as:
where, n is the number of potato pixel samples and xij is the value of jth sample of the ith color dimension. Table 1 shows the standard deviation of each dimensions of random vector X, computed over 10000 sample potato pixels. It can be seen that Cr component of YCbCr color-space has the least scattering for sample potato pixels.
POTATOES SUPERVISED CLASSIFICATION FOR SEGMENTATION
The main purpose of the supervised classification in potato segmentation is to categorize all pixels in a potato image into one of two classes, potato and non-potato. Potato color is one of the considered cases which can become a classification issue. Again, the purpose of potato color pixel classification is to decide whether a color pixel is a potato color or not. Good potato color pixel classification should provide coverage of all various potato types. This type of problem is well-suited to artificial neural networks which have been proven as an efficient tool for pattern classification aims where decision rules are hidden in highly complex data and can be learnt only from examples. The image is then classified by trying the performance for each pixel and making a decision about which of the signatures it resembles most; Fig. 1 shows the steps of classification.
ARTIFICIAL NEURAL NETWORK
Artificial Neural Networks (ANNs) are networks of artificial neurons and hence
comprise crude approximations to parts of real brains. They may be physical
devices, or simulated on conventional computers.
||Standard deviation of random vector X=[R,G,B,Y,Cb,Cr,H,S,V,I]
computed for about 10000 sample potato pixels. One of the sample images
for computing the standard deviation is shown in the left side
|| Steps in supervised classification
From a practical point of view, an ANN is just a parallel computational system
including many simple processing elements connected together in a specific way
in order to perform a particular task. ANNs are extremely powerful computational
devices (Turing equivalent, universal computers) and can learn and generalize
from training data; since there is no need for complicated feats of programming.
Mathematically, a neuron's network function f(x) is defined as a composition of other functions gi(x) which can additional be defined as a composition of other functions. This can be conveniently represented as a network structure, with arrows depicting the dependencies between variables. A widely used type of composition is the nonlinear weighted sum, where:
where, K is some predefined function, such as the hyperbolic tangent. It will be convenient for the following to refer to a collection of functions gi as simply a vector g = (g1
gn). In such state, Back Propagation (BP) is a common method which is used for feed forward networks or MLP. It computes the error on each of the training pairs and adjusts the weights to fit the desired output. This is done in several epochs until the total error on the training set become small enough or when the error stops to decline. Indeed, it employs supervised learning in which the network is trained using data for which inputs as well as target outputs are noticed. Once trained, the network weights are vapid and can be used to calculate output values for new given samples.
BP is a gradient descent algorithm on the error space which most likely gets trapped into a local minimum, succeeded it entirely dependent on initial (weight) settings. This shortcoming can be removed by an exploration searching ability of the evolutionary algorithms such as Invasive Weed Optimization.
INVASIVE WEED OPTIMIZATION
The Invasive Weed Optimization (IWO) algorithm was improved by Mehrabian
and Lucas (2006). IWO algorithm is a new search method which makes use of
mechanisms inspired by the natural behavior of weeds in colonizing and finding
a suitable place for growth and reproduction. IWO algorithm is a numerical stochastic
search algorithm imitating natural behavior of weeds in colonizing and finding
suitable place for growth and reproduction. This method is motivated by a common
phenomenon in agriculture that is colonization of invasive weeds. Weeds have
shown very robust and adaptive nature which turns them to undesirable plants
in agriculture. Recent experiences in applying the IWO algorithm in a number
of different application domains have shown considerable advantages over both
classical algorithms and other bio-inspired techniques (Mehrabian
and Yousefi-Koma, 2007; Zhang et al., 2008).
The algorithm for IWO may be summarized as follows:
Initialization: A finite number of weeds are initialized at the same element position of the conventional array which has a similar spacing of λ/2 between elements in neighbor.
Reproduction: Each member of the population is allowed to produce seeds conditional upon its own, as well as the colonys lowest and highest cost, such that, the number of seeds produced by a weed grows linearly from lowest possible seed for a weed with worst cost.
Spatial distribution: The produced seeds are being randomly distributed over the d dimensional search space by normally distributed random numbers by a zero mean and variable variance. This step ensures that the genesis seeds will be generated around the parent weed, leading to a local search around each plant. However, the Standard Deviation (SD) of the random function is made to reduce over the iterations.
If sdMax and sdMin be the maximum and minimum standard deviation and if Pow be a real number, then the standard deviation for a particular iteration may be given as in Eq. 4:
This step guarantee that the probability of dropping a seed in a distant area reduces nonlinearly with iterations which results in grouping fitter plants and elimination of unsuitable plants. Since, this is a selection mechanism of IWO.
Competitive exclusion: If a plant leaves no offspring then it would
go vanished, otherwise they would take over the world. Thus, there is a requirement
of some kind of competition between plants for restricting maximum number of
plants in a colony. At the first, the plants in a colony will reproduce fast
and all the produced plants will be comprised in the colony, until the number
of plants in the colony reaches a maximum value popmax. In any event,
it is hoped that by this time the fitter plants have reproduced more than undesirable
plants. After that, the seeds and their parents ranked together and those with
better fitness survive and become reproductive (Mehrabian
and Lucas, 2006).
The flowchart of IWO is shown in Fig. 2 and the set of parameters for IWO algorithm is provided in Table 2.
MLP WEIGHTS DEVELOPMENT USING IWO (MLPIWO)
Selecting the optimal value for weights can be formulated as an exploration search problem wherein the architecture of the Neural network is reconstructed and fixed during the evolution.
|| Flowchart of imperialist competitive algorithm
|| IWO parameters used for the proposed system.
The value of the weights may be described as being train with certain length and the whole network is encoded by interpolation of all weights values of the network in the chromosome. A heuristic concerning the order of the interpolation is to put connection weights to the same node together.
Evolutionary search of weights values can be formulated as follows:
||Generate an initial population of N weight chromosomes. Evaluate
the fitness of each EANN depending on the problem
||Depending on the fitness and using suitable selection methods reproduce
a number of children for each individual in the current generation
||Apply genetic operators to each child individual generated above and obtain
the next generation
||Check whether the network has achieved the required error rate or the
specified number of generations has been reached then goes to step 2
In order to express the MLP, consider a two layered network which is formulated
as formula 5:
where, H denotes the number of neurons in the hidden layer, w denotes the weights of the network, b denotes the bias value and σ denotes the activation function of each neuron which in this case is considered as sigmoid.
The network is trained by performing optimization the value of the weights
for each node interconnection and bias terms; until the values output at the
output layer neurons are as close as possible to the actual outputs. The Mean
Squared Error of the network (MSE) can be defined as (Abd
where, m is the number of output nodes, g is the number of training samples, Yj(k) is the desired output and Tj(k) is the real output.
For evaluate the performance of the proposed potato segmentation algorithm,
some experiments are applied with various databases from USDA (United State
Department of Agriculture) including 60 images (USDA, 2011),
CFIA (Canadian Food Inspection Agency) including 40 images (CFIA,
2011) and a custom database of Ardabils (Iranian northern-west champ)
which include about 400 images with different brightness and contrast.
IMPLEMENTATION AND RESULTS
Two zone classification (as potato like or non-potato like individually) is used in this study, we discuss pixel-based potato detection classifiers which classify each pixel, independently from its neighbors.
The structure of the MLP classifiers is 1xnx1, where the one dimensional input
is Cr component of input pixel, the binary output shows the input
is either potato or non-potato and n is the number of neurons in hidden layer:
since the transfer function used is a sigmoid function (in this work MLP); it
will be producing the output between 0 and 255 (uint 8 in MATLAB). Thus, the
output of the neural network needs to be modified to 0 or 1. In this work, a
single threshold value of 128 is used in determining the potato and non-potato
classes; if the MLP network output is higher than the threshold value, then
the output is 1. Otherwise, the output is 0. After all, morphological processing
with a 5x5 square structuring element consists of filling holes and opening
followed by closing is applied to the result images (Szeliski,
2010). The effect of morphological processing for different datasets is
shown in Fig. 3.
To evaluate the performance of the proposed training algorithm into learning
based on the gradient descends (traditional backpropagation), three performance
metrics are defined. The first metric is the Correct Detection Rate (CDR) and
is given in Eq. 7. The False Acceptance Rate (FAR) is the
percentage of identification moments in which false acceptance occurs.
|| Output image after applying the proposed segmentation algorithm
in different datasets, (a) Iutput image, (b) MLPIWO classification, (c)
After morphological operations and (d) Output image
|| Test set: (a) Not potato-like sets and (b) Potato-like sets
The False Rejection Rate (FRR) is the percentage of identification moments
in which false rejection occurs. The FAR and FRR are also expressed in Eq.
Figure 4 shows a part of the dataset which is used to compare the methods. Table 3 shows CDR, FAR and FRR performance metrics for MLP-based potato segmentation system trained by the proposed IWO (MLPIWO) and traditional BP training algorithms.
|| MLP-based potato segmentation performance for the proposed
IWO (MLPIWO) and traditional BP training algorithms
|| Samples output of the proposed segmentation algorithm
Typically, a popularization of the least mean square algorithm (that develops network weights to minimize the mean squared error between the target and current outputs of the network) is applied to the back propagation algorithm. From the experimental results, it can be seen that the MLPIWO performed better and gives higher correct detection rate (Fig. 5).
In this study, we proposed the image segmentation algorithm for potatoes detection in color image which comprises three steps. The first step selects the suitable color component by analyzing the standard deviation of each color component as the scattering parameter. Afterwards, a hybrid neural network is used to segment potato from background; to train the MLP instead of gradient descend, Invasive Weed Optimization is applied. This algorithm reliably reduce the number of false detection toward the gradient descend algorithm. The potato detection method based on MLPIWO is a promising approach given its satisfactory results. However, it need about twice training time, regarding the gradient descend algorithm.