Acessibilidade / Reportar erro

‘Ataulfo’ mango maturity index prediction using the AS7262 spectral sensor

Predição do índice de maturidade da manga cultivar ‘Ataulfo’ usando o sensor espectral AS7262

Abstract

‘Ataulfo’ mango is highly produced in Mexico, being harvested when it reaches its physiological maturity. This process takes at least another month for the fruit to reach consumption maturity. Warehouses and markets present important losses as the ready-to-eat status is unknown. Maturity status is determined by measuring slow and destructive physicochemical variables. An optical device based on the AS7262 spectral sensor was connected to the ESP32 microcontroller and measurements were correlated with soluble solids content (SSC), dry matter (DM) and firmness of mangoes obtained from the local market. Data analysis was carried out by partial least squares (PLS) regression, classification, regression tree (CART) and random forest (RF) models. With PLS, SST and firmness were predicted with R2 of 0.61 and 0.76, respectively. The root mean squared error of prediction (RMSEP) was 0.91 for SSC and 0.67 for firmness. With the CART model, classification accuracy was 90% for SSC and 87% for firmness of intact mango fruits.

Index terms
Fruit ripeness; spectral analysis; CART model; nondestructive testing

Resumo

A manga cultivar ‘Ataulfo’ é altamente produzida no México e é colhida quando atinge maturidade fisiológica. Este processo leva pelo menos mais um mês para o fruto atingir maturidade de consumo. Armazéns e mercados apresentam perdas importantes porque o status “pronta para consumo” é desconhecido. O status de maturidade é determinado pela medição de variáveis físico-químicas lentas e destrutivas. Um dispositivo óptico baseado no sensor espectral AS7262 foi conectado ao microcontrolador ESP32, e suas medidas foram correlacionadas com o teor de sólidos solúveis (TSS), matéria seca (MS) e firmeza de mangas obtidas no mercado local. Análise dos dados foi realizada por meio de modelos de regressão por mínimos quadrados parciais (PLS), árvore de classificação e regressão (CART) efloresta aleatória (RF). Com o modelo PLS, TSS e firmeza, foram previstos R2 de 0,61 e 0,76, respectivamente. A raiz do erro quadrático médio de predição (RMSEP) foi de 0,91 para TSS e 0,67para firmeza. Com o modelo CART, a precisão da classificação foi de 90% para TSS e 87% para firmeza de frutos intactos.

Termos para indexação
peeled fruits; Maturação de frutos; análise espectral; modelo CART; testes não destrutivos; frutos sem pele

Introduction

Mango (Mangifera indica L.) is the third most important tropical fruit worldwide, with Mexico being the fourth producer and the main exporting country. The fruit demand is increasing and an accumulated growth of 25.66% is estimated for the year 2030 (PALOMEQUE et al., 2023 PALOMEQUE, B.E.; GUERRERO, D.A.R.; GUTIE´RREZ, M.R.C.; ÁLVAREZ, T.E.C. El cultivo de mango y su interacción en la producción, comercialización y el turismo de negocios en Escuinapa, Sinaloa. Revista Sinaloense de Ciencia, Tecnología y Humanidades, Sin, v.1, n.1, 2023. ). ‘Ataulfo’ mango is native to Chiapas, Mexico, and has become commercially exploited in the national and international markets due to its organoleptic properties. These properties include sweet flavor, fleshy pulp, and excellent aroma (MENDOZA-HERNÁNDEZ et al., 2020 MENDOZA-HERNÁNDEZ, C.; ROSAS-QUIJANO, R.; VÁZQUEZ-OVANDO, A.; GÁLVEZ-LÓPEZ, D. Challenges and controversies of the Ataulfo mango. Revista Mexicana de Ciencias Agrícolas, Chapingo, v.11, n.7, 1633-45, 2020. https://doi.org/10.29312/remexca.v11i7.2199.
https://doi.org/10.29312/remexca.v11i7.2...
), which are dependent on harvest maturity.

Mangos accumulate carbohydrate reserves until they reach a level associated with physiological maturation. These reserves are converted into soluble sugars as the fruit reaches the appropriate maturity for consumption (SUBEDI;WALSH, 2011 SUBEDI, P.P.; WALSH, K.B. Assessment of sugar and starch in intact banana and mango fruit by SWNIR spectroscopy. Postharvest Biology and Technology, Amsterdam, v.62, n.3, p.238-45, 2011. https://doi.org/10.1016/j.postharvbio.2011.06.014. ). Therefore, mango harvested in immature state will not ripen normally, eventually becoming softer, and its flavor will not reach adequate levels (OSUNA-GARCÍA et al., 2021 OSUNA-GARCIA, J.A.; OLIVARES-FIGUEROA, J.D.; TOIVONEN, P.M.; PÉREZ- BARRAZA, M. H.; GOENAGA, R.; GRACIANO-CRISTÓBAL, M. J. Novel nondestructive technique to determine optimum harvesting stage of ‘Ataúlfo’ mango fruit. Journal of Advances in Agriculture, Amritsar, v.12, p.61-9, 2021. https://doi.org/10.24297/jaa.v12i.9069.
https://doi.org/10.24297/jaa.v12i.9069...
).

Producers harvest large amounts of immature fruits to achieve high prices at the beginning of the season. Indicators used to select fruits to be harvested are visual and subject to the farmer’s experience.

However, an instrument capable of determining fruit maturity status would improve fruit quality standards required by the market.

Spectroscopy techniques have proven to be the most accurate in estimating maturity indices in a non-destructive manner.

These techniques can predict dry matter content, soluble solids content, firmness, titratable acidity, color, and chlorophyll content (SHAH et al., 2020 SHAH, S.S.A.; ZEB, A.; QURESHI, W.S.; ARSLAN, M.; MALIK, A.U.; ALASMARY, W.; ALANAZI, E. Towards fruit maturity estimation using NIR spectroscopy. Infrared Physics and Technology, Exeter, v.111, p.103479, 2020. https://doi.org/10.1016/j.infrared.2020.103479.
https://doi.org/10.1016/j.infrared.2020....
).

Most studies assessing the quality parameters of fruits and vegetables by spectroscopy use visible-near infrared (Vis-NIR) wavelengths (ULYA et al., 2023), which cover the range of 380 to 2500 nm in the electromagnetic spectrum. This option is used when is since signals from nearly all significant structures and functional groups in organic compounds can be detected within this spectrum (WANG et al., 2015 WANG, H.; PENG, J.; XIE, C.; BAO, Y.; HE, Y. Fruit quality evaluation using spectroscopy technology: a review. Sensors, Basel, v.15, p.11889-927, 2015. https://doi.org/10.3390/s150511889
https://doi.org/10.3390/s150511889...
). However, it is crucial to highlight that the visible spectrum (Vis) has been explored by researchers such as Jha et al. (2007) JHA, S.N.; CHOPRA, S.; KINGSLY, A.R.P. Modeling of color values for nondestructive evaluation of maturity of mango. Journal of Food Engineering, New York, v.78, n.1, p.22-2, 2007. https://doi.org/10.1016/j.jfoodeng.2005.08.048.
https://doi.org/10.1016/j.jfoodeng.2005....
and Yahaya et al. (2015) YAHAYA, O.K.M.; JAFRI, M.Z.M.; AZIZ, A.A.; OMAR, A.F. Simplified optical fiber RGB system in evaluating intrinsic quality of Sala mango. Optical Engineering, Bellingham, v.54, n.6, p.067108, 2015. https://doi.org/10.1117/1.OE.54.6.067108.
https://doi.org/10.1117/1.OE.54.6.067108...
, who proposed the use of this cost-effective alternative. In this approach, predictions are inherently linked to the type of device and model used. Specifically, Jha et al. (2006) JHA, S.N.; CHOPRA, S.; KINGSLY, A.R.P. Modeling of color values for nondestructive evaluation of maturity of mango. Journal of Food Engineering, New York, v.78, n.1, p.22-2, 2007. https://doi.org/10.1016/j.jfoodeng.2005.08.048.
https://doi.org/10.1016/j.jfoodeng.2005....
used color values obtained with a handheld colorimeter to determine mango ripeness by using an SSC maturity index. Yahaya et al. (2015) YAHAYA, O.K.M.; JAFRI, M.Z.M.; AZIZ, A.A.; OMAR, A.F. Simplified optical fiber RGB system in evaluating intrinsic quality of Sala mango. Optical Engineering, Bellingham, v.54, n.6, p.067108, 2015. https://doi.org/10.1117/1.OE.54.6.067108.
https://doi.org/10.1117/1.OE.54.6.067108...
determined both mango SSC and firmness by using a system composed of red, green, and blue light-emitting diodes, along with a single visible light photodetector.

Currently, novel and compact spectral sensors can be integrated with microcontrollers, simplifying the development of cost-effective and versatile devices suitable for a broad range of applications. Among these applications, a reliable determination of fruit ripeness indices should be highlighted.

These economical and simple alternatives have limitations, such as their measurement range and precision (BOTERO -VALENCIA et al., 2021 BOTERO-VALENCIA, J.S.; VALENCIA-AGUIRRE, J.; DURMUS, D. A low-cost IoT multi-spectral acquisition device. HardwareX, London, v.9, p.e00173, 2021. https://doi.org/10.1016/j.ohx.2021.e00173
https://doi.org/10.1016/j.ohx.2021.e0017...
). However, these measurements can be compensated with the use of machine learning models. Therefore, the main objective of this study was the development and evaluation of an optical device based on the AS7262 spectral sensor, connected to an ESP32 microcontroller. This device was designed to perform rapid and non-destructive measurements aimed at determining crucial parameters such as dry matter (DM), soluble solids content (SSC), and firmness of ‘Ataulfo’ mangoes. This technology has the potential to enhance the quality of harvested mangoes, reduce losses in the supply chain, and improve production and distribution efficiency, benefiting both producers and consumers.

Material and methods

Equipment Design

The equipment based on ESP32 microcontroller (Espressif Systems, DEVKIT VI, China), communicates through the I2C protocol with an AS7262 sensor (SparkFun Electronics, Breakout AS7262, U.S.A.). This sensor is a six-wavelength detection device with 40 nm-bandwidths centered at 450 nm, 500 nm, 550 nm, 570 nm, 600 nm, and 650 nm.

As light source, the sensor module incorporates a white Light Emitting Diode (LED) with color temperature of 5700K and irradiance of 600 μW cm-2. The LED’s spectrum is characterized by a wide double-peak pattern, spanning from 430 nm to 730 nm (STAMFORD et al., 2023 STAMFORD, J.D.; STEVENS, J.; MULLINEAUX, P.M.; LAWSON, T. LED lighting: a grower’s guide to light spectra. HortScience, Alexandria, v.58, n.2, p.180-96, 2023. https://doi.org/10.21273/HORTSCI16823-22.
https://doi.org/10.21273/HORTSCI16823-22...
). A micro-SD flash memory reader module was integrated with the equipment to save data, together with 128x64 pixel Organic Light Emitting Diode (OLED) screen to display readouts. The equipment was designed to operate with a 2200 mAh lithium battery (Figure 1).

Figure 1
Components (a) used by the final prototype and (b) fitting inside the box showing the power switch (1), OLED screen (2), LED activation switch (3), buttons to perform the reading (4), to save data (5) and to restart the equipment (6).

Experimental design

In the local market of Texcoco, Mexico, 72 ‘Ataulfo’ mangoes were randomly acquired.

The color of fruits obtained from the local market was from green to yellow (Figure 2a), being an indicator of acceptable physiological maturity according to the NMX-FF- 058-SCFI (2006) standard. The mango color can be seen in fruits hanging on the tree where fruits are harvested (Figure 2b). Two circles were marked over the equatorial zone of both lateral sides of fruits to begin the sampling procedure. The peel area of one of the circles was removed before the equipment scanned fruit surface and pulp (Figure 3).

Figure 2
‘Ataulfo’ mango fruits (a) in the market and (b) hanging on the tree.

Figure 3
Measurements taken in areas previously marked on both intact and peeled fruits using the prototype and the AS7262 sensor.

In the first zone (region A) dry matter content was obtained, while in the second (region B) firmness and soluble solids contents were determined, averaging measurements from both sides. This procedure was adopted by Dos Santos et al., in 2017. Firmness (kg cm-2) was measured using analog penetrometer (LUZEREN®, GY-03, México) with 8 mm insertion tip. SSC content (°Brix) was obtained with portable refractometer (Sper Scientific Ltd., 300003, U.S.A.). Both procedures were performed following recommendations of the official Mexican standard (NMX-FF-058-SCFI, 2006 NMX-FF-058-SCFI. Non industrialized food products for human consumption – fresh fruit – mango (Mangifera indica L.) – specifications. 2006. Available from: http://www.economia-nmx.gob.mx/normas/nmx/2006/nmx-ff-058-scfi-2006.pdf
http://www.economia-nmx.gob.mx/normas/nm...
). Dry matter (%) was obtained after inserting 5g of pulp in a drying oven (RIOSSA®, H-41, Mexico) set at 65 °C, until reaching constant weight.

Data analysis

Data were analyzed using the R software version 4.2.0 (R CORE TEAM, 2023 R CORE TEAM. R: a language and environment for statistical computing. Vienna: R Foundation for Statistical Computing, 2023 [cited 2023 feb 10]. Available from: https://www.R-project.org/. RSTUDIO TEAM. RStudio: Integrated Development Environment for R. Boston: RStudio. Disponivel em: http://www.rstudio.com. Acesso em: 10 fev. 2023.
http://www.rstudio.com...
) and the RStudio integrated development environment.

Data were randomly partitioned into two sets: with the “sample_frac()” function, 70% of data was extracted to form the train ing set, and with the “setdiff()” function, the remaining 30% was obtained to evaluate the model. Maturity indices (DM, SSC, and firmness) were predicted using partial least squares (PLS) regression and cross-validation.

The performance of models was evaluated with the determination coefficient (R2) and the Root Mean Square Error (RMSE).

Classifications were conducted using classification and regression tree (CART) and random forest (RF) models, assessing each parameter individually. Regarding DM, fruits were classified into two categories: “Acceptable” for fruits with DM>16.9% and “Unacceptable” for those with DM≤16.9%.

This partition corresponds to the quality indices defined by González-Moscoso (2014) GONZALEZ-MOSCOSO, S. Proposing minimum quality indices and improving ripening protocol for mangos (Mangifera indica L.) imported to the United States for the improvement of consumer quality. 2014. Thesis (Master’s) - University of California, Davis, 2014. and Nassur et al., (2013) NASSUR, R.; CRISOSTO, G.; FREITAS, S.T. de; VILAS BOAS, E. D. B.; LIMA, L. D. O.; CRISOSTO, C. Dry matter as a quality index for brazilian mangoes. In: SIMPÓSIO BRASILEIRO DE PÓS-COLHEITA DE FRUTAS, HORTALIÇAS E FLORES, 4., 2013, Ribeirão Preto. Anais […]. . SSC was classified into three categories: “low” for values <16%, “medium” for values from 16 to 18% and “high” for values >18% (HAHN, 2002 HAHN, F. Hyperspectral mango ripeness detection. In: ASAE ANNUAL MEETING, 2002. Proceedings […]. Michigan: American Society of Agricultural and Biological Engineers, 2002. Disponível em: https://elibrary.asabe.org/abstract.asp?JID=5eAID=9629eCID=cil2002eT=1 ).

Firmness was classified into two categories, “Acceptable” for fruits with firmness less than 2.7 kg cm-2 and “Unacceptable” for fruits with firmness ≥ 2.7 kg cm-2. The value used as threshold for categories corresponds to the average firmness value between maturity stages 2 and 3 (12.4N and 14.8 N) proposed by Palafox-Carlos, et al., (2011) PALAFOX-CARLOS, H.; YAHIA, E.; ISLAS-OSUNA, M.A.; GUTIERREZ-MARTINEZ, P.; ROBLES-SÁNCHEZ, M.; GONZÁLEZ-AGUILAR, G.A. Effect of ripeness stage of mango fruit (Mangifera indica L., cv. Ataulfo) on physiological parameters and antioxidant activity. Scientia Horticulturae, New York, v.135, p.7-13, 2012. https://doi.org/10.1016/j.scienta.2011.11.027.
https://doi.org/10.1016/j.scienta.2011.1...
.

The performance of models was determined by their accuracy percentage and by the Kappa index, whose coefficient reflects the inter-observer agreement and is defined by equation 1. Kappa values, as defined by Landis and Koch (1997) LANDIS, J.R.; KOCH, G.G. The measurement of observer agreement for categorical data. Biometrics, Malden, v.33, n.1, p.159-74, 1997. https://doi.org/10.2307/2529310.
https://doi.org/10.2307/2529310...
, are within the range from 0 to 1, and are classified as follows: almost perfect (0.8–1.0), substantial (0.6–0.8), moderate (0.4–0.6), fair (0.2–0.4), slight (0–0.2), and poor(≤0).

1 Κ = P 0 - P e 1 - P e

Where: P0 is the observed agreement and Pe the expected agreement due to the random chance (ACHU et al., 2020 ACHU, A.L.; AJU, C.D.; REGHUNATH, R. Spatial modelling of shallow landslide susceptibility: a study from the southern Western Ghats region of Kerala, India. Annals of GIS, Oxfordshire, v.26, n.2, p.113-31, 2020. https://doi.org/10.1080/19475683.2020.1758207.
https://doi.org/10.1080/19475683.2020.17...
).

Results and discussion

RGB/AS7262 ratio

The three primary colors are standardized at wavelengths of 700 nm, 546.1 nm, and 435.8 nm for R, G, and B, respectively (MIHA et al., 2007 MIHA, D.; STRAJESCU, E. From wavelength to RGB filter. University Politehnica of Bucharest Scientific Bulletin, Series D, Buch, v.69, n.2, p.77-84, 2007. ). Wavelengths of the AS7262 sensor strongly related to RGB channels are: 650 nm for the R channel, 570nm, 550 nm and 500 nm for the G channel and 450 nm for the B channel, since in the correlation analysis carried out with 50 samples, these variables stand out with the highest values, with significance level α = 0.05 (Figure 4a).

Figure 4
AS7262 spectral variables (a) related to RGB values (b) measured and predicted from 27 samples with linear regression.

However, using the AS7262 sensor variables to determine 8-bit RGB values by linear regression (Figure 4b), R2 = 0.83 for R, R2 = 0.93 for G and R2 = 0.87 for B were obtained.

Fruit measurements

Data statistical results are presented in detail in Table 1. This table also includes means and standard deviations corresponding to training and test sets. Despite disparities observed among the means of these sets, it is imperative to highlight that the results obtained from the application of the Student’s t-test for the three variables yielded p ≥ 0.05, suggesting that there are no statistically significant differences between analyzed sets.

Table 1
Quality parameter statistical results including minimums, maximums, means, training set means, and evaluation set means, along with statistical significance assessed by the Student's t-test and its corresponding p-value.

Dry matter prediction

For dry matter, the best PLS model fit was obtained by using the six spectral variables.

However, poor predictions were observed, obtaining determination coefficients lower than 0.4 for both intact and peeled fruits, although RMSE values of 1.22 and 1.34 were obtained for calibration and evaluation, respectively, for intact fruits, while for peeled fruits, values were 1.26 for calibration and 1.54 for evaluation. The poor model performance can be attributed to the fact that the six sensor channels are from the visible spectrum. This is consistent with results obtained by dos Santos Neto et al. (2017) SANTOS NETO, J.P. dos; ASSIS, M.W.D. de; CASAGRANDE, I.P.; JÚNIOR, L.C.C.; ALMEIDA TEIXEIRA, G.H. de. Determination of ‘Palmer’mango maturity indices using portable near infrared (VIS-NIR) spectrometer. Postharvest Biology and Technology, Amsterdam, v.30, p.75-80, 2017. https://doi.org/10.1016/j.postharvbio.2017.03.009. , who used PLS model in the 699-981 nm range. They included the 960 nm band related to the molecular vibrations of water and therefore to pulp water content.

Soluble solids content prediction

The PLS model has proven to be a robust soluble solids content predictor (MUNAWAR et al., 2016 MUNAWAR, A.A.; VON HÖRSTEN, D.; WEGENER, J. K,; PAWELZIK, E.; MÖRLEIN, D. Rapid and non-destructive prediction of mango quality attributes using Fourier transform near infrared spectroscopy and chemometrics. Engineering in Agriculture, Environment and Food, Amsterdam, v.9, n.3, p.208-15, 2016. https://doi.org/10.1016/j.eaef.2015.12.004.
https://doi.org/10.1016/j.eaef.2015.12.0...
). Variable R500 (Reflectance at wavelength of 500 nm) was the one that presented the lower variation, which can be attributed to the predominance of a particular green color among sampled fruits. SSC prediction values given by equation 2 are shown in the scatterplot (Figure 5).

2 S S C = 9.33 + 4.83 R 450 R 500 - 7.95 R 500 - 2.25 R 550 R 500 + 3.06 R 570 R 500 - 2.06 R 600 R 500 + 1.71 R 650 R 500

Figure 5
Linear relationship between predicted and SSC (°Brix) measurements in a) intact b) peeled fruits.

The R2 determination coefficient obtained for intact fruits was 0.61, which was higher than that obtained for dry matter and RMSEP of 0.91. Similar results were obtained by Yahaya et al., (2015) YAHAYA, O.K.M.; JAFRI, M.Z.M.; AZIZ, A.A.; OMAR, A.F. Simplified optical fiber RGB system in evaluating intrinsic quality of Sala mango. Optical Engineering, Bellingham, v.54, n.6, p.067108, 2015. https://doi.org/10.1117/1.OE.54.6.067108.
https://doi.org/10.1117/1.OE.54.6.067108...
, reporting R2 of 0.593 and RMSEP of 1.34, using three wavelengths in the visible spectrum with peaks at 470 nm, 525 nm and 635 nm using RGB system with LED lighting. In addition, they found that the red wavelength presents the highest correlation among all, being the best linear combination of the three peaks.

Firmness prediction

Great difference in PLS performance was observed for data from intact fruits and peeled fruits. The best fit was achieved for peeled fruits, where equation 3 and 4 were obtained for intact and peeled fruits, respectively.

3 F i r m n e s s = 0.87 + 0.52 R 450 R 650 + 4.35 R 500 R 650 + 0.53 R 550 R 650 - 0.82 R 570 R 650 - 0.19 R 600 R 650

4 F i r m n e s s = - 2.59 - 1.23 R 450 R 650 + 4.02 R 500 R 650 + 2.87 R 550 R 650 - 0.03 R 570 R 650 - 0.11 R 600 R 650

Both equations with five predictor variables and the sixth variable as factor presented performance improvements.

The linear correlation between measured and predicted values (Figure 6), shows relatively good fit (R2 of 0.87) for peeled fruits; however, this technique is still destructive; therefore, it is not recommended. R2 of 0.66 obtained for intact fruits is lower than that reported by other studies. For example, Yahaya et al. (2015 YAHAYA, O.K.M.; JAFRI, M.Z.M.; AZIZ, A.A.; OMAR, A.F. Simplified optical fiber RGB system in evaluating intrinsic quality of Sala mango. Optical Engineering, Bellingham, v.54, n.6, p.067108, 2015. https://doi.org/10.1117/1.OE.54.6.067108.
https://doi.org/10.1117/1.OE.54.6.067108...
), obtained R2 of 0.76 by using the visible spectrum, while Valente et al. (2009) VALENTE, M.; LEARDI, R.; SELF, G.; LUCIANO, G.; PAIN, J. P. Multivariate calibration of mango firmness using vis/NIR spectroscopy and acoustic impulse method. Journal of Food Engineering, New York, v.94, n.1, p.7-13, 2009. https://doi.org/10.1016/j.jfoodeng.2009.02.020.
https://doi.org/10.1016/j.jfoodeng.2009....
, obtained a R2 of 0.82 by using the NIR spectrum. However, RMSEP of 0.67 was obtained, which is lower compared to values obtained by these authors.

Figure 6
Linear relationship between predicted and firmness measurements (Kg cm-2) in a) intact b) peeled fruits.

Dry matter Classification

The CART model allows classification of 63% with intact fruits, which increased to 68% with the random forest model. In peeled fruits, accuracy was 45%, improving to 73% with the random forest model. Although classification was higher in intact fruits, both models obtained Kappa indices lower than 0.2, which is considered “slight” according to Landis and Koch (1997) LANDIS, J.R.; KOCH, G.G. The measurement of observer agreement for categorical data. Biometrics, Malden, v.33, n.1, p.159-74, 1997. https://doi.org/10.2307/2529310.
https://doi.org/10.2307/2529310...
. Therefore, the AS7262 sensor is not recommended for classifying mangos according to their dry matter content.

Soluble solids content classification Mango fruits were classified into two categories: “Low” for SSC < 15 °Brix and “Medium” for SSC >= 15 °Brix. The best performance was observed in intact fruits using the CART model (Figure 7), where each rectangle represents a node of the tree, and the total data percentage and the correct proportion of each category are shown. The classification rule used is also located under the node. End nodes, known as leaves, show the model accuracy.

Figure 7
CART model for the classification of mango fruits into two SSC categories.

In the first leaf, 12% of data were grouped as “low” with 100% accuracy; however, the other leaves present lower accuracy percentage.

The model performed with overall accuracy of 90%. The Kappa index was 0.7, which is within the second criterion of Landis and Koch’s scale of assessment and recognized as significant. With the random forest model, the performance decreased, so that a more complex model that does not improve classification is not required. However, RF allows analyzing the model predictors.

Permutation and node purity analysis detected that wavelengths of 450 nm, 500 nm and 650 nm were the most important predictors, being the same variables highlighted by the CART model. The three variables correspond to the color range from blue to red and are related to the fruit peel hue variation.

Firmness classification

Mango fruits were classified into two categories: “Acceptable” for firmness < 2.7 kg cm-2 and “Unacceptable” for firmness >= 2.7 kg cm-2. The CART model performed better compared to RF for both data sets. The CART model was more accurate for intact fruits than for peeled fruits, with values of 86% and 72% respectively (Figure 8). The Kappa index obtained was of 0.67 for intact fruits, when compared to 0.37 achieved by peeled fruits, so it can be considered as a “Significant rating”.

Figure 8
CART model for the classification of mango fruits into two firmness categories.

The low performance of the model with data from peeled fruits is due to the little variation in the pulp color of fruits with firmness values below 12.4 N (PALAFOX-CARLOS, et al., 2011 PALAFOX-CARLOS, H.; YAHIA, E.; ISLAS-OSUNA, M.A.; GUTIERREZ-MARTINEZ, P.; ROBLES-SÁNCHEZ, M.; GONZÁLEZ-AGUILAR, G.A. Effect of ripeness stage of mango fruit (Mangifera indica L., cv. Ataulfo) on physiological parameters and antioxidant activity. Scientia Horticulturae, New York, v.135, p.7-13, 2012. https://doi.org/10.1016/j.scienta.2011.11.027.
https://doi.org/10.1016/j.scienta.2011.1...
).

Conclusions

Machine learning models and low-cost spectral sensors, such as the AS7262, have shown promising results in predicting maturity indices of mango fruits such as SSC and firmness, and combined with a microcontroller-based device allow measurements to be fast and non-destructive. Variation is SSC and firmness indices during fruit ripening, as well as fruit peel color changes, showed superior performance for intact fruits compared to peeled fruits. It is possible that more robust models for prediction and classification may achieve better performance; however, it is important to consider that due to hardware resource constraints and given that the prototype is based on an ESP32 microcontroller, the available processing capacity is limited.

In a supermarket using this technology over 90% of fruits can be properly sold out based on SSC, and this value can be increased using artificial intelligence models. Firmness is not a useful parameter in supermarkets as fruits become softer when people touch them before purchasing them.

Acknowledgements

The authors would like to thank the National Council of Humanities, Sciences and Technologies (CONAHCYT) Mexico and the Chapingo Autonomous University for the support provided to carry out this work.

  • ACHU, A.L.; AJU, C.D.; REGHUNATH, R. Spatial modelling of shallow landslide susceptibility: a study from the southern Western Ghats region of Kerala, India. Annals of GIS, Oxfordshire, v.26, n.2, p.113-31, 2020. https://doi.org/10.1080/19475683.2020.1758207
    » https://doi.org/10.1080/19475683.2020.1758207
  • BOTERO-VALENCIA, J.S.; VALENCIA-AGUIRRE, J.; DURMUS, D. A low-cost IoT multi-spectral acquisition device. HardwareX, London, v.9, p.e00173, 2021. https://doi.org/10.1016/j.ohx.2021.e00173
    » https://doi.org/10.1016/j.ohx.2021.e00173
  • GONZALEZ-MOSCOSO, S. Proposing minimum quality indices and improving ripening protocol for mangos (Mangifera indica L.) imported to the United States for the improvement of consumer quality 2014. Thesis (Master’s) - University of California, Davis, 2014.
  • HAHN, F. Hyperspectral mango ripeness detection. In: ASAE ANNUAL MEETING, 2002. Proceedings […]. Michigan: American Society of Agricultural and Biological Engineers, 2002. Disponível em: https://elibrary.asabe.org/abstract.asp?JID=5eAID=9629eCID=cil2002eT=1
  • JHA, S.N.; CHOPRA, S.; KINGSLY, A.R.P. Modeling of color values for nondestructive evaluation of maturity of mango. Journal of Food Engineering, New York, v.78, n.1, p.22-2, 2007. https://doi.org/10.1016/j.jfoodeng.2005.08.048
    » https://doi.org/10.1016/j.jfoodeng.2005.08.048
  • LANDIS, J.R.; KOCH, G.G. The measurement of observer agreement for categorical data. Biometrics, Malden, v.33, n.1, p.159-74, 1997. https://doi.org/10.2307/2529310
    » https://doi.org/10.2307/2529310
  • MENDOZA-HERNÁNDEZ, C.; ROSAS-QUIJANO, R.; VÁZQUEZ-OVANDO, A.; GÁLVEZ-LÓPEZ, D. Challenges and controversies of the Ataulfo mango. Revista Mexicana de Ciencias Agrícolas, Chapingo, v.11, n.7, 1633-45, 2020. https://doi.org/10.29312/remexca.v11i7.2199
    » https://doi.org/10.29312/remexca.v11i7.2199
  • MIHA, D.; STRAJESCU, E. From wavelength to RGB filter. University Politehnica of Bucharest Scientific Bulletin, Series D, Buch, v.69, n.2, p.77-84, 2007.
  • MUNAWAR, A.A.; VON HÖRSTEN, D.; WEGENER, J. K,; PAWELZIK, E.; MÖRLEIN, D. Rapid and non-destructive prediction of mango quality attributes using Fourier transform near infrared spectroscopy and chemometrics. Engineering in Agriculture, Environment and Food, Amsterdam, v.9, n.3, p.208-15, 2016. https://doi.org/10.1016/j.eaef.2015.12.004
    » https://doi.org/10.1016/j.eaef.2015.12.004
  • NASSUR, R.; CRISOSTO, G.; FREITAS, S.T. de; VILAS BOAS, E. D. B.; LIMA, L. D. O.; CRISOSTO, C. Dry matter as a quality index for brazilian mangoes. In: SIMPÓSIO BRASILEIRO DE PÓS-COLHEITA DE FRUTAS, HORTALIÇAS E FLORES, 4., 2013, Ribeirão Preto. Anais […].
  • NMX-FF-058-SCFI. Non industrialized food products for human consumption – fresh fruit – mango (Mangifera indica L.) – specifications. 2006. Available from: http://www.economia-nmx.gob.mx/normas/nmx/2006/nmx-ff-058-scfi-2006.pdf
    » http://www.economia-nmx.gob.mx/normas/nmx/2006/nmx-ff-058-scfi-2006.pdf
  • OSUNA-GARCIA, J.A.; OLIVARES-FIGUEROA, J.D.; TOIVONEN, P.M.; PÉREZ- BARRAZA, M. H.; GOENAGA, R.; GRACIANO-CRISTÓBAL, M. J. Novel nondestructive technique to determine optimum harvesting stage of ‘Ataúlfo’ mango fruit. Journal of Advances in Agriculture, Amritsar, v.12, p.61-9, 2021. https://doi.org/10.24297/jaa.v12i.9069
    » https://doi.org/10.24297/jaa.v12i.9069
  • PALAFOX-CARLOS, H.; YAHIA, E.; ISLAS-OSUNA, M.A.; GUTIERREZ-MARTINEZ, P.; ROBLES-SÁNCHEZ, M.; GONZÁLEZ-AGUILAR, G.A. Effect of ripeness stage of mango fruit (Mangifera indica L., cv. Ataulfo) on physiological parameters and antioxidant activity. Scientia Horticulturae, New York, v.135, p.7-13, 2012. https://doi.org/10.1016/j.scienta.2011.11.027
    » https://doi.org/10.1016/j.scienta.2011.11.027
  • PALOMEQUE, B.E.; GUERRERO, D.A.R.; GUTIE´RREZ, M.R.C.; ÁLVAREZ, T.E.C. El cultivo de mango y su interacción en la producción, comercialización y el turismo de negocios en Escuinapa, Sinaloa. Revista Sinaloense de Ciencia, Tecnología y Humanidades, Sin, v.1, n.1, 2023.
  • R CORE TEAM. R: a language and environment for statistical computing. Vienna: R Foundation for Statistical Computing, 2023 [cited 2023 feb 10]. Available from: https://www.R-project.org/. RSTUDIO TEAM. RStudio: Integrated Development Environment for R Boston: RStudio. Disponivel em: http://www.rstudio.com Acesso em: 10 fev. 2023.
    » http://www.rstudio.com
  • SANTOS NETO, J.P. dos; ASSIS, M.W.D. de; CASAGRANDE, I.P.; JÚNIOR, L.C.C.; ALMEIDA TEIXEIRA, G.H. de. Determination of ‘Palmer’mango maturity indices using portable near infrared (VIS-NIR) spectrometer. Postharvest Biology and Technology, Amsterdam, v.30, p.75-80, 2017. https://doi.org/10.1016/j.postharvbio.2017.03.009.
  • SHAH, S.S.A.; ZEB, A.; QURESHI, W.S.; ARSLAN, M.; MALIK, A.U.; ALASMARY, W.; ALANAZI, E. Towards fruit maturity estimation using NIR spectroscopy. Infrared Physics and Technology, Exeter, v.111, p.103479, 2020. https://doi.org/10.1016/j.infrared.2020.103479
    » https://doi.org/10.1016/j.infrared.2020.103479
  • STAMFORD, J.D.; STEVENS, J.; MULLINEAUX, P.M.; LAWSON, T. LED lighting: a grower’s guide to light spectra. HortScience, Alexandria, v.58, n.2, p.180-96, 2023. https://doi.org/10.21273/HORTSCI16823-22
    » https://doi.org/10.21273/HORTSCI16823-22
  • SUBEDI, P.P.; WALSH, K.B. Assessment of sugar and starch in intact banana and mango fruit by SWNIR spectroscopy. Postharvest Biology and Technology, Amsterdam, v.62, n.3, p.238-45, 2011. https://doi.org/10.1016/j.postharvbio.2011.06.014.
  • ULYA, M.; CHAMIDAH, N.; SAIFUDIN, T. Mango quality prediction based on near-infrared spectroscopy using multi-predictor local polynomial regression modeling. F1000Research, London, v.12, p.656, 2023. https://doi.org/10.12688/f1000research.130015.1
    » https://doi.org/10.12688/f1000research.130015.1
  • VALENTE, M.; LEARDI, R.; SELF, G.; LUCIANO, G.; PAIN, J. P. Multivariate calibration of mango firmness using vis/NIR spectroscopy and acoustic impulse method. Journal of Food Engineering, New York, v.94, n.1, p.7-13, 2009. https://doi.org/10.1016/j.jfoodeng.2009.02.020
    » https://doi.org/10.1016/j.jfoodeng.2009.02.020
  • WANG, H.; PENG, J.; XIE, C.; BAO, Y.; HE, Y. Fruit quality evaluation using spectroscopy technology: a review. Sensors, Basel, v.15, p.11889-927, 2015. https://doi.org/10.3390/s150511889
    » https://doi.org/10.3390/s150511889
  • YAHAYA, O.K.M.; JAFRI, M.Z.M.; AZIZ, A.A.; OMAR, A.F. Simplified optical fiber RGB system in evaluating intrinsic quality of Sala mango. Optical Engineering, Bellingham, v.54, n.6, p.067108, 2015. https://doi.org/10.1117/1.OE.54.6.067108.
    » https://doi.org/10.1117/1.OE.54.6.067108.

Edited by

Danielle Fabíola Pereira da Silva

Data availability

Data citations

R CORE TEAM. R: a language and environment for statistical computing. Vienna: R Foundation for Statistical Computing, 2023 [cited 2023 feb 10]. Available from: https://www.R-project.org/. RSTUDIO TEAM. RStudio: Integrated Development Environment for R Boston: RStudio. Disponivel em: http://www.rstudio.com Acesso em: 10 fev. 2023.

Publication Dates

  • Publication in this collection
    26 Feb 2024
  • Date of issue
    2024

History

  • Received
    03 May 2023
  • Accepted
    31 Oct 2023
Sociedade Brasileira de Fruticultura Via de acesso Prof. Paulo Donato Castellane, s/n , 14884-900 Jaboticabal SP Brazil, Tel.: +55 16 3209-7188/3209-7609 - Jaboticabal - SP - Brazil
E-mail: rbf@fcav.unesp.br