A novel artificial neural networks assisted segmentation algorithm for discriminating almond nut and shell from background and shadowby Nima Teimouri, Mahmoud Omid, Kaveh Mollazade, Ali Rajabipour

Computers and Electronics in Agriculture



The American Academy of Fine Arts in Rome

Adapted for Brush and Pencil

Herbicide Performance and Soil Surface Conditions


Workers' Attitudes to Technical Change

Alan C. Filley, A. Touraine and Associates


dde and


Article history:

Received 30 October 2013

Received in revised form 5 April 2014

Accepted 13 April 2014



Artificial neural networks

Segmentation is one of the main steps in image processing, as it influences the accuracy of other proalgorithm may be implemented at three different levels: low level, medium level, and high level. Low level processing includes preprocessing for improving the quality of the input images, like noise reduction and image enhancement. Medium level processing includes segmentation, description, and feature extraction. In recent years, high level processing techniques employing artificial after segmenting or separat y include gion based ods (Sonka et al., 1999; Sun, 2000). Thresholding is the si method of image segmentation. This method is used changes in environmental conditions such as light is almost constant or uniform. There are four basic methods to choose the threshold for segmenting images in an image processing task. They include histogram clustering, manual selection, objective function, and isodata algorithm (Zheng and Sun, 2008). Fuzzy technique has also been used to choose the threshold (Tobias and Seara, 2002).

The edge based method is used for detecting discontinuity in ⇑ Corresponding author. Tel.: +98 912 3611832; fax: +98 2632808138.

E-mail address: omid@ut.ac.ir (M. Omid).

Computers and Electronics in Agriculture 105 (2014) 34–43

Contents lists availab tr elsof the agricultural products like almond mostly depend on the factors like variety and postharvest operations (grading, sorting, etc.).

Image processing is considered as one of the main parts of machine vision (Krutz et al., 2000). Basically, an image processing sorting of almonds can be done automatically the images. There are three different methods f region of interest (ROI) from the background. The old based methods, edge based methods, and rehttp://dx.doi.org/10.1016/j.compag.2014.04.008 0168-1699/ 2014 Elsevier B.V. All rights reserved.ing the threshmethmplest where1. Introduction

Almond is one of the major exported products of Iran. According to the FAO statistics, Iran produced about 167,000 tones of almonds in 2011. After USA and Spain, Iran was ranked third as the producer of this product (FAO, 2011). The price and the quality neural networks (ANN), support vector machines (SVM), decision trees (DT), etc. are often used for classification purposes after selecting superior features (Mollazade et al., 2012).

Image segmentation is one of the major steps in image processing, which directly influences the performance of other post-segmentation processes. Postharvest operations such as grading andColor features

Image processing


Sensitivity analysiscesses such as feature selection and classification. In this study, an effective method based on a combined image processing and machine learning was presented and evaluated for segmenting almond images with different classes such as normal almond, broken and split almond, shell of almond, wrinkled almond and doubles or twins almond. One of the major difficulties encountered in segmenting almonds was the existence of shadow on the background of the acquired images. Another difficulty was separating almonds with various shapes and colors from input images. To implement an effective algorithm, initially a suitable set of color features was extracted from the images. Then, sensitivity analysis was used to select the best features. Finally, artificial neural networks (ANNs) were adopted to classify the images into three categories, namely, object, shadow and background. The optimum ANN classifier had a 8-5-3 structure, i.e., it was consisted of an input layer with eight input variables, one hidden layer with five neurons and three neurons as output. To evaluate the performance of the proposed method, the results of our optimum ANN model were compared with Otsu, dynamic thresholding and watershed methods. The mean values of sensitivity, specificity and accuracy for object class (detected almonds from images) achieved by using the proposed method were 96.88, 99.21 and 98.82, respectively. It gave a better accuracy than the mentioned methods. In addition, the proposed method was able to separate the almonds from the background and shadows more efficiently. The processing time of the proposed method was 1.35 s which makes it possible for real time applications.  2014 Elsevier B.V. All rights reserved.a r t i c l e i n f o a b s t r a c tA novel artificial neural networks assiste discriminating almond nut and shell from

Nima Teimouri a, Mahmoud Omid a,⇑, Kaveh Mollaza aDepartment of Agricultural Machinery Engineering, Faculty of Agricultural Engineering bDepartment of Biosystems Engineering, Faculty of Agriculture, University of Kurdistan,

Computers and Elec journal homepage: www.segmentation algorithm for background and shadow b, Ali Rajabipour a

Technology, University of Tehran, Karaj, Iran andaj, Iran le at ScienceDirect onics in Agriculture evier .com/locate /compag 2. Materials and methods

The framework for segmenting almond images is presented in

Fig. 1. Almonds were obtained from a local market and then different classes of almonds like normal almond, broken and split, wrinkled, doubles or twins and almond’s shell were identified (UNECE, 2009). After image acquisition, the components of different color spaces were used as input features for classification purposes.

For selecting appropriate features (i.e., useful information to distinguish the pixels of shadow, object and background), sensitivity analyses was performed. Superior features were then used as inputs to artificial neural networks (ANN) classifier for separating the almonds from background and shadow. Finally to validate this technique, our results are compared with other segmentation methods. In the following sub-sections, these processes are described in details.

The algorithms were implemented in Matlab software using a laptop having a core i5 CPU, 2.5 GHz and 4 GB memory. 2.1. Image acquisition