You are on page 1of 5

Journal of Stored Products Research 56 (2014) 38e42

Contents lists available at ScienceDirect

Journal of Stored Products Research


journal homepage: www.elsevier.com/locate/jspr

Detection of the granary weevil based on X-ray images of damaged


wheat kernels

P. Boniecki a, H. Piekarska-Boniecka b, K. Swierczy  ski a, K. Koszela a, *, M. Zaborowicz a,
n
J. Przyby1 a
a  University of Life Sciences, Institute of Agricultural Engineering, Wojska Polskiego 50, 60-625 Poznan, Poland
Poznan
b
Poznan University of Life Sciences, Department of Entomology and Environmental, Da˛ browskiego 159, 60-594 Poznan  , Poland

a r t i c l e i n f o a b s t r a c t

Article history: Grain in storage is exposed to a number of adverse factors, including extensive damage to grain kernels
Accepted 12 November 2013 caused by infestations of the granary weevil Sitophilus granarius. This pest causes a major decline in grain
quality leading to a substantial drop in the value of the stored material, thus contributing to large
Keywords: financial losses. It is therefore essential to ensure that this pest is identified promptly and accurately if
Granary weevil identification present in the stored grain.
Neural modeling
The purpose of this study was to define the visual representative features found in digital X-ray images
Analysis of digital X-ray images
of wheat kernels that bear traces of inner kernel damage caused by the granary weevil. Such features are
required to build training sets, which are crucial for the development of digital neural classifiers. Sub-
sequently, a set of identifying neural models was produced and verified, after which an optimal topology
was selected. The optimal artificial neural network (ANN) was a three-layer perceptron with the
following structure: 8:11-6-1:1. The proposed model identified 100% of the infested kernels correctly,
and 98.4% of the healthy ones. The analysis of the sensitivity of the generated neural model demon-
strated the significance of the following three graphical parameters determining the quality of damaged
kernel identification: cultivar, Feret coefficient (WF) and the area (P) of the kernel.
Ó 2013 Elsevier Ltd. All rights reserved.

1. Introduction grain surface and the whole developmental process takes place
inside the grain. The known methods for identification of hidden
Due to the growing scale of production and insufficient pro- infestations require the use of an expert, whose work is time-
cessing capacities, it is necessary to adopt advanced methods of consuming and costly. The commonly applied methods include:
grain storage in specially-designed facilities. These typically take physiological tests (used in large grain elevators in the USA),
the form of specialized silos (Singh et al., 2011; Alfatni et al., 2013). ninhydrin tests, ultrasound methods, flotation methods, magnetic
The grains in storage are exposed to a number of adverse factors resonance imaging (MRI), infrared radiation (IR), and X-rays. A
and impacts, including those caused by a range of storage pests well-known and used method is analysis of X-ray images of kernels
(Dah-Jye et al., 2008; Manickavasagan et al., 2008). One such pest, to identify weevil infestation (Karunakaran et al., 2003, 2004). To
believed to be a source of significant damage, is Sitophilus granarius achieve this, Karunakaran used a linear-function parametric clas-
(L.), the granary weevil (Niewiada et al., 2005.). The weevil is a sifier, and classical methods of digital image analysis.
beetle which feeds on and multiplies in stored grain (Atui et al., To minimize potential losses, the pest needs to be identified
2007; Piekarska-Boniecka et al., 2008), causing enormous damage promptly and accurately (Trematerra et al., 1999, 2013). A possible
to the quality of such grain and lowering its value. solution is to identify granary weevils indirectly by the destructive
Grain weevil infestation may be visible (optical information) or effects of their feeding within kernels. Choosing the right repre-
hidden (results of the pest’s activity inside the grain). Hidden in- sentative features to best describe the classification task is key to
festations are particularly difficult to identify due to the specific ensuring proper neural identification (Singh et al., 2009).
reproductive process of weevils. The female inserts eggs into the The purpose of the study was to define representative features
which describe the inner damage to kernels caused by granary
weevils (Nawrocka et al., 2012). An additional objective was to
* Corresponding author. Tel.: þ48 50 228 8097; fax: þ48 61 848 7156. develop and verify a set of identification neural models dedicated to
E-mail address: koszela@up.poznan.pl (K. Koszela). supporting the decision-making processes in the course of storing

0022-474X/$ e see front matter Ó 2013 Elsevier Ltd. All rights reserved.
http://dx.doi.org/10.1016/j.jspr.2013.11.001
P. Boniecki et al. / Journal of Stored Products Research 56 (2014) 38e42 39

wheat (Karunakaran et al., 2004; Boniecki et al., 2011; Nawrocka


et al., 2012).

2. Material and methods

2.1. Empirical study

The study relied on the use of four cultivars of spring wheat


which showed signs of damage caused by the granary weevil. The
cultivars were: Torka, Narwa, Banti and Symfonia. The samples
were randomly selected. The research material was selected on the
basis of the share of the sowing area as provided by the Research
Fig. 1. Method for the empirical data acquisition.
Centre for Cultivar Testing in 2004. All cultivars were obtained from
two cultivation stations: Hodowla Roslin Strzelce Sp. z o.o. and  non-dimensional aspect ratio (WK):
Hodowla Roslin Rolnych-Kobierzyc Sp. z o.o. The samples were
randomly chosen, and they were not selected according to their
WF ¼ L2 =4pS (2)
shape, size or alignment.
The laboratory testing was conducted by a specialist laboratory
of the Department of Entomology, Institute of Plant Protection e  Feret coefficient (WF):
National Research Institute in Poznan  (IOR e PIB Poznan  ). Fifty
polypropylene containers were used for the test, whose structure WF ¼ LN =LV (3)
enabled airflow but prevented the pests from leaving. To each
container 400 randomly selected kernels were added, followed by  Two aspect rates (WC1 and WC2):
20 pairs of weevils (20 males and 20 females) except for the control
containers. The next step involved placing these containers in a pffiffiffiffiffiffiffiffiffi
laboratory cultivator, where fixed storage conditions were pro- WC1 ¼ 2 S=p (4)
vided, optimal for the growth and development of the beetles. The
time the beetles spent in the containers was strictly determined as WC2 ¼ L=p (5)
5, 10, 15 or 20 days. During that time the weevils were feeding,
mating and laying eggs from which the larvae of the pest
developed.  Malinowska coefficient (WM):
Thirty kernels were randomly selected from each sample of the
four cultivars (Torka, Narwa, Banti and Symfonia). Once prepared in WC2 ¼ L=p (6)
the above manner, the material was placed in the soft X-ray-
emitting Elektronika 25 X-ray apparatus in order to produce a series
of X-ray images (Mery et al., 2011; Karunakaran et al., 2004).
After being prepared in the above fashion, the X-ray plate scans
were analyzed to identify individual kernels, which were then
saved in separate files using the *.bmp format (Neethirajan et al.,
2007). Subsequently, the digital images underwent thresholding
binarization. The author relied on one of the simplest methods of
comparing each point of the image with a predefined threshold
value (Fornal et al., 2007; Cheng-Jin and Da-Wen, 2006). This was
done with the use of the following Equation (1):

1; Jðx; yÞ > t
Jw ðx; yÞ ¼ (1)
0; Jðx; yÞ  t
Fig. 2. The X-ray image and binary images of affected wheat grain of cv. Narwa (t ¼ 60,
where: 70, 80).

t e binary threshold, t: 60, 70, 80

The task was completed by means of original, specially designed


and developed software. The resulting IT system made it possible to
binarize the images of any number of kernels and save each of them
in a separate folder according to a pre-defined binarization
threshold (Brabec et al., 2010). In the course of the project, signif-
icant differences were noted in images binarized for various
threshold t values (Figs. 1 and 2) which could have affected iden-
tification quality. Hence, studies were conducted for the three
selected values of threshold t: 60, 70 and 80.
Classical digital image analysis was applied to identify the values
of shape coefficients with such shapes having been recognized as
variables representative for the classification process (Fig. 3)
(Mezreb et al., 2003; Utku and Kijksel, 1998). These were: Fig. 3. Dimensions showing the aspect ratios.
40 P. Boniecki et al. / Journal of Stored Products Research 56 (2014) 38e42

Table 1
Main file of the input vectors obtained from X-ray images.

Cultivar Damaged Healthy Total

t ¼ 60 t ¼ 70 t ¼ 80 Damaged total t ¼ 60 t ¼ 70 t ¼ 80 Healthy total

Banti 40 40 40 120 111 111 111 333 453


Narwa 38 38 38 114 118 118 118 354 468
Symfonia 10 10 10 30 127 127 127 381 411
Torka 31 31 31 93 73 73 73 219 312
Sum 119 119 119 357 429 429 429 1287 1644

 area (P): calculating field consists in summing up points 1. non-dimensional shape coefficient (WK),
belonging to the analyzed object, 2. Feret coefficient (WF),
 circumference (L), 3. circularity coefficient (WC1),
4. circularity coefficient (WC2),
where: 5. Malinowska coefficient (WM),
6. area (P),
L e circumference, 7. circumference (L),
S e area, 8. cultivar (W4: four-state variable).
LN e maximum size vertically,
LV e maximum size horizontally. The structure of a learning file made up of eight input variables
and one output variable, is illustrated in Table 2.

2.2. Neural modeling


3. Results
The optimal neural model was selected through a series of
computer simulations with the use of an artificial neural network The neural model was found to be a MLP (MultiLayer Percep-
simulator embedded in a commercial statistical package, Statistica tron) type, having the following structure: 8:11-6-1:1 and test
v.10 (Boniecki et al., 2012; Koszela et al., 2013). The training set was value of 98.8% (Table 3).
generated on the basis of previously acquired X-ray images It was trained and tested with the use of the g-80 learning file
(Neethirajan et al., 2007). The file of digital X-ray images of affected (t ¼ 80). The model comprised 11 neurons in the input layer (the
kernels included kernels bearing traces of granary weevil feeding “cultivar” variable was a nominal four-state variable), 6 neurons in
(with the exception of kernels bored supposedly to lay eggs within the hidden layer and 1 in the output layer (Fig. 4).
the kernel). The learning cases produced in this manner were A standard analysis of the model’s sensitivity to input variables
compiled into a file of 1664 input vectors (Boniecki et al., 2009.). showed that variable W4 was the key feature in the classification
Table 1 illustrates the structure of the resulting learning file. process (Table 4). The next most important feature was the Feret WF
Three subsets (a-60, b-70, g-80) were defined within the main coefficient, which corresponds to item elongation. One may pre-
file of input vectors, each for one of the three binarization thresh- sume that granary weevil feeding has a strong impact on kernel
olds t (60, 70 and 80 respectively). The subfiles were then divided shape and in particular on kernel elongation. Another three fea-
into learning, validation and test files in a standard way. The files tures, ranked by significance, were: area, circumference and
comprised randomly selected training cases from the main file at circularity coefficient WC2.
the ratio of 2:1:1 respectively (Szczypinski and Zapotoczny, 2012; An analysis of the confusion matrix of the resulting classification
Slosarz et al., 2011). model showed that the model trained with the g-80 set (t ¼ 80)
Finally, the main training set was constructed with the use of succeeded in properly classifying 100% of the kernels infested by
eight features pre-selected as input variables representative for the granary weevil (Table 5). Only one of the healthy kernels was
identification. These were: misclassified (and assigned to an incorrect class).

Table 2
Fragment of a learning file made up of eight input variables and one output variable.

Input Output

No. 1 (WK) 2 (WF) 3 (WC1) 4 (WC2) 5 (WM) 6 (P) 7 (L) 8 (W4) ANN Replay

1 1.113171 2.130841 157.5651 166.242 0.0550691 19489 522 Banti Damaged


2 1.088312 1.983333 172.176 179.6178 0.04322 23271 564 Narwa Damaged
3 1.130556 2.121495 160.2427 170.3822 0.06328 20157 535 Symfonia Damaged
4 1.026332 1.913386 181.3853 183.758 0.01308 25827 577 Torka Healthy
5 1.077728 2.044643 165.9637 172.293 0.03814 21622 541 Banti Healthy
6 1.0657 1.795455 179.2376 185.0318 0.03233 25219 581 Symfonia Damaged
. . . . . . . . . .
1638 1.005114 1.721429 191.2313 191.7197 0.002554 28707 602 Symfonia Healthy
1639 1.249129 1.75969 169.8294 189.8089 0.1176444 22641 596 Torka Damaged
1640 1.432359 1.792308 159.3938 190.7643 0.1968118 19944 599 Banti Healthy
1641 2.185775 1.785714 155.5266 229.9363 0.4784368 18988 722 Narwa Damaged
1642 1.24362 1.657343 165.9215 185.0318 0.1151772 21611 581 Banti Damaged
1643 2.224083 2.06087 156.9575 234.0764 0.491336 19339 735 Narwa Healthy
1644 1.249325 1.944954 152.7206 170.7006 0.1177319 18309 536 Symfonia Healthy
P. Boniecki et al. / Journal of Stored Products Research 56 (2014) 38e42 41

Table 3 Table 6
Quality of the neural model MLP: 8:11-6-1:1 for learning file g-80. Characteristics of ROC curves of models.

Model Learning Validation Test Algorithm No. of the model Model Surface under the ROC curve
quality [%] quality [%] quality [%]
g-3 MLP 8:11-6-1:1 0.996
MLP 8:11-6:1 91.6 91.4 98.8 BP 1200, CG 1500

Where: BP 1200 e means learning ANN (Artificial Neural Network) algorithm back.
Propagation for 1200 epochs.
CG 1500 e means learning ANN algorithm Conjugate Gradient for 1500 epochs.
representative features for identification of the granary weevil,
performed on the basis of information encoded in the form of
digital images, were the selected shape coefficients, determined for
binarized X-ray images of individual kernels.
The model which revealed the highest testing quality was a
three-layer perceptron with eleven neurons in the input layer, six
neurons in the hidden layer, and two in the output layer. This model
enabled correct classification, identifying 100% of infested grains.
The final conclusions are as follows:

1. Neural classification is a useful IT technology for supporting the


identification of the adverse effects of granary weevil feeding on
stored wheat grain.
2. Of all the generated neural models, the network that best
Fig. 4. Structure of neural model type MLP: 8:11-6-1:1.
identified the effects of granary weevil feeding on kernels (i.e.
the network that offers the highest test quality) was a three-
layer perceptron with a MLP 8:11-6-1:1 structure. The model
An effective technique for defining the capacity of two-state achieved the highest number of correctly classified damaged
classifiers and defining the optimal threshold value (acceptance kernels (the area under the ROC curve amounting to 0.996).
and rejection) is the ROC (Receiver Operating Characteristic) curve 3. An analysis of neural network sensitivity (to input variables)
method. The larger the area under the curve (standardized to 1), helped identify representative features of key importance for
the higher the classification quality. A ROC analysis of the generated the identification of damaged kernels. These were, in the order
neural separator revealed that the MLP 8:11-6-1:1 model was a of importance, cultivar (W4), Feret coefficient (WF) and kernel
classifier of good quality (Table 6). The area under the ROC curve area (P).
was 0.996 (which is close to 1). 4. The optimal neural classifier (MLP 8:11-6-1:1) was trained with
a set generated on the basis of X-ray images of damaged wheat
kernels with the assumed binarization threshold t ¼ 80.
4. Conclusion

References
A classification neural topology was generated to identify effi-
ciently the effects of grain weevil feeding in stored wheat grain on Alfatni, M., Shariff, A., Abdullah, M., Marhaban, M., Saaed, O., 2013. The application
the basis of information coded in the form of digital X-ray images. A of internal grading system technologies for agricultural products e review.
significant element in the identification process was the estimation J. Food Eng. 116, 703e725.
Atui, M.B., Flinn, P.W., Lazzari, S.M.N., Lazzari, F.A., 2007. Detection of Rhyzopertha
of the representative features enabling correct classification. Their dominica larvae in stored wheat using ELISA: the impact of myosin degradation
proper selection was the basis for the construction of learning data following fumigation. J. Stored Prod. Res. 43, 156e159.
sets, crucial to the process of neural model generation. The Boniecki, P., Dach, J., Pilarski, K., Piekarska-Boniecka, H., 2012. Artificial neural
networks for modeling ammonia emissions released from sewage sludge
composting. Atmos. Environ. 57, 49e54.
Boniecki, P., Nowakowski, K., Tomczak, R.J., 2011. Neural networks type MLP in the
Table 4 process of identification chosen varieties of maize. In: 3rd International Con-
Sensitivity analysis of optimal model MLP 8:11-6-1:1. ference on Digital Image Processing (ICDIP 2011), Proceedings of SPIE. http://
dx.doi.org/10.1117/12.896184.
Input variable Error Rank
Boniecki, P., Dach, J., Nowakowski, K., Jakubek, A., 2009. Neural image analysis of
(WC1) 1.029 8 maturity stage during composting of sewage sludge. In: International Confer-
(WC2) 1.171 5 ence on Digital Image Processing (ICDIP 2009), Proceedings, pp. 200e203.
(P) 1.244 3 http://dx.doi.org/10.1109/ICDIP.2009.85.
(WF) 1.482 2 Brabec, D., Pearson, T., Flinn, P., Katzke, D., 2010. Detection of internal insects in
wheat using a conductive roller mill and estimation of insect fragments in the
(W4) 4.302 1
resulting flour. J. Stored Prod. Res. 46, 180e185.
(WM) 1.112 7
Cheng-Jin, Du, Da-Wen, Sun, 2006. Learning techniques used in computer vision for
(L) 1.172 4
food quality evaluation: a review. J. Food Eng. 72, 39e55.
(WK) 1.148 6 Dah-Jye, L., Schoenberger, R., Archibald, J., McCollum, S., 2008. Development of a
machine vision system for automatic date grading using digital reflective near-
infrared imaging. J. Food Eng. 86, 388e398.
Table 5 Fornal, J., Jelinski, T., Sadowska, J., Grundas, S., Nawrot, J., Niewiada, A.,
Confusion matrix of the MLP 8:11-6-1:1 classification model. Warchalewsk, i J.R., Blaszczak, W., 2007. Detection of granary weevil Sitophilus
granarius (L.) eggs and internal stages in wheat grain using soft X-ray and image
Reply: “Damaged” Reply: “Healthy” Total analysis. J. Stored Prod. Res. 43, 142e148.
Karunakaran, C., Jayas, D.S., White, N., 2003. X-ray image analysis to detect in-
Total 17 64 81 festations caused by insects in grain. Cereal Chem. 80, 553e557.
Correct 17 63 80 Karunakaran, C., Jayas, D.S., White, N.D.G., 2004. Detection of internal wheat seed
Incorrect 0 1 1 infestation by Rhyzopertha dominica using X-ray imaging. J. Stored Prod. Res.
Correct [%] 100.0 98.4 98.8 40, 507e516.
Incorrect [%] 0.0 1.6 1.2 Koszela, K., Weres, J., Boniecki, P., Zaborowicz, M., Przybył, J., Dach, J., Pilarski, K., D.
Janczak, D., 2013. Computer image analysis in the quality procedure for selected
42 P. Boniecki et al. / Journal of Stored Products Research 56 (2014) 38e42

carrot varieties. Proc. SPIE 8878, Fifth International Conference on Digital Image Singh, C.B., Jayas, D.C., Paliwal, J., White, N.D.G., 2009. Detection of insect-damaged
Processing (ICDIP 2013), 887811. http://dx.doi.org/10.1117/12.2030701. wheat kernels using near-infrared hyperspectral imaging. J. Stored Prod. Res.
Manickavasagan, A., Jayas, D.S., White, N.D.G., 2008. Thermal imaging to detect 45, 151e158.
infestation by Cryptolestes ferrugineus inside wheat kernels. J. Stored Prod. Res. Singh, C.B., Jayas, D.S., Paliwal, J., White, N.D.G., 2011. Identification of insect-
44, 186e192. damaged wheat kernels using short-wave near-infrared hyperspectral and
Mery, D., Lillo, I., Loebel, H., Riffo, V., Soto, A., Cipriano, A., Aguilera, J.M., 2011. digital colour imaging. Comput. Electron. Agric. 73, 118e125.
Automated fish bone detection using X-ray imaging. J. Food Eng. 105, 485e492. Slosarz, P., Stanisz, M., Boniecki, P., Przybylak, A., Lisiak, D., Ludwiczak, A., 2011.
Mezreb, K., Goullieux, A., Ralainirina, R., Queneudec, M., 2003. Application of image Artificial neural network analysis of ultrasound image for the estimation of
analysis to measure screw speed influence on physical properties of corn and intramuscular fat content in lamb muscle. Afr. J. Biotechnol. 10, 11792e
wheat extrudates. J. Food Eng. 57, 145e152. 11796.
Nawrocka, A., Stepien, E., Grundas, S., Nawrot, J., 2012. Mass loss determination of Szczypinski, P.M., Zapotoczny, P., 2012. Computer vision algorithm for barley kernel
wheat kernels infested by granary weevil from X-ray images. J. Stored Prod. Res. identification, orientation estimation and surface structure assessment. Com-
48, 19e24. put. Electron. Agric. 87, 32e38.
Neethirajan, S., Jayas, D.S., White, N.D.G., 2007. Detection of sprouted wheat kernels Trematerra, P., Fontana, F., Mancini, M., Sciarretta, A., 1999. Influence of intact and
using soft X-ray image analysis. J. Food Eng. 81, 509e513. damaged cereal kernels on the behaviour of rice weevil, Sitophilus oryzae (L.)
 , H., Wa˛ sowicz, E.,
Niewiada, A., Nawrot, J., Szafranek, B., Szafranek, J., Synak, E., Jelen (Coleoptera: Curculionidae). J. Stored Prod. Res. 35, 265e276.
2005. Some factors affecting egg-laying of granary weevil Sitophilus granarius Trematerra, P., Ianiro, R., Athanassiou, C.G., Kavallieratos, N.G., 2013. Behavioral
(L.). J. Stored Prod. Res. 41, 544e555. responses of Sitophilus zeamais Motschulsky adults to conditioned grain ker-
Piekarska-Boniecka, H., Kadiubowski, W., Siatkowski, I., 2008. Study of bionomy of nels. J. Stored Prod. Res. 53, 77e81.
the privet sawfly (Macrophya punctumalbum (L.)) (Hymenoptera, Ten- Utku, H., Kijksel, H., 1998. Use of statistical filters in the classification of wheats by
thredinidae) e a pest of park plants. Acta Sci. Pol. Hortorum Cultus 7 (1), 3e11. image analysis. J. Food Eng. 36, 385e394.

You might also like