Neural Identification of Chosen Apple Pests Using Algorithm LVQ Piotr Boniecki1, Hanna Piekarska-Boniecka2, Duong Tran Dinh2, Maciej Zaborowicz1, Jacek Dach1, Anna Smurzyńska1, Krzysztof Koszela1 1 Poznan University of Life Sciences, Faculty of Agronomy and Bioengineering, Poznan, Poland, e-mail: bonie@up.poznan.pl 2 Poznan University of Life Sciences, Department of Entomology and Environmental Protection, Poznan, Poland Abstract. The aim of this work was a neural identification of selected apple tree orchard pests in Poland. The classification was conducted on the basis of graphical information coded in the form of selected geometric characteristics of agrofags, presented on digital images. A neural classification model is presented in this paper, optimized using learning files acquired on the basis of information contained in digital photographs of pests. There has been identified 6 selected apple pests, the most commonly encountered in Polish orchards, has been addressed. In order to classify the chosen agrofags, neural networks type SOFM (Self-Organizing Feature Map) methods supported LVQ (Learning Vector Quantization) algorithms were utilized, supported by digital analysis of image techniques. Keywords: classification of apple pests, neural modelling, computer analysis of the digital image 1 Introduction Apples are one of the more important horticultural commodities, mass produced in Poland. Apple production, comprising roughly 70% of fruit crops (over 80% of tree fruit crops) is conducted by approximately 242 thousand specialized firms [15]. It is worth to notice that Poland is among the leading producers and exporters of apple concentrate worldwide. An important issue related to apple production is the matter of effectively protecting the plantation against pests [18][11]. Efficient plant protection is possible only after correctly identified the pests and their feeding[16][19]. Neural image analysis is a relatively new branch of information technology [27][28][2][26][21]. With increasing frequency it finds practical employment, as computer assistance for processes performed during recognition of objects displayed in graphic form, among others. In the above context, methods and techniques of extracting information coded in digital images, performed mostly on the basis of previously defined characteristic attributes, become important [17]. During 293 identification, and then extracting the data embedded in digital images, an important role is played by artificial neural networks SOFM (Self-Organizing Feature Map) type, taught without supervision (unsupervision), i.e. generated using the “without teacher” technique [1][12][20]. It is worth noting that in the process of taught of neural networks new input signals providing the output of results in real time. Due to their properties, neural models more and more commonly find practical applications [25][10][17][5][6]. In this work research was conducted with the aim of assisting decision-making processes occurring during apple production [13]. With crop protection in mind, the problem of identifying 6 selected apple pests, commonly occurring in Polish orchards, was considered. Chosen graphical parameters characterizing only the geometric properties were assumed as characteristic properties allowing for identification of a given pest. The aim of the work was to using a SOFM neural classifier and LVQ algorithm designed to recognize apple orchard pests based on digital photographs. Accordingly, a set of neural classification models was designed and constructed. 2 Materials and methods 2.1 Materials Apple trees can be infested with numerous kinds of pests, but only a few of them occur in production orchards. The research material used in order to solve the established problem was a group of 6 pests most commonly feeding on apple orchards and posing the greatest threat to apple trees. For the purpose of capturing feeding pests, pheromone traps were utilized [8][23]. Next, a series of pictures and the binary representation of the 6 selected pests was taken (Fig. 1): Fig. 1. The 6 selected apple pests (1…6) [24] 294 1) Apple bossom weevil [Anthonomus pomorum (L.)] COLEOPTERA, CURCULIONIDAE 2) Apple leaf sucker [Cacopsylla mali (Schmidb.)] HEMIPTERA, PSYLLIDA 3) Apple moth [Yponomeuta malinellus (Zell.)] LEPIDOPTERA, GRACILLARIIDAE 4) Codling moth [Cydia pomonella (L.)] LEPIDOPTERA, TORTRICIDAE 5) Apple clearwing [Synanthedon myopaeformis (Borkh.)] LEPIDOPTERA, SESIIDAE 6) Apple aphid [Aphis pomi (De Geer)] HEMIPTERA, APHIDIDAE 2.2 Methods The pattern of conduct is shown (Fig. 2.): Fig. 2. The pattern of conduct For the purpose of constructing the neural classification model Kohonen type, the neural network simulator implemented in the Statistica v.10 suite was used A neural LVQ (Learning Vector Quantization) model Neural networks type LVQ (introduced by Tuevo Kohonen) are modeled on the typological properties of the human brain, in particular in cortex and is an example of neural networks teaching with forcing [3]. Because of their unsupervised learning methods, such networks are also known as SOFMs (Self-Organizing Feature Maps). By transforming output values (in the course of post processing), LVQ networks produce a nominal output variable which, for better perception, is commonly presented in the form of a two-dimensional grid of nodes. Each value of the variable represents a single class with its corresponding adequate neurons found in the network output layer. The link between a neuron and a given class is indicated by the a priori prescribed label containing class name. Each time a taught network is used and an input signal appears, a winning neuron (one with the highest level of activation and the best match between the weight vector and the input vector presented to the network) is designated. The structure allows for defining the output layer of the LVQ network in the form of a two-dimensional "map" which models a multidimensional set of input data [3]. The structure of a LVQ network is usually defined as a two-layer network. It comprises an input and two-dimensional output layer in which the data presented on the input are processed. The output layer (Kohonen layer) is made up solely of radial neurons which are seen as nodes in the two-dimensional grid (Fig. 3). 295 Fig. 3. A sample structure of LVQ type artificial neural network with Kohonen output layer Learning LVQ LVQ is essentially a controlled version of the Kohonen learning algorithm. In the basic version of the LVQ network, the distance between the input vector and the weights of the i - weight of this neuron is calculated for each i = 1, ..., m (1) where: wi - vector weights, x - input vector. The weight of the winning neuron is modified according to the pattern: (2) where: w’ – weight of winning neuron. Learning file design The most important stage of generating ANN (Artificial Neural Network) is creating proper learning files that contain coded data, including empirical data [3][4]. Therefore, numerical input variables and a nominal output variable were specified that were a consequence of the established scientific problem structure. As a group of representative input parameters, a file of selected 5 standard shape coefficients. These measurements mostly regard the description of objects presented on binary images and are adequate for the insects displayed in the photographs [22][20][2][3]. As the 5 input variables for the created neural network, the following representative characteristics were accepted: [1] dimensionless shape factor marked in the learning data file designated table 1 as [1]: L2 Wb = (3) 4π S where: L – stands for circumference of the object, 296 S - stands for surface area of the object. [2] factor of circulation RC1 marked in the learning data file (it determines the diameter of circle with a circumference equal to the circumference of the analyzed object) designated table 1as [2]: S RC1 = 2 ⋅ (4) π where: S - stands for surface area of the object [3] factor of circulation RC2 marked in the learning data file (it determines the diameter of circle of which field is equal for field of the analyzed object) designated table 1 as [3]: L RC 2 = (5) π where: L - stands for circumference of the object [4] Malinowska factor marked in the learning data file designated table 1 as [4]: L (6) RM = −1 2⋅ π ⋅S where: L - stands for circumference of the object S - stands for surface area of the object [5] field S marked in the learning data file whose measurement refers to counting pixels belonging to the area of interest designated in table 1 as [5]. This feature is sensitive to errors that resulted from the improper binarization. On the other hand, however, it is insensitive to translations and rotations. As one variable output, designed for labeling response LVQ network, adds was adopted: − 6-state variable with nominal values of: 1) Anthonomus pomorum, 2) Cacopsylla mali, 3) Yponomeuta malinellus, 4) Cydia pomonella, 5) Synanthedon myopaeformis, 6) Aphis pomi. Using the acquired research material and applying image analysis methods, a data (learning) file was generated that contained 2600 cases. The created file was conventionally divided into: − training file, containing 1300 cases, − validating file, containing 650 cases, − testing file, containing 650 cases. 297 The structure of the learning file comprised 5 uninterrupted, numerical input variables and one nominal (6-state) output variable necessary in the process of labeling Kohonen neural network model using LVQ algorithm. A structure and fragment of the learning file is presented (Tab. 1.): Table 1. Fragment of learning file Input variables Output variable Case Wb RC1 RC2 RM S Pests (Fig. 1) number [1] [2] [3] [4] [5] (1…6). … … … … … … … 311 14.309 0.890 244.066 4.166 2995 1) 312 12.161 1.677 333.998 0.072 1298 3) 313 17.311 0.578 258.126 3.324 3367 3) 314 10.121 1.122 354.123 0.067 1378 5) 315 18.099 1.123 367.990 0.083 1265 6) 316 17.359 0.777 278.066 3.166 3122 5) 317 17.171 0.574 280.948 3.082 3267 4) 318 17.359 0.786 244.066 3.166 3123 1) … … … … … … … 2600 16.22 0.589 282.933 3.182 3444 4) For designing the neural models, an artificial neural network simulator, implemented in the statistical package Statistica v.10 suite, was utilized. Creating the neural models was conducted in two stages. Initially the efficient option assisting neural network designing (“Automatic network designer”), implemented in the statistical information system. This tool allowed for automation and simplification of initial network set searching procedures that would best model the studied process. During the second stage, the “User network designer” tool was used. This tool was utilized repeatedly, modifying initial parameter-related settings, learning algorithms and the network structure itself. 3 Results and discussion The author has constructed teaching file containing 1600 learning cases. The adopted representative variables comprised such 5 distinctive input parameters (Tab. 1.) The “Pests” parameter was not used in generating the Kohonen networks (unsupervised learning). The variable was used to label the topological Kohonen map using LVQ method optimization. The generated topology map was optimized with the use of Kohonen's algorithm implemented in Statistica v.10. The learning process was carried out conventionally in two stages. The preliminary learning stage involved using a high value of initial learning ratio (between 0.9 and 0.1) together with a broad neighbourhood range (between 2 and 1). Learning was carried out during only 200 cycles. The second 298 stage involved use of a low value of learning ratio (between 0.1. and 0.01) together with a limited neighbourhood (equal to 0) over 10000 epochs. The generated Kohonen topology map (10×10) had a quadratic structure consisting of 100 nodes (Fig. 4). Fig. 4. Generated topology Kohonen map The quality of neural model for the purpose of classification issues is typically fixed for the test subset. The quality for the classification networks is contractually fixed through the percentage of consistent classifications. The selected network achieved a quality level of 0.899833. In this context the generated network should be qualified as appropriate. Commonly recognized measure of the qualitative estimation of the ANN is an error value RMS (Root Mean Squared) generated by the network model during operation on a file not used in the learning process of the network (e.g., the testing file). This measure is defined as a total error made by the network on a data file (training, testing and validation data). It is derived from the formula: n 2 ∑(y − z ) i =1 i i (7) RMS = n (7) where: n - number of cases, yi - real values, zi - values determined with the use of the network. The RMS error was respectively: − 0.139 for the training file, − 0.122 for the validation file, − 0.123 for the testing file. The obtained approximate and small value of the RMS error implies appropriate classification properties of the generated neural model. The standard classification statistics for the testing file are given in table 2. 299 Table 2. Classification statistics [1] [2] [3] [4] [5] Total 520 520 520 520 520 Correct 500 508 509 504 490 Incorrect 20 12 11 16 19 Unknown 0 0 0 0 11 4 Conclusions The following conclusions can be derived from the completed empirical studies, computer simulations of LVQ neural networks and analysis of the results: 1. The results acquired confirm the hypothesis that artificial neural networks type SOFM using LVQ algorithm and image analysis techniques are efficient tools assisting in the quick and reliable identification of pests feeding on apple tree orchards. 2. The best classification properties were found in the SOFM network model, whose RMS error for the training file was 0.139, for the validating file: 0.122, and for the test file: 0.123. 3. The non-parametric classification technique performed by the LVQ method turned out to be well-suited for the quality-based identification of apple pests with the use of the graphic information encoded in digital photographs. 4. The study conducted indicates that the designed model is a useful instrument that efficiently assists in the decision-making processes occurring during apple production. References 1. Boniecki P., Dach J., Pilarski K., Piekarska-Boniecka H., 2012a. Artificial neural networks for modeling ammonia emissions released from sewage sludge composting. Atmospheric Environment 57, 49-54 2. Boniecki P., Nowakowski K., Slosarz P., Dach J., Pilarski K., 2012b. Neural Image Analysis for Estimating Aerobic and Anaerobic Decomposition of Organic Matter Based on The Example of Straw Decomposition. 4th International Conference on Digital Image, Kuala Lumpur, APR 07-08, proceedings of SPIE, Vol: 8334, 83342B DOI: 10.1117/12.954165 300 3. Boniecki P., Nowakowski K., Tomczak R., Kujawa S., Piekarska-Boniecka H., 2012c. The application of the Kohonen neural network in the non-parametric quality-based classification of tomatoes. 4th International Conference on Digital Image, Kuala Lumpur, APR 07-08, proceedings of SPIE, Vol: 8334, 833427, DOI: 10.1117/12.954158 4. Boniecki P., Dach J., Nowakowski K., Jakubek A., 2009. Neural image analysis of maturity stage during composting of sewage sludge. International Conference on Digital Image Processing, Bangkok, MAR 07-09, proceedings p. 200-203, DOI: 10.1109/ICDIP.2009.85 5. Bouharati S., Benmahammed K., Harzallah D. and El-Asaf Y.M., 2008. Application of artificial neural neuro-fuzzy logic ınference system for predicting the microbiological pollution in fresh water. J Appl Sci 8: 309- 315 6. Bos A., Bos M., and Linden W.E., 1992. Artificial Neural networks as a tool for soft-modelling in quantitative analytical chemistry-the prediction of the water content of cheese. Anal Chim Acta 256: 133-144 7. Cabrera A.C. and Prieto J.M., 2010. Application of artificial neural networks to the prediction of the antioxidant activity of essential oils in two experimental in vitro models. Food Chem 118:141-146 8. Cerbin S., Nowakowski K., Dach J., Pilarski K., Boniecki P., Przybyl J., Lewicki A., 2012. Possibilities of neural image analysis implementation in monitoring of microalgae production as a substrate for biogas plant. 4th International Conference on Digital Image Processing (ICDIP 2012), April 7-8, 2012, Kuala Lumpur, Proceedings of SPIE, Vol. 8334, Article Number: 83342A, DOI: 10.1117/12.954164 9. Hagan M.T. and Menhaj M.B., 2004. Learning feed forward networks with the Marquaradt algorithm. IEEE Trans Neural Net 6:861-867 10. Jeyamkondan S., Jayas D.S. and Holley R.A., 2001. Microbial growth modelling with artificial neural networks. Int J Food Microbiol 64: 343–354 11. Jaastad G., Trandemb N., Hovland B., Mogan S., 2009. Effect of botanically derived pesticides on mirid pests and beneficials in apple. Crop Protection 28: 309-313 12. Karaman S.,Ozturk I., Yalcin H., Ahmed K. and Sagdic O., 2012. Comparison of adaptive neuro-fuzzy inference system and artificial neural networks for estimation of oxidation parameters of sunflower oil added with some natural byproduct extracts. J Sci Food Agric 92 (1): 49-58 13. Kavdir I. and Guyer D.E., 2003. Apple grading using fuzzy logic. Turk J Agric Forest 27: 375-382 14. Kisi O., 2007. Streamflow forecasting using different artificial neural network algorithms. ASCE J Hydrol Eng 12: 532–539 15. Kierczyńska S., 2005.Consumption of fruit against the background of their production in Poland. Annals of the Association of Agricultural Economists and Agribusiness VII, 8, 108-113 301 16. Kirsten S.P., Rufus I., John C.W., and Larry J.G., 2005. Protection of Fruit against Infestation by Apple Maggot and Blueberry. J. Econ. Entomol. 98 (2): 432-437 17. Kujawa S., Tomczak R. J., Kluza T., Weres J., Boniecki P., 2012. A stand for the image acquisition of composted material based on the sewage sludge. 4th International Conference on Digital Image, Kuala Lumpur, APR 07-08, proceedings of SPIE, Vol: 8334, 83341R, DOI: 10.1117/12.949899 18. Legnika M., Pintarb C., Lobnikc A., Kolard M., 2005. Comparison of the effectiveness of standard and drift-reducing nozzles for the control of some apple pests. Crop Protection 24: 93-100 19. Miñarro M., Jacas J.A., 2011. Pest status of leafminers in cider-apples: The case of orchards in Asturias (NW Spain). Crop Protection 30: 1485-1491 20. Nowakowski K., Boniecki, P., Tomczak R. J., Kujawa S., Raba B., 2012. Identification of malting barley varieties using computer image analysis and artificial neural networks. 4th International Conference on Digital Image Processing (ICDIP), Kuala Lumpur, APR 07-08, proceedings of SPIE, Vol: 8334, 833425, DOI: 10.1117/12.954155 21. Nowakowski K., Raba B., Tomczak R.J., Boniecki P., Kujawa S., Nowak P.J., Matz R., 2013. Identification of Physical Parameters of Cereal Grain using Computer image Analysis and Neural Models. 5th International Conference on Digital Image Processing (ICDIP 2013), April 21-22, 2013, Beijing, Proceedings of SPIE, Vol. 8878, Article Number: 887823, DOI: 10.1117/12.2030769 22. Nowakowski K., Boniecki P., Dach J., 2009. The Identification Of Mechanical Damages Of Kernels Basis On Neural Image Analysis. International Conference on Digital Image Processing, Bangkok, MAR 07-09, proceedings p. 412-415, DOI: 10.1109/ICDIP.2009.78 23. Piekarska-Boniecka H., Kadiubowski W., Siatkowski I., 2008. Study of bionomy of the privet sawfly (Macrophya punctumalbum (L.)) (Hymenoptera, Tenthredinidae) - a pest of park plants. Acta Scientiarum Polonorum-Hortorum Cultus 7(1): 3-11 24. Wilkaniec B., 2006. Applied entomology. WAR, Poznan 25. Yalcin H., Ozturk I., Karaman S., Kisi O., Sagdic O. and Kayacier A. 2011. Prediction of the effect of natural antioxidant compounds on hazelnut oil oxidation by an adaptive neuro-fuzzy inference system and artificial neural network. J Food Sci 76(4): 112-120 26. Slosarz P., Stanisz M., Boniecki P., Przybylak A., Lisiak D., Ludwiczak A., 2011. Artificial neural network analysis of ultrasound imagefor the estimation of intramuscular fat content in lamb muscle. African Journal of Biotechnology. Vol. 10(55), 11792-11796 27. Yin Y. and Ding Y. 2009. A close to real-time prediction method of total coliform bacteria in foods based on image identification technology and artificial neural network. Food Res Int 42: 191–199 28. Zaborowicz M., Przybył. J., Koszela K., Boniecki P., Mueller W., Raba B., Lewicki A. and Przybył K., 2014. Computer Image Analysis in Obtaining 302 Characteristics of Images Greenhouse Tomatoes in the Process of Generating Learning Sets of Artificial Neural Networks6th International Conference on Digital Image Processing (ICDIP 2014), Proceedings of SPIE, Vol. 9159, Article Number: 91590D, DOI: 10.1117/12.2064066 303