CETvol87 DOI: 10.3303/CET2187037 Paper Received: 5 November 2020; Revised: 28 February 2021; Accepted: 22 April 2021 Please cite this article as: Romaniello R., Perone C., Tamborrino A., Berardi A., Leone A., Di Taranto A., Iammarino M., 2021, Additives Individuation in Raw Ham Using Image Analysis, Chemical Engineering Transactions, 87, 217-222 DOI:10.3303/CET2187037 CHEMICAL ENGINEERING TRANSACTIONS VOL. 87, 2021 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Laura Piazza, Mauro Moresi, Francesco Donsì Copyright © 2021, AIDIC Servizi S.r.l. ISBN 978-88-95608-85-3; ISSN 2283-9216 Additives Individuation in Raw Ham Using Image Analysis Roberto Romanielloa,*, Claudio Peronea, Antonia Tamborrinob, Antonio Berardia, Alessandro Leoneb, Aurelia Di Tarantoc, Marco Iammarinoc. aDipartimento di Science Agrarie, Alimenti, Risorse Naturali e Ingegneria (DAFNE), Università degli Studi di Foggia, via Napoli, 25 – 71122 Foggia – Italy bDipartimento di Scienze Agro Ambientali e Territoriali (DiSAAT), Università degli Studi di Bari Aldo Moro, via Amendola 165/a, 70126 Bari, Italy cIstituto Zooprofilattico Sperimentale della Puglia e della Basilicata, Via Manfredonia, 20, 71121 Foggia, Italy roberto.romaniello@unifg.it The quality of raw ham is linked to the loss of essential properties such as color, which must be red and stable. In fact, the intensity of the red color of cured ham is susceptible to a progressive variation over time, which requires the producer to search for technologies to ensure maximum stability of the factors responsible for the red color of raw ham. Nitrites (potassium E249 and sodium E250) and nitrates (sodium E251 and potassium E252) are added during the production phase of raw hams mainly as preservatives. Nitrates may also be naturally present in small quantities in meat products. The aim of this work was to develop a rapid method, based on image analysis techniques, to detect the presence of nitrate and nitrites in raw hams by inspecting the surface of a slide. A number of 160 slices of raw hams of different producers have been acquired by an RGB system composed by a camera and a square array illumination system (color temperature of 6500K) in a black box. An algorithm to read the chromatic coordinates in L*a*b* in CIELAB color space was developed in MATLAB® environment. A numerical classifier capable to discriminate raw ham samples prepared with the use of food additives and without. Chemical determinations of nitrates and nitrites have been carried out to train the numerical classifier. A 5-fold cross validation statistic method has been used to validate the numerical classifier. The image analysis system was able to detect efficiently the chromatic pattern of the raw ham slices. The numeric classifier reached the 100% of correct classification (validation set) of raw hams containing additives. The percentage of correct classification of raw hams without additives was 95.0% (validation set), whit a percentage of false positives of 5%. The overall correct classification was 97.5% of detection. Thus, the developed technique could be used instead of the analytic technique because rapid and easy to use. Furthermore, it should be noted that the analytical determinations carried out on all samples showed that additives were present in traces or in a limited quantity, and this result reinforce the capability of the image analysis procedure developed. 1. Introduction In the raw ham industry, it is a consolidated practice the use of some food additives, such as sodium and potassium nitrites and nitrates, to obtain a product with a better appearance and more resistant to the maintenance of the organoleptic and nutritional characteristics during the commercial life (Bedale et al., 2016; Kanner, 1994, Civelli et al., 2015). The factors that affect the quality of raw ham concern the loss of essential properties such as color, which must be red and stable. In fact, the intensity of the red color of raw ham is susceptible to a progressive variation over time, which requires the producer to search for technologies to ensure maximum stability of the factors responsible for the red color of raw ham (Parolari et al., 2009a). Nitrites (potassium E249 and sodium E250) and nitrates (sodium E251 and potassium E252), substances naturally present in small quantities of meat products (Hsu et al., 2009; Iacumin et al., 2019), are added during the production phase of raw hams mainly as preservatives, for the different and now known functions, such as guaranteeing an intense and stable red color when cutting meat, avoiding rancidity of the fatty component, carrying out antimicrobial and antiseptic activity against altering and potentially pathogenic bacteria for 217 humans, such as Escherichia coli and Salmonella spp., and also against spore-forming microorganisms such as Clostridium botulinum and C. perfringens. Finally, these additives favor the development of the aroma by acting selectively against the microorganisms that determine the seasoning of cured meats (Rimoldi, 2008). However, the toxicity of the aforementioned additives is also known, in fact the nitrites in an acidic environment, such as in the stomach, are transformed into nitrous acid, which by binding to the amines gives rise to nitrosamines, compounds proven to be carcinogenic (Archer, 1989; Iammarino et al., 2020; Parvizishad et al., 2017; Pizza et al., 2008). Furthermore, nitrites bind to hemoglobin and oxidize it to methemoglobin, thus reducing the transport of oxygen to the tissues (Fan & Steinberg, 1996; Matteucci et al., 2008; McKnight et al., 1999). The control of the nitrites and nitrates present in raw ham is normally carried out by the experimental Zooprophylactic Institutes on samples that are taken by the local Health Authorities in the manufacturing companies or directly in the points of sale (Iammarino et al., 2013). The above checks, which often concern a large number of samples, are usually carried out by high performance liquid chromatography (HPLC) (D’Amore et al., 2019; International Organization for Standardization, 2005) and therefore involve long and laborious procedures for technicians working in this sector. In meat products, the pigment most responsible for the red color is myoglobin, which is a low molecular weight globular protein. In raw hams prepared with the use of the aforementioned additives, the formation of the red color is due to a series of reactions involving myoglobin and the nitrite present and giving rise to the nitrous-myoglobin compound, which is bright red in color. Furthermore, the red color of raw ham varies during the course of maturing. In fact, both for hams prepared with the use of nitrites and nitrates, and for hams prepared without the use of such additives, the intensity of the red color increases during maturing, but following different trends (Parolari et al., 2009b). Parolari et al., (2009a) reports that raw hams prepared with and without food additives have, for the same seasoning, different chromatic characteristics, and therefore have different chromatic patterns in the chromatic coordinate plane (a*, b*) of the CIELAB color space. Therefore, raw hams prepared with and without food additives, such as nitrites and / or nitrates, could potentially be discriminated, with the same seasoning, on the basis of an accurate quantification of their chromatic patterns in the chromatic coordinate plane (a*, b*) of the CIELAB color space (Romaniello et al., 2015). This work aims to develop a methodology, based on image analysis, for the discrimination of raw hams prepared using nitrites and / or nitrates from those prepared without using such additives. 2. Material and methods 2.1. Samples The experiments were conducted considering 160 slices of raw hams from different production areas and purchased in different sales outlets located in Foggia (Puglia – Italy) and Modena (Emilia, Italy). In particular, 20 slices with a thickness of 10 mm of each of the following raw hams were purchased: Cremona, Deli Emilia, Faeto, Parma, Castelluccio, San Daniele DOP, Norcia IGP and Parma DOP; these hams, all aged for 16 months, are hereinafter referred to with the letters A, B, C, D, E, F, G and H respectively. The 16-month maturation was chosen as with this stage of maturation it was possible to find in the sales points, as reported on the labels, both raw hams prepared with the use of potassium nitrate (those named with the letters B and C), and with the use of potassium nitrite (the one named with the letter B), and raw hams prepared without the use of additives (those named with the letters F, G and H). In addition, some hams were taken into consideration even if the labels did not contain any information on the use of additives in the production phase (those named with the letters D and E). For each of the hams taken into consideration, the 20 samples were taken from the central section of the whole product so that in all the samples the main muscles of the ham were present (figure 1), i.e., the Semimembranosus (1), the Biceps femoris (2), the Semitendinosus (3) and the Rectus femoris (4). Figure 1. Main muscles of row ham slices. 218 The aforementioned 160 ham samples were preliminarily divided into two disjoint sets of equal size. One of these sets, called "set of training samples", was used for the development of the numerical classifier, while the other set, called "set of validation samples", was used for the validation of the aforementioned numerical classifier. Of all the aforementioned ham samples, the nitrite and nitrate contents were determined by HPLC in order to verify what is reported on the labels of hams A, B, C, F, G and H, and any additives used in the production of D and E. 2.2. Digital images acquisition The RGB images of the 160 ham samples were acquired by an acquisition system consisting of three main components: a lighting source, a color digital camera and software for image acquisition. The light source and the digital color camera are arranged inside a dark room having the internal surface of opaque black in order to exclude the entry of external light and to minimize the reflection of light from the walls. The light source is composed of four linear fluorescent lamps with a power of 15 W (Neon OSRAM TLD65-15W, Germany) with a color temperature of 6500 K; the lamps are arranged in a quadrilateral pattern (figure 16) and placed at a distance of 0.68 m from the base of the darkroom. To ensure as uniform lighting as possible, the four lamps are connected to electronic control units and are covered with transparent plastic light diffusers. The color digital camera is a Canon EOS 400D (Canon, USA) with the lens positioned 0.45m from the base of the darkroom. This camera is connected to the USB port of a PC (Asus, Taiwan) and a specific software (Remote Capture Software, version 2.7.2, Canon, USA) allows the visualization, sending to the PC and storage on a magnetic support of the scanned images. The aperture values (f/6.3) of the camera lens and the exposure time (1/4 s) were kept constant during the image acquisition sessions. Before acquiring the images of the ham samples, an image of a standard white reference (X-rite ColourChecher® White balance Card, USA) and a black reference image were acquired to set the white balance of the digital camera; this last image was obtained by occluding the lens of the digital camera. The images of the ham samples were acquired on a blue background, with a color depth of 24 bits and with a spatial resolution of 3888 × 2592 pixels, which corresponds to a rectangular field of vision and an area of 699,84 cm2 (32.4 × 21.6 cm). 2.3. Quantification of the color patterns of the samples The RGB images were processed using an algorithm coded with the image processing toolbox of MATLAB, through the following steps: 1) pixel intensity correction of acquired RGB images in order to minimize the effect of the imperfect uniformity of lighting in the scene, using the previously acquired RGB images of the references white and black (Westland et al. 2004); 2) Color-space conversion from RGB to CIELAB by means of a colorimetric transformation, i.e. a numeric map between the non-colorimetric RGB values (Valous et al., 2009) and the corresponding L *, a * and b * colorimetric values. This colorimetric transformation is obtained by encoding in a MATLAB program the methodology reported in the work of Peri et al. (2010) who for this purpose uses three LS-SVM regressions (Least Squares - Support Vector Machine); 3) primary segmentation of the L*, a* and b* component images (first, second and third component images respectively), in order to separate the region of interest, i.e. the ham sample, from the acquisition background and the secondary segmentation to identify the sub-region corresponding to the muscle present in the region of interest; 4) determination of the color pattern (a*, b*) of the ham sample by calculating the average pixel intensity of the sub-region corresponding to the second and third images components of the muscle. 2.4 Developing and validation of the numerical classifier A numerical classifier is an algorithm that assigns a pattern (or set of descriptors) to a class of patterns that have similar characteristics (Sun, 2008). The development of a numerical classifier consists in the choice of the type of classifier and in a training phase of the same classifier. In this paper we have chosen a Nearest Neighbor classifier with class prototypes, as this type of classifier is notoriously very effective and is also easy to implement in MATLAB. Being a chromatic pattern consisting of two descriptors (the mean value of the chromatic coordinate a* and the mean value of the chromatic coordinate b* of the sub-region of the image corresponding to the muscle of the sample), this is represented by a point in the plane of the descriptors (a*, b*). Furthermore, since there are two possible classes of color patterns (that relating to samples of hams prepared with additives and that relating to hams prepared without additives), these are separated with a single border which in the case of the Nearest Neighbor classifier is linear, i.e., it is a line in the plane of descriptors. The Nearest Neighbor classifier with class prototypes is a supervised numerical classifier. This means that the classifier learns the rule for classifying a color pattern of a ham sample from a set of examples, that is, from a set of color patterns of samples already classified as "of hams prepared with additives" or "of hams preparations without additives". This supervision of the classifier takes place in a phase of its development called training and consists in the determination of the prototypes, i.e., the geometric centers, of the two classes of chromatic patterns. After the training phase, the chromatic pattern of a ham sample is 219 assigned to the class of chromatic patterns closest to it, i.e., the one whose prototype has the shortest Euclidean distance from the chromatic pattern in question. For the training of the Nearest Neighbor classifier with class prototypes, the chromatic patterns of the "set of training samples" were used and after the identification in the plan of the prototype descriptors of the two chromatic pattern classes, all the chromatic patterns of the aforementioned set of samples were classified according to the above rule (minimum distance pattern-prototypes of the classes) and the percentage of correct classification was calculated. In order to verify the generalization capacity of the numerical classifier, i.e., its ability to correctly classify color patterns not used in the training phase, the color patterns of the "set of validation samples" were classified with the developed numerical classifier and according to the aforementioned rule (minimum distance pattern-prototype of the class). The generalization capacity of the numerical classifier was quantified by calculating the percentage of correct classification of the color patterns of the two classes of color patterns (that relating to samples of hams prepared with additives and that relating to hams prepared without additives) and by calculating false positives (Fp) and false negatives (Fn) defined by: = ; = where na represents the number of color patterns erroneously classified as "color patterns of samples of hams prepared with additives" and nw represents the number of color patterns incorrectly classified as "color patterns of samples of hams prepared without additives". Also, ntot represents the total number of color patterns used for validation of the numerical classifier. 2.5 Analytical determination of nitrites and nitrates on raw ham slices The analytical determination of the nitrites and nitrates present in the raw ham samples was carried out after the digital image acquisition phase. Samples were stored in a refrigerator at the temperature of -18 °C, until the time of chemical analyzes. A high-performance ion exchange liquid chromatography system was used to identify and quantify the nitrites and nitrates present in the raw ham samples. Sample preparation has been made as explained by (Iammarino et al., 2013). The identification and quantification of nitrates and nitrites in the ham samples were carried out by means of a chromatographic system of the Dionex Corporation (California, USA) model DX 500, equipped with an ion exchange column of the Dionex IonPac AS9 HC (4 x 250 mm) type, Dionex AG9-HC type pre-column (4 x 50 mm), conductivity electrochemical detector model Dionex ED40, and ASRS-ULTRA suppressor (4 mm set to 50 mA). The elution of the analytes was obtained by isocratic flow (1mL / min) of 9 mM sodium carbonate. 3. Results and discussion Concerning the chemical analyses, the samples of hams D, E, F, G and H revealed the presence in traces of nitrates, as the doses of nitrates present in these samples were lower than the LOQ (limit of quantification) and, in cases where the doses exceeded this limit, they were however attributable to doses of nitrates naturally present in the meat product. These results confirm what is reported on the labels of hams F, G and H and indicate that hams D and E were also prepared without the use of nitrates. Samples of hams A, B and C, on the other hand, revealed nitrate doses higher than 40 ppm; therefore, these hams were prepared with the use of nitrates, as correctly reported on the labels. The results of the training of the Nearest Neighbor classifier with class prototypes are summarized in Figure 2. Figure 2. Results of Nearest Neighbour classifier with class prototypes and separation boundary line. 220 In this figure, the color patterns of the samples of hams prepared with additives are indicated by red dots, those of the samples of hams prepared without additives are indicated, instead, by points in green color. The same figure shows the prototypes of the two classes of chromatic patterns (or geometric centers), their joining and the separation boundary which in the case of a Nearest Neighbor classifier with class prototypes is linear and is the straight line orthogonal to the joining the prototypes of the classes and passing through its midpoint. Also, in the same figure are indicated with blue points the chromatic patterns wrongly classified in the training phase. It should be noted that the incorrectly classified color patterns are false positives, i.e. color patterns "of samples of hams prepared without additives" but assigned to the class of color patterns "of samples of hams prepared with additives". On the basis of these results, the numerical classifier in the training phase permitted to separate the samples containing nitrates with a correct classification percentage of 95.63%. As mentioned in Table 1, the numerical classifier matched 100% the samples containing additives; the only errors (8.75%) were represented by false positives. Subsequently, the numerical classifier was used to forecast the two class (with additives and without additives) using unknown data and applying the 5-fold cross validation. Table 1. Percentage of correct classification for training phase of Nearest-neighbour classifier. The analysis of Table 2 shows that the samples of hams prepared with additives have been classified with a correct classification value equal to 100%; while the samples of hams prepared without additives were classified with a correct classification value of 95.00%. In particular, the percentage of false positives was 5.00%, corresponding to 4 samples erroneously classified as "hams prepared with additives", out of the total of 80 samples used in the validation phase. On the other hand, no false negatives were detected, ie samples incorrectly classified as “hams prepared without additives”. Finally, the total percentage of correct classification obtained by the classifier developed in the validation phase was 97.50%. Table 2. Percentage of correct classification for validation phase of Nearest-neighbour numerical classifier. 4. Conclusions In the raw ham industry, it is a consolidated practice to use some food additives, such as sodium and / or potassium nitrites and nitrates, in the production phase, in order to obtain a product with a better appearance and more resistant to maintenance of the organoleptic and nutritional characteristics during the commercial life. However, the toxicity of the aforementioned additives is also known, which therefore can be added in the production phase in the maximum quantity of 150 mg/kg of product for both nitrites and nitrates, as defined by current regulations. The control of nitrites and nitrates present in raw ham is normally carried out by experimental Zooprophylactic Institutes, often on a large number of samples with long and laborious procedures. Therefore, it would be very useful to have a methodology for analyzing raw ham samples capable of quickly discriminating the ham samples prepared without additives from those prepared with additives, thus allowing traditional analytical measurements to be carried out only on the latter. This work was aimed at developing a methodology, based on image analysis, for the discrimination of raw hams prepared with the use of nitrites and / or nitrates from those prepared without the use of such additives. The analysis of the chromatic characteristics of the raw ham samples taken into consideration in this paper shows that 1) the average values of the color coordinates a* and b* of the samples of hams prepared with additives which are statistically significantly lower than the corresponding values of the samples of hams prepared without additives; Raw ham samples Classified as containing additives Classified as without additives % of correct classification Samples containing additives 100.00% 0.00% 100.00% Samples without additives 8.75% 91.25% 91.25% Total percentage of correct classification 95.63% Raw ham samples Classified as containing additives Classified as without additives % of correct classification Samples containing additives 100.00% 0.00% 100.00% Samples without additives 5.00% 95.00% 95.00% Total percentage of correct classification 97.50% 221 2) the color of the samples of hams prepared with additives is statistically significantly less saturated than the color of the ham samples prepared without additives; The Nearest Neighbor classifier with class prototypes is able to classify color patterns of hams samples (not used in the training phase) with a correct classification percentage of 97.50%, with a false positives percentage of 5% and false negative rate of 0%. This latter result is of particular importance as it indicates that the classifier does not erroneously classify any color pattern "of samples of hams prepared with additives" as a color pattern "of samples of hams prepared without additives". Finally, the developed methodology could be used for an accurate study of the evolution of the color characteristics of hams prepared with and without the use of additives during the aging. Furthermore, it should be noted that the analytical determinations carried out on all the samples of the hams taken into consideration showed that nitrites were present only in traces or in a limited quantity, and this result is of considerable importance for the purposes of food safety. References Archer, M.C., 1989, Mechanisms of action of N-nitroso compounds, Cancer Surveys, 8, 241-250. Bedale, W., Sindelar, J.J., Milkowski, A.L., 2016, Dietary nitrate and nitrite: Benefits, risks, and evolving perceptions, Meat Science, 120, 85-92. Civelli, R., Amigo, J., Giovenzana, V., Beghi, R., Guidetti, R., 2015, Daily freshness decay of minimally processed apples using vis/nir multispectral imaging: preliminary Tests, Chemical engineering transactions, 44, 169-174. D’Amore, T., Di Taranto, A., Berardi, G., Vita, V., Iammarino, M., 2019, Development and validation of an analytical method for nitrite and nitrate determination in meat products by capillary ion chromatography (CIC), Food Analytical Methods, 12, 1813-1822. Fan, A. M., Steinberg, V.E., 1996, Health implications of nitrate and nitrite in drinking water: An update on methemoglobinemia occurrence and reproductive and developmental toxicity, Regulatory Toxicology and Pharmacology, 23, 35-43. Hsu, J., Jayashree, A., Lee, N. A., 2009, Nitrate and nitrite quantification from cured meat and vegetables and their estimated dietary intake in Australians, Food Chemistry, 115, 334-339. Iacumin, L., Cattaneo, P., Zuccolo, C., Galanetto, S., Acquafredda, A., Comi, G., 2019, Natural levels of nitrites and nitrates in San Daniele dry cured ham PDO, and in meat, salt and sugna used for its production, Food Control 100, 257-261. Iammarino, M., Di Taranto, A., 2013, Evaluation of natural levels of substances commonly-used as food additives in fresh meat preparations, Chapter In: MP Ortega, R Soto (Eds.), Meat consumption and health, Nova Science Publishers, Hauppauge, NY, USA, 153-170. Iammarino, M., Mangiacotti, M., Chiaravalle, A.E., 2020, Anion exchange polymeric sorbent coupled to high‐ performance liquid chromatography with UV diode array detection for the determination of ten N‐ nitrosamines in meat products: a validated approach, International Journal of Food Science & Technology, 55(3), 1097-1109. International Organization for Standardization – ISO, 2005), EN 12014-4:2005, Foodstuffs - Determination of nitrate and/or nitrite content - Part 4: Ion-exchange chromatographic (IC) method for the determination of nitrate and nitrite content of meat products, ISO, Geneva, Switzerland. Kanner, J., 1994, Oxidative processes in meat and meat products: quality implication, Meat Science, 36, 673- 676. Klemeš J.J. (Ed), 2013, Handbook of Process Integration (PI): Minimisation of Energy and Water Use, Waste and Emissions, Woodhead Publishing Limited, Cambridge, UK. Matteucci, O., Diletti, G., Principe, V., Di Giannatale, E., Marconi, M.M., Migliorati, G., 2008, Due casi di metaemoglobinemia acuta da sospetto avvelenamento da sodio nitrito, Veterinaria Italiana, 44(2), 439- 445. McKnight, G.M., Duncan, C.W., Leifert, C., & Golden, M.H., 1999, Dietary nitrate in man: Friend or foe? British Journal of Nutrition, 81(5), 349-358. Parvizishad, M., Dalvand, A., Mahvi, A.H., Goodarzi, F., 2017, A review of adverse effects and benefits of nitrate and nitrite in drinking water and food on human health. Health Scope, e14164. Romaniello, R., Leone, A., & Peri, G., 2015, Measurement of food colour in L* a* b* units from RGB digital image using least squares support vector machine regression, Journal of Agricultural Engineering, 46(4), 138-143. Sun D.W. (Ed), 2016, Computer vision technology for food quality evaluation, Academic Press, Cambridge, Massachusetts, USA. 222