**Payman Moallem**

Department of Electrical Engineering, Faculty of Engineering, University of Isfahan, Iran

Navid Razmjooy

Young Researchers Club, Majlesi Branch, Islamic Azad University, Isfahan, Iran

Department of Electrical Engineering, Faculty of Engineering, University of Isfahan, Iran

Navid Razmjooy

Young Researchers Club, Majlesi Branch, Islamic Azad University, Isfahan, Iran

Accurate recognition of external defects on potato color images is an important point in the realization of automatic computer vision-based potato grading and sorting station. Therefore, pixel-based segmentation of potato color image is an essential step in every inspection system by computer vision. Invasive Weed Optimization (IWO) is a new evolutionary algorithm which recently introduced and has a good performance in some optimization problems. IWO is a derivative-free, meta-heuristic algorithm, mimicking the ecological behavior of colonizing weeds. In this study, firstly a proper color component for potato color image segmentation using a statistical analysis on some training images is selected. Then, combining the IWO and ANN (Artificial Neural Networks) to solve pixel-based potato classification has been proposed. In this proposed algorithm, Multi Layer Perceptron (MLP) network manages the problem’s constraints and IWO algorithm searches for the best network weights based on minimization of the cost function. Experimental results on more than 500 potato images show that this method can improve the performance of the traditional learning of MLP significantly.

PDF Abstract XML References Citation

Payman Moallem and Navid Razmjooy, 2012. A Multi Layer Perceptron Neural Network Trained by Invasive Weed Optimization for Potato Color Image Segmentation. *Trends in Applied Sciences Research, 7: 445-455.*

**URL:** https://scialert.net/abstract/?doi=tasr.2012.445.455

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 couldn’t 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 Yc_{b}C_{r} (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:

(1) |

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 x_{i} (i = 1,2,…10) is computed as:

(2) |

where, n is the number of potato pixel samples and x_{ij} is the value of j^{th} sample of the i^{th} 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 C_{r} component of YC_{b}C_{r} 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.

Table 1: | 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 |

Fig. 1: | 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 g_{i}(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:

(3) |

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 g_{i} as simply a vector g = (g_{1}…g_{n}). 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 colony’s 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 sd_{Max} and sd_{Min} 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:

(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 pop_{max}. 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.

Fig. 2: | Flowchart of imperialist competitive algorithm |

Table 2: | 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:

Step 1: | Generate an initial population of N weight chromosomes. Evaluate the fitness of each EANN depending on the problem |

Step 2: | Depending on the fitness and using suitable selection methods reproduce a number of children for each individual in the current generation |

Step 3: | Apply genetic operators to each child individual generated above and obtain the next generation |

Step 4: | Check whether the network has achieved the required error rate or the specified number of generations has been reached then goes to step 2 |

Step 5: | End |

In order to express the MLP, consider a two layered network which is formulated as formula 5:

(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 El-Salam, 2011):

(6) |

where, m is the number of output nodes, g is the number of training samples, Y_{j}(k) is the desired output and T_{j}(k) is the real output.

**DATASET DESCRIPTION**

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 Ardabil’s (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 C_{r} 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.

Fig. 3(a-d): | 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 |

Fig. 4: | 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. 7, as:

(7) |

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.

Table 3: | MLP-based potato segmentation performance for the proposed IWO (MLPIWO) and traditional BP training algorithms |

Fig. 5: | 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.

- Abd El-Salam, M.E.F., 2011. An efficient estimation procedure for determining ridge regression parameter. Asian J. Math. Stat., 4: 90-97.

CrossRefDirect Link - Al-Bashish, D., M. Braik and S. Bani-Ahmad, 2011. Detection and classification of leaf diseases using K-means-based segmentation and neural-networks-based classification. Inform. Technol. J., 10: 267-275.

CrossRefDirect Link - Asadollahi-Baboli, M., 2011. Effect of weight updates functions in QSAR/QSPR Modeling using artificial neural networks. J. Artif. Intell., 4: 257-268.

CrossRefDirect Link - Zhou, L., V. Chalana and Y. Kim, 1998. PC-based machine vision for real-time computer-aided potato inspection. Int. J. Imaging Syst. Technol., 9: 423-433.

CrossRefDirect Link - Furferi, R., 2011. Colour classification method for recycled melange fabrics. J. Applied Sci., 11: 236-246.

CrossRef - Gholizadeh, M.H. and M. Darand, 2009. Forecasting precipitation with artificial neural networks (case study: Tehran). J. Applied Sci., 9: 1786-1790.

CrossRefDirect Link - Gongbo, C., G. Hongbin, W. Dongsu and S. Jin, 2012. A research on hand position detection by camera array. Inform. Technol. J., 11: 110-117.

CrossRefDirect Link - Jin, J., J. Li, G. Liao, X. Yu, C. Christopher and L. Viray, 2009. Methodology for potatoes defects detection with computer vision. Proceedings of the 2009 International Symposium on Information Processing, August 21-23, 2009, Huangshan, P.R. China, pp: 346-351.

Direct Link - Marique, T., S. Pennincx and A. Kharoubi, 2006. Image segmentation and bruise identification on potatoes using a Kohonen`s self-organizing map. J. Food Sci., 70: e415-e417.

CrossRefDirect Link - Mehrabian, A.R. and A. Yousefi-Koma, 2007. Optimal positioning of piezoelectric actuators on a smart fin using bio-inspired algorithms. Aerosp. Sci. Technol., 11: 174-182.

Direct Link - Mehrabian, A.R. and C. Lucas, 2006. A novel numerical optimization algorithm inspired from weed colonization. Ecol. Inform., 1: 355-366.

Direct Link - Moallem, P. and A. Monadjemi, 2010. An efficient MLP learning algorithm using parallel tangent gradient and improved adaptive learning rates. Connection Sci., 22: 373-392.

CrossRefDirect Link - Narendra, V.G. and K.S. Hareesh, 2010. Prospects of computer vision automated grading and sorting systems in agricultural and food products for quality evaluation. Int. J. Comp. Appl., 1: 1-9.

Direct Link - Noordam, J.C., W.H.A.M. Van Den Broek and L.M.C. Buydens, 2002. Multivariate image segmentation with cluster size insensitive fuzzy C-means. Chemom. Intell. Lab. Syst., 64: 65-78.

Direct Link - Pedreschi, F., J. Leon, D. Mery and P. Moyano, 2006. Development of a computer vision system to measure the color of potato chips. Food Res. Int., 39: 1092-1098.

Direct Link - Qu, X., J. Feng and W. Sun, 2008. Parallel genetic algorithm model based on AHP and neural networks for enterprise comprehensive business. Proceedings of the International Conference on Intelligent Information Hiding and Multimedia Signal Processing, (IIHMSP'08), USA., pp: 897-900.

CrossRefDirect Link - Sokoto, M.B. and Z. Ibrahim, 2007. Analysis of sweet potato consumption in Sokoto metropolis of Sokoto State of Nigeria. J. Boil. Sci., 7: 445-447.

CrossRefDirect Link - Chenglong, W., L. Xiaoyu, W. Wei, L. Jie, T. Hailong and W. Dongdong, 2011. Detection of potato`s size based on centroidal principal axis. Afr. J. Agric. Res., 6: 4140-4148.

Direct Link - Wang, Z. and S. Li, 2011. Face recognition using skin color segmentation and template matching algorithms. Inform. Technol. J., 10: 2308-2314.

CrossRefDirect Link - Zhang, C., H. Shao and Y. Li, 2000. Particle swarm optimization for evolving artificial neural network. Syst. Man Cybern., 4: 2487-2490.

CrossRef