You are on page 1of 6

Agric. sci. dev., Vol(3), No (11), November, 2014. pp.

360-365

TI Journals

Agriculture Science Developments


www.tijournals.com

ISSN:
2306-7527
Copyright 2014. All rights reserved for TI Journals.

Non-Destructive Detection of Unshelled Almonds Quality Based on Their


Kernel Percentage Using Impact-Acoustics and ANN's Techniques
Ali Reshadsedghi *
PhD Student, Department of Agricultural Machinery, Faculty of Agriculture, University of Tabriz, Tabriz, Iran.

Asghar Mahmoudi
Associate Professor, Department of Agricultural Machinery, Faculty of Agriculture, University of Tabriz, Tabriz, Iran.

Vahid Azimirad
Assistant Professor, School of Engineering-Emerging Technologies, University of Tabriz, Tabriz, Iran.

Jafar Hajilou
Associate Professor, Department of Horticultural Science, Faculty of Agriculture, University of Tabriz, Tabriz, Iran.

Hossein Ghaffari
Lecturer, Department of Agricultural Machinery, Faculty of Agriculture, University of Tabriz, Tabriz, Iran.
*Corresponding author: sedghi_al@yahoo.com

Keywords

Abstract

Almond
Kernel quality
Detection
Artificial neural networks
Impact Acoustics

Empty almonds and almonds containing defective kernels negatively affect the kernel to nut ratio and cause
the reduction of crop value. This study was conducted to introduce an effective and low-cost impact acoustics classification system to detect unshelled almonds kernel quality without cracking. Almond nuts
were dropped onto a steel impact plate through a pipe. Features such as amplitude, phase and power spectral
density of almond nuts were extracted from analysis of sound signal captured by a microphone in both time
and frequency domains by means of Fast Fourier Transform. Principal component analysis method was used
to reduce the features as input vector to ANN models. The optimal model of artificial neural networks was
selected after several evaluations based on minimizing of mean square error (MSE), correct classification
rate (CCR) and coefficient of correlation. By determining the best multi-layer back propagation neural
network topologies and using LM training function, it was able to detect the quality of various unshelledalmonds genotypes based on their kernel percentage with over 95% accuracy.

1.

Introduction

The fruit of the almond is a drupe, consisting of an outer hull and a partly hard shell with the seed inside. Shelling almond refers to removing the
shell to extract the seed. Almonds are sold both shelled and unshelled (as of nuts). According to the FAO, Iran with an annual production of about
168,000 MT in 2011 is the third producer of almond in the world after United States of America and Spain, moreover, Iranian almonds have the
highest value ($6086 /ton) in the world, however their portion in world market is only 0.22 percent [3]. The deficiency of marketability may be due to
the lack of a suitable sorting and packing system for almond in Iran. One of the main quality attributes of raw bulk almonds is the ratio of kernel
weight to nut weight. Empty almonds and almonds containing defective kernels negatively affect this ratio. Occasionally, a physiological disorder
such as plant stress from dehydration or lack of nutrients causes an almond nut to develop without a kernel. Also, after harvesting an inappropriate
drying process can cause diminish the kernel ratio. A nut with defective kernel appears like a normal almond from outside. Pneumatic devices such
as aspirator can partly help to separate empty nuts from full kernel ones by using their difference in bulk density and terminal velocity, but these
devices are unable to separate defective and full kernel almonds because their weights are very similar to each other. There remains a need for more
advanced systems to improve the separation of almonds with different kernel quality. Various techniques including optical, mechanical, electrical and
acoustical are found increasingly useful in the food industry, especially for applications in quality inspection, damage detection and sorting.
Researches in this area indicate the feasibility of using such systems to improve product quality while freeing people from the traditional manual
inspection of agricultural materials [8].Recently, acoustical experiments have been increasingly employed in agriculture. A high-throughput, low-cost
acoustical system for sorting pistachio nuts has been developed to separate nuts with closed shells from those with cracked shells [11,1,2]. In this
system, pistachio nuts were dropped onto a steel plate and the sound of the impact was analyzed in real-time. Classification accuracy of this system
was approximately 97%, with a throughput rate of approximately 20 to 40 nuts per second. A similar prototype system based on impact acoustics has
been extended by Onaran et al. (2006) to detect under developed hazelnuts [9]. It was experimentally observed that the algorithms described by
Pearson (2001) and Cetin et al. (2004a, 2004b) did not produce high classification rates in empty-full hazelnut separation. A feature vector
comprising line spectral frequencies and time-domain maxima that describes both the time and frequency nature of the impact sound was extracted
from each sound signal and used to classify each nut by a support-vector machine. The system accuracy was about 97% in classifying hazelnuts with
underdeveloped kernels. Then Onaran et al. (2007) applied a sparse signal representation approach to impact acoustic signals to differentiate between
empty and full hazelnuts [10]. The impact acoustic signals are recorded by dropping the hazelnut shells on a metal plate. The impact signal is then

361

Non-Destructive Detection of Unshelled Almonds Quality Based on Their Kernel Percentage Using Impact-Acoustics and ANNs Techniques
Agriculture Science Developments Vol(3), No (11), November, 2014.

approximated within a given error limit by choosing code-vectors from a special dictionary. This dictionary was generated from sub-dictionaries that
are individually generated for the impact signals corresponding to empty and full hazelnut. The number of code-vectors selected from each subdictionary and the approximation error within initial code-vectors are used as classification features and fed to a Linear Discriminant Analysis
(LDA). The results showed that sparse signal representation strategy can be used as an alternative classification method for underdeveloped hazelnut
separation with higher accuracies. Kalkan et al. (2008) introduced an adaptive time frequency plane feature selection algorithm obtained from impact
acoustic signals to separate damaged/cracked hazelnut kernels from regular ones [6]. The adaptation in time and frequency was achieved by
combining local cosine packets and an undecimated wavelet transform. The algorithm achieved a throughput rate of 45 nuts/s and a classification
accuracy of 96% with the 30 most discriminative features, a higher rate than those provided with prior methods. Sajjadi et al.(2008) could recognize
non-brain and healthy pistachio with accuracy about 93% and 94% respectively by using sound processing and artificial neural networks [13]. The
objective of this study was to design and present a suitable algorithm for classifying full almonds from defective and empty almonds, without
cracking.

2.

Materials and Methods

2.1. Samples Characteristics


In this study three classes of almonds with different shell stiffness and thickness were used in the experiments: "HS103", a genotype of hard shell,
"HS215", a genotype of semisoft and "Monagha", a cultivar of soft almonds (Figure 1). These almond genotypes were collected from an orchard of
Sahand horticultural researches station of East-Azarbaijan province, Iran, in September 2013. All experiments were conducted to classify full kernel,
defective kernel and empty almonds based on their kernel percentage (Figure 1).

HS103

HS215

Monagha

Figure 1. Almond genotypes and their defective and full kernels.

The moisture content of unshelled almond samples measured at the test time was about 5-6 percent (wet base) using UNECE standard DDP-05 [14]. The
average value of some dimensional and physical properties of almond nuts used in this study are shown in Table 1.
Table 1. Average values of some dimensional characteristics and physical properties of almond nuts.
Genotype(class)

HS103 (hard)
HS215 (semisoft)
Monagha (soft)

Major diameter
(mm)
31.55
29.50
27.57

dimensional characteristics
Intermediate
Minor diameter
diameter (mm)
(mm)
21.69
14.55
17.92
13.35
16.12
13.93

Shell thickness
(mm)
2.75
2.26
1.83

nut mass
(gr)
2.88
2.16
1.43

Physical properties
Kernel to shell
Kernel
mass ratio
percentage
0.62
38
0.91
46
1.77
63

Bulk density
(gr.cm-3)
0.65
0.63
0.60

2.2. System description


The experimental setup of impact acoustic system is described in detail in [12].The system was designed to feed almond nuts to an impact surface,
acquire the sound signal upon impact, process the data, and then divert the product into a full kernel, defective kernel or empty almond stream (Figure
2).A PVC tube with 50 cm length and 4 cm diameter on an adjustable height base which was inclined 33 above the horizon was used as the feeding
platform. A stainless steel plate with dimensions of 15015010 mm was used as the impact plate. Almond nuts were dropped onto the impact plate
through the pipe. The impact acoustic signal generated by the system was captured by a microphone and processed by a PC. The impact plate is fixed to
the ground at a 14 angle. Impact plate and feeder tube inclined angles were determined by trial and error so that each nut would impact one time to the
plate. The mass of a single almond nut is negligibly compared to the mass of the impact plate. Hence, the possibility of vibrations from the plate
interfering with acoustic emissions from nuts was minimized. The microphone (VM-034CY model) was sensitive to frequencies up to 100 kHz and to
eliminate the environmental noise effects, it was installed inside an isolated chamber which was filled with glass wool. Microphone output signal was
sent to a PC (Intel Core(TM) i7-2670QM CPU @ 2.20 GHz, Windows 7 operating system) based data-acquisition where it was digitized at a sampling
frequency of 44.1 kHz, with 16 bit resolution. The emitted sound signals were acquired by the microphone, digitized by the sound card and saved by

Ali Reshadsedghi *, Asghar Mahmoudi, Vahid Azimirad, Jafar Hajilou, Hossein Ghaffari

362

Agriculture Science Developments Vol(3), No (11), November, 2014.

using Matlab (version 2012a) data acquisition toolbox. When almond nuts hit the impact plate, the amplitude of the microphone output signal ranged
from 0 to 1.0 V. Data acquisition began when the microphone output was higher than 0.1 V. This threshold level was sufficient to trigger acquisition for
virtually all nuts, whilst preventing false triggers from the ambient sound. Since the maximum frequency of the sound card was 44.1 kHz, upon receiving
a trigger signal, the computer acquired 1500 data points during 34 ms from every sample in the time-domain which was sufficient to extract signal
features. Matlab software was used for data collection and management.

Tube
PC
Almond

Impact plate
Feeding platform
Microphone
Acoustic chamber
Figure 2. The schematic of experimental impact acoustic system.

It was initially needed to detect the almond samples kernel quality and then the related signals of each group of almonds used to train the artificial neural
network (ANN) system. Traditional methods such as immerging nuts into a pool of salty water or using air streams to separate full nuts from defective
kernel and empty ones, have high classification error rates. According to Kalantari et al.(2013) there is a high accurate and reliable border between
volume and weight of non-brain and healthy walnuts [5]. Therefore, it seemed that the nuts of each class (hard and soft) with more bulk density, have
more kernel mass. So it was decided to separate samples according to their difference of bulk density. After determining the bulk density of the 360
samples of each almond class by pycnometer, the nut samples were cracked and their kernel percentage was determined by equation (1):

%=

100

(1)

Where mk and mn are kernel and nut masses (gram) respectively. Results showed that, unlike, soft almond cultivar (Monagha), there was poor and
negative correlation between bulk density and kernel percentage of hard and semisoft almond genotypes (Table 2). It is more likely due to the effect of
shell mass than kernel mass on bulk density difference in these genotypes (refer to amounts of kernel to shell mass ratio in Table 1, column 7). So, to
predetermine of nuts quality, all of the almond samples were numbered and recorded separately before acquiring their sound signals. After acquiring and
saving sound signals, each nut was cracked and its kernel percentage was determined. Meanwhile the kernels qualities were visually inspected too.
Table 2. The Pearson correlation coefficient between bulk density and kernel percentage of almond samples.
almond genotype (class)
HS103(hard)
HS215(semisoft)
Monagha(soft)

correlation coefficient
-0.15
-0.19
0.89

Then, the sound signals of numbered nut samples were classified based on their kernel percentage to full kernel, defective kernel and empty nuts and each
group of signals was applied to train ANN.
2.3. Signal processing and feature extraction
For extracting potential features, recorded sound signals were processed and analyzed in both time and frequency domains. A 1024-point Fast Fourier
Transform (FFT) was computed from each sound signal. The magnitude, |Y()|, power spectral density (PSD) and phase angle of each spectrum was
computed. Power spectral density was calculated as:
PSD = Y(). Y ()1024

(2)

Where * means complex conjugation. According to symmetry of sound signal in frequency domain, only 512 data from 1024 data points were used for
calculating PSD and phase angle. A total of 2524 features were obtained for each almond. For real time systems, this dimension of the input vector is too
large, but the components of the vectors are highly correlated. Principle Component Analysis (PCA) was used to reduce the dimension of the input
vectors to a maximum of 50 features. After normalization of data, PCA analysis was performed on data using Matlab software [7]. Principal components
(PCs) for different combinations of signal Amplitude, PSD and Phase angle were considered. To find the best combinations and the minimum number of
PCs with highest accuracy, various combinations of PCs were used as feature vector in a multilayer feed forward neural network (MFNN) classifier, offline.

363

Non-Destructive Detection of Unshelled Almonds Quality Based on Their Kernel Percentage Using Impact-Acoustics and ANNs Techniques
Agriculture Science Developments Vol(3), No (11), November, 2014.

2.4. Back propagation neural networks


The multilayer perceptron (MLP) is one of the most widely implemented neural network topologies [4]. MLPs are normally trained with the back
propagation algorithm. In fact the renewed interest in ANNs was in part triggered by the emergence of back propagation learning rule. The back
propagation rule propagates the errors through the network and allows adaptation of the hidden processing elements (PEs). Two important characteristics
of MLP are (i) use of nonlinear PEs such as logistic or hyperbolic tangent and (ii) their massive interconnectivity, i.e., any element of a given layer feeds
all the elements of the next layer. The MLP is trained with error correction learning, which means that the desired response for the system must be known
a priori. After adequate training, the network weights are adapted and employed for cross validation in order to determine the ANN model overall
performance. The topology of MLP neural network was included a three layer network incorporating a single hidden layer of processing elements. Each
PE has a weighted connection to every PE in the next layer and each performs a summation of its inputs passing the results through a transfer function. In
order to minimize ANN training time, only one hidden layer was considered in the network. The best network weights are saved on the parameter
variation, run, and epoch when the cross validation error is minimum. By using information about mean square error (MSE) of cross validation (CV) for
different ANN models, the number of PEs in hidden layer could be selected. In developing ANN models, the linear function at the input layer and the
non-linear hyperbolic tangent function at both hidden and output layers were used as transfer functions. As an additional guard against over-fitting, the
data sets were divided into three randomly selected data sets; 70% of data were used for training, 15% for cross validation and 15% were used for testing.
After training various algorithms, the Levenberg-Marquardt (LM) algorithm gave better results. To find the best combinations of potential features and
optimal ANN configuration, many different combinations of principle component features were selected and tested by neural network. These features
were fed to the ANN models and their performances were compared based on mean square error (MSE), correlation coefficient (r) and correct
classification rate (CCR). Expression used to calculate the MSE is given by equation (3):
=

(3)

Where P is the number of output neurons, N is the number of exemplars in data set, and tij and yij are the network and target outputs for exemplar i at
neuron j, respectively.
All experiments were conducted using 368 impact sounds comprising 168 defective kernel and 200 full kernel of Hard almond genotype, 319 impact
sounds containing 139 empty and 180 full kernel of semisoft almond genotype and 607 impact sounds of 288 empty and 319 full kernel of soft almond
cultivar. The number of empty hard almonds and defective semisoft and soft almonds were negligible and were not applied to the test.

3.

Results and Discussion

Emitted sound signals, on average, of full kernel, defective kernel or empty ones in time domain for hard, semisoft and soft almonds are shown in Figure
3 (a), (b) and (c) respectively. Comparing the sound signals of hard almonds with full and defective kernel (Figure 3 a), indicated that both of them have
approximately the same structure of signal spectrum in time domain but peak values of defective kernel signal were relatively lower than the full one. For
semisoft and soft almonds the difference of signal spectrum structure between full kernel and empty nuts was clearer (Figure 3 b and c).
In frequency domain the sound signal spectrums had the same different conditions as in time domain. These experiments were designed to find the optimum
Multilayer Neural Network configurations to be used later during online experiments. The summary of results is shown in Table 3.
Table 3. The best network structure and performance for almonds quality detection.
Almond genotype
(Class)
HS103
(Hard)
HS215
(Semisoft)
Monagha
(Soft)

Signal features
(PC's)
PSD(12)
Amp(10)
Ang(3)
PSD(9)
Amp(8)
Ang(3)
PSD(4)
Amp(11)
Ang(4)

Input
number

Hidden
Neurons

Run

Epoch

MSE

R
value

CCR% of Train *
F
D
E

CCR% of Cross Validation*


F
D
E

25

25

15

0.0637

0.96

97

98.8

87.5

93.5

20

35

17

0.0975

0.90

95.6

94.2

93.9

73.3

19

10

16

0.0337

0.96

99.1

97.2

97.6

93.9

*: F means Nut with full kernel; D means Nut with defective kernel; E means Empty nut.

To separate full and defective hard almond nuts, the best combination of principle components for the input vector was found as 12 signal PSD (0.001 of
variance omitted), 10 amplitudes (0.01 of variance omitted) and 3 phase angle features (0.01 of variance omitted) so that the pattern (25-25-2) of MLP
revealed the highest correlation coefficient (r-value) 0.96 and least MSE of cross validation(CV) about 0.0637 at second training run and epoch 15 (Figure 4).
This figure does not indicate any major problems with the training. The validation and test curves are very similar. The correct classification rate
(CCR) of full kernel and defective kernel were 97% and 98.5% on training data set and 87.5% and 93.5% on CV data set respectively. For separating of
full and empty semisoft almond nuts, the best combination of PC's was 9 PSD (0.001of variance omitted), 8 amplitude (0.01variance omitted) and 3
phase angle (0.01 variance omitted) as input vector. So the topology 20-35-2 of network at first training stage resulted the highest CCR of full and empty
nuts equal to 95.6% and 94.2% on training data set and 93.9% and 73.3% on CV data set respectively with 0.90 r-value and 0.0975 MSE at epoch
17.
To segregate empty and full soft almond nuts, the combination of PC's includes 4 PSD, 11 amplitude and 4 phase angle (all with 0.005 variance
omitted), as input vector with 10 neurons in hidden layer (topology 19-10-2), achieved the best CCR of full and empty nuts within 99.1% and 97.2%
on training data set and 97.6% and 93.9% on CV data set respectively with 0.96 r-value and 0.0337 MSE at 5th training run and epoch 16.

Ali Reshadsedghi *, Asghar Mahmoudi, Vahid Azimirad, Jafar Hajilou, Hossein Ghaffari
Agriculture Science Developments Vol(3), No (11), November, 2014.

0.6
Full kernel
0.4
Amplitude (Volt)

Defective kernel
0.2
0
0

12 14 16 18 21 23 25 28 30 32

-0.2
-0.4
-0.6

Sampling Time(ms)

(a)
0.5

Full kernel

0.4
Empty

Amplitude(Volt)

0.3
0.2
0.1
0
-0.1 0

11 14 16 18 20 23 25 27 30 32

-0.2
-0.3
-0.4
-0.5

Sampling Time(ms)

(b)
0.4

Full kernel

0.3

Empty

Amplitude(Volt)

0.2
0.1
0
-0.1

11 14 16 18 20 23 25 27 30 32

-0.2
-0.3
-0.4

Sampling Time(ms)

(c)
Figure 3. Sound signals in time domain of different kernel quality for (a) hard, (b) semisoft and (c) soft almonds.

364

365

Non-Destructive Detection of Unshelled Almonds Quality Based on Their Kernel Percentage Using Impact-Acoustics and ANNs Techniques
Agriculture Science Developments Vol(3), No (11), November, 2014.

Figure 4. The training, validation and test performance of selected pattern of MLP

4.

Conclusion

In this study, an effective and low-cost impact -acoustics classification system was applied to distinguish between full kernel, defective kernel and
empty almond nuts without cracking. Impact sounds of almonds were analyzed, and feature parameters describing time and frequency domain
characteristics of the acoustic signals were extracted and combined into feature vectors. By determining the best multi-layer back propagation neural
network topologies and using LM training function, it was possible to detect the quality of various unshelled-almonds genotypes based on their
kernel percentage with over 95% accuracy. There was no clear correlation between bulk density and kernel percentage of unshelled-almond nuts.

References
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[11]
[12]
[13]
[14]

Cetin, A. E., T. C. Pearson, and A. H. Tewfik.(2004a). Classification of closed- and open-shell pistachio nuts using voice-recognition technology. Trans. ASAE
47(2): 659-664.
Cetin, A. E., T. C. Pearson, and A. H. Tewfik. (2004b.). Classification of closed- and open-shell pistachio nuts using impact acoustical analysis, In Proc.
(2004). International Conference on Acoustics, Speech, and Signal Processing (ICASSP 2004). Piscataway, N.J.: IEEE.
FAO. (2013). FAOSTAT database. http://faostat.fao.org/faostat/ (accessed: 8 Feb., 2013).
Haykin S. (1999). Neural Networks: A Comprehensive Foundation. Prentice Hall, New Jersey.
Kalantari D., Ghomi Najjardeh M. and Ghodrati A. (2013). Investigation of some physical properties related to healthy and non-brain walnuts. Engineers press,
World of Sciences Journal. 1(5) June, Special Issue -Agriculture: 38-52.
Kalkan H, Ince NF, Tewfik AH, Yardimci Y, Pearson T.(2008). Classification of hazelnut kernels by using impact acoustic time-frequency patterns. EURASIP
Journal on Advances in Signal Processing. 2008 (1-11).
MathWorks. (2012). MATLAB Users Guide. The MathWork, Inc.
Omid M, Mahmoudi A, Omid MH. (2010). Development of pistachio sorting system using principal component analysis (PCA) assisted artificial neural
network (ANN) of impact acoustics. Expert Systems with Applications. 37(10): 7205-7212.
Onaran I., Pearson T.C., Yardimci Y., Cetin A. E. (2006). Detection of underdeveloped hazelnuts from fully developed nuts by impact acoustics. Transactions of the
ASAE, 49(6): 19711976.
Onaran I., Ince N.F., Tewfik A.H., and Cetin A.E. (2007). A signal representation approach for discrimination between full and empty hazelnuts. EUSIPCO, Poznan,
2464-2468.
Pearson TC. (2001). Detection of pistachio nuts with closed shells using impact acoustics. Applied Engineering in Agriculture, 17(2): 249253.
Reshadsedghi A. and Mahmoudi A. (2013). Detection of almond varieties using impact acoustics and artificial neural networks. International Journal of Agriculture
and Crop Sciences. 5: 1008-1017.
Sajjadi J., Ghazanfari A. and Rostami A. (2008). Using of sound processing and neural networks in pistachio sorting, The fifth congress of agriculture mechanical
engineering and mechanization, Mashhad.
UNECE Standard DDP-05. (1991). Unshelled sweet almonds. Annex I: Determination of the moisture content for dry produce (Nuts). page 7. United
Nations. New York and Geneva.

You might also like