Mold Detection in Sweet Tamarind During Storage Performed by Near-Infrared Spectroscopy and Chemometrics
Abstract
1. Introduction:
2. Materials and Methods
2.1. Experimental Materials and Storage Conditions
2.2. NIR Spectral Acquisition
2.3. Mold Assessment and Sample Classification
2.4. Spectral Preprocessing
2.5. Principal Component Analysis
2.6. Classification Model Development
2.6.1. Partial Least Squares Discriminant Analysis (PLS-DA)
2.6.2. Artificial Neural Networks (ANN)
2.6.3. Data Partitioning and Validation
2.7. Model Evaluation Metrics
3. Results
3.1. Mold Incidence and Sample Distribution During Storage
3.2. Spectral Characteristics and Temporal Trends
3.2.1. Spectral Features Associated with Mold Infection
3.2.2. Principal Component Analysis
3.3. PLS-DA Classification Performance
3.4. Non-Linear Classification Results (ANN)
3.5. ANN Classification Outcomes and Performance Metrics
4. Discussion
4.1. The Detection Window: Fungal Growth Phase Biology Explains Weekly Performance
4.2. Why ANN Outperforms PLS-DA: Non-Linearity in Fungal Spectral Signatures
4.3. Preprocessing Strategy: Matching Transformation to Infection Stage
4.4. Toward a Week-Adaptive Classification Architecture
4.5. Spatial Averaging Strategy for Heterogeneous Infection
4.6. Interactance Mode and Pericarp Penetration: Why Measurement Geometry Matters
4.7. Toward Portable Implementation: Spectral Simplification
5. Conclusions
Supplementary Materials
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| ANN | Artificial neural network |
| PCA | Principal component analysis |
| PLS-DA | Partial least squares discriminant analysis |
| NIRS | Near-infrared spectroscopy |
| SNV | Standard normal variate |
| MSC | Multiplicative scatter correction |
| FT-NIR | Fourier-transform near-infrared |
| RH | Relative humidity |
References
- Tridge. Fresh Tamarind—Global Trade Intelligence. Available online: https://www.tridge.com/intelligences/tamarind (accessed on 15 December 2024).
- Karnjanatawe, K. Versatile Tamarind. Bangkok Post. 2020. Available online: https://www.bangkokpost.com/life/social-and-lifestyle/2013091/versatile-tamarind (accessed on 28 January 2026).
- Poonwan, N.; Boon-Long, J.; Poosuwan, S.; Boriraj, V. Fungi and their toxins present on sweet tamarind. Bull. Dep. Med. Sci. 1988, 30, 3–8. [Google Scholar]
- Mishra, G.; Panda, B.K.; Ramirez, W.A.; Jung, H.; Singh, C.B.; Lee, S.H.; Lee, I. Research advancements in optical imaging and spectroscopic techniques for nondestructive detection of mold infection and mycotoxins in cereal grains and nuts. Compr. Rev. Food Sci. Food Saf. 2021, 20, 4612–4651. [Google Scholar] [CrossRef]
- El-Banna, A.A.; El-Aziz, A.A.E. Effect of storage conditions on the physical properties and chemical composition of tamarind (Tamarindus indica L.) pods. J. Stored Prod. Res. 2001, 37, 47–59. [Google Scholar]
- Abbott, J.A. Quality measurement of fruits and vegetables. Postharvest Biol. Technol. 1999, 15, 207–225. [Google Scholar] [CrossRef]
- Zhang, X.; Yang, J. Advanced chemometrics toward robust spectral analysis for fruit quality evaluation. Trends Food Sci. Technol. 2024, 144, 104612. [Google Scholar] [CrossRef]
- Nicolaï, B.M.; Beullens, K.; Bobelyn, E.; Peirs, A.; Saeys, W.; Theron, K.I.; Lammertyn, J. Nondestructive measurement of fruit and vegetable quality by means of NIR spectroscopy: A review. Postharvest Biol. Technol. 2007, 46, 99–118. [Google Scholar] [CrossRef]
- Cen, H.; He, Y. Theory and application of near infrared reflectance spectroscopy in determination of food quality. Trends Food Sci. Technol. 2007, 18, 72–83. [Google Scholar] [CrossRef]
- Stuart, B.H. Infrared Spectroscopy: Fundamentals and Applications; John Wiley & Sons: Chichester, UK, 2004. [Google Scholar]
- Gowen, A.A.; O’Donnell, C.P.; Cullen, P.J.; Downey, G.; Frias, J.M. Hyperspectral imaging—An emerging process analytical tool for food quality and safety control. Trends Food Sci. Technol. 2007, 18, 590–598. [Google Scholar] [CrossRef]
- Li, P.; Su, G.; Du, G.; Jiang, L.; Dong, Y.; Shan, Y. Portable LWNIR and SWNIR spectroscopy with pattern recognition technology for accurate and nondestructive detection of hidden mold infection in citrus. Microchem. J. 2023, 193, 109203. [Google Scholar] [CrossRef]
- Moscetti, R.; Monarca, D.; Cecchini, M.; Haff, R.P.; Contini, M.; Massantini, R. Detection of mold-damaged chestnuts by near-infrared spectroscopy. Postharvest Biol. Technol. 2014, 93, 83–90. [Google Scholar] [CrossRef]
- Qiao, L.; Luo, C.; Yang, B.; Dong, T.; Li, D. Calibration maintenance application of near-infrared spectrometric model in food analysis: A review. J. Food Process. Preserv. 2023, 47, e16898. [Google Scholar] [CrossRef]
- Jiang, X.; Ge, K.; Liu, Z.; Chen, N.; Ouyang, A.; Liu, Y.; Huang, Y.; Li, J.; Hu, M. Non-destructive online detection of early moldy core apples based on Vis/NIR transmission spectroscopy. Chem. Biol. Technol. Agric. 2024, 11, 63. [Google Scholar] [CrossRef]
- Luo, W.; Zhao, C.; Wang, W.; Ni, D.; He, Y. Spectrum classification of citrus tissues infected by fungi and multispectral image identification of early rotten oranges. Spectrochim. Acta A Mol. Biomol. Spectrosc. 2022, 272, 120949. [Google Scholar] [CrossRef] [PubMed]
- Marini, F. Artificial neural networks in foodstuff analyses: Trends and perspectives. Anal. Chim. Acta 2009, 635, 121–131. [Google Scholar] [CrossRef] [PubMed]
- Kuzy, J.; Erisman, L. Artificial intelligence in food safety: A perspective on recent advancements and applications of deep learning. Food Control 2022, 139, 109039. [Google Scholar]
- Hasanzadeh, B.; Abbaspour-Gilandeh, Y.; Soltani-Nazarloo, A.; Cruz-Gámez, E.D.L.; Hernández-Hernández, J.L.; Martínez-Arroyo, M. Non-destructive measurement of quality parameters of apple fruit by using visible/near-infrared spectroscopy and multivariate regression analysis. Sustainability 2022, 14, 14918. [Google Scholar] [CrossRef]
- Ali, M.Z.; Seehanam, P.; Theanjumpol, P.; Sonthiya, K.; Suksai, K.; Maniwara, P. Utilization of near infrared spectroscopy coupled with chemometrics for non-destructive detection of mold in sweet tamarind. Appl. Food Res. 2025, 5, 101241. [Google Scholar] [CrossRef]
- Fan, S.; Li, J.; Xia, Y.; Tian, X.; Guo, Z.; Huang, W. Long-term evaluation of soluble solids content of apples with biological variability by using near-infrared spectroscopy and calibration transfer method. Postharvest Biol. Technol. 2019, 151, 79–87. [Google Scholar] [CrossRef]
- Tirado-Kulieva, V.A.; Torres-Guevara, F.A.; Gonzales-Malca, J.A.; Castro, W.; Seguí, L. Scientific trends in spectroscopy and regression chemometric modelling for the estimation of whole fruit quality: A systematic review. Chemometr. Intell. Lab. Syst. 2026, 269, 105612. [Google Scholar] [CrossRef]
- Guo, Z.; Chen, X.; Zhang, Y.; Sun, C.; Jayan, H.; Majeed, U.; Watson, N.J.; Zou, X. Dynamic nondestructive detection models of apple quality in critical harvest period based on near-infrared spectroscopy and intelligent algorithms. Foods 2024, 13, 1698. [Google Scholar] [CrossRef]
- Vega-Castellote, M.; Sánchez, M.T.; Wold, J.P.; Afseth, N.K.; Pérez-Marín, D. Near infrared light penetration in watermelon related to internal quality evaluation. Postharvest Biol. Technol. 2023, 204, 112477. [Google Scholar] [CrossRef]
- Maniwara, P.; Nakano, K.; Ohashi, S.; Boonyakiat, D.; Seehanam, P.; Theanjumpol, P.; Poonlarp, P. Evaluation of NIRS as non-destructive test to evaluate quality traits of purple passion fruit. Sci. Hortic. 2019, 257, 108712. [Google Scholar] [CrossRef]
- Fernández-Ahumada, E.; Félix, J.M.; Pedregosa, A.; Guerrero, J.E.; Garrido-Varo, A. Mathematical and statistical approaches in near infrared spectroscopy. In Infrared Spectroscopy—Life and Biomedical Sciences; IntechOpen: London, UK, 2012. [Google Scholar]
- Rinnan, Å.; van den Berg, F.; Engelsen, S.B. Review of the most common pre-processing techniques for near-infrared spectra. TrAC Trends Anal. Chem. 2009, 28, 1201–1222. [Google Scholar] [CrossRef]
- Barnes, R.J.; Dhanoa, M.S.; Lister, S.J. Standard normal variate transformation and de-trending of near-infrared diffuse reflectance spectra. Appl. Spectrosc. 1989, 43, 772–777. [Google Scholar] [CrossRef]
- Geladi, P.; MacDougall, D.; Martens, H. Linearization and scatter-correction for near-infrared reflectance spectra of meat. Appl. Spectrosc. 1985, 39, 491–500. [Google Scholar] [CrossRef]
- Savitzky, A.; Golay, M.J. Smoothing and differentiation of data by simplified least squares procedures. Anal. Chem. 1964, 36, 1627–1639. [Google Scholar] [CrossRef]
- Jolliffe, I.T.; Cadima, J. Principal component analysis: A review and recent developments. Philos. Trans. R. Soc. A 2016, 374, 20150202. [Google Scholar] [CrossRef]
- Wold, S.; Esbensen, K.; Geladi, P. Principal component analysis. Chemom. Intell. Lab. Syst. 1987, 2, 37–52. [Google Scholar] [CrossRef]
- Granato, D.; Santos, J.S.; Escher, G.B.; Ferreira, B.L.; Maggio, R.M. Use of principal component analysis (PCA) and hierarchical cluster analysis (HCA) for multivariate association between bioactive compounds and functional properties in foods. Compr. Rev. Food Sci. Food Saf. 2018, 17, 773–787. [Google Scholar] [CrossRef]
- Brereton, R.G. Pattern recognition in chemometrics. Chemom. Intell. Lab. Syst. 2015, 149, 90–96. [Google Scholar] [CrossRef]
- Barker, M.; Rayens, W. Partial least squares for discrimination. J. Chemom. 2003, 17, 166–173. [Google Scholar] [CrossRef]
- Wold, S.; Sjöström, M.; Eriksson, L. PLS-regression: A basic tool of chemometrics. Chemom. Intell. Lab. Syst. 2001, 58, 109–130. [Google Scholar] [CrossRef]
- Agatonovic-Kustrin, S.; Beresford, R. Basic concepts of artificial neural network (ANN) modeling and its application in pharmaceutical research. J. Pharm. Biomed. Anal. 2000, 22, 717–727. [Google Scholar] [CrossRef] [PubMed]
- ElMasry, G.; Wang, N.; ElSayed, A.; Ngadi, M. Hyperspectral imaging for nondestructive determination of some quality attributes for strawberry. J. Food Eng. 2007, 81, 98–107. [Google Scholar] [CrossRef]
- Sokolova, M.; Lapalme, G. A systematic analysis of performance measures for classification tasks. Inf. Process. Manag. 2009, 45, 427–437. [Google Scholar] [CrossRef]
- Powers, D.M. Evaluation: From precision, recall and F-measure to ROC, informedness, markedness and correlation. arXiv 2011, arXiv:2010.16061. [Google Scholar]
- Fawcett, T. An introduction to ROC analysis. Pattern Recognit. Lett. 2006, 27, 861–874. [Google Scholar] [CrossRef]
- Chicco, D.; Jurman, G. The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation. BMC Genom. 2020, 21, 6. [Google Scholar] [CrossRef]
- Williams, P.C. Implementation of near-infrared technology. In Near-Infrared Technology in the Agricultural and Food Industries, 2nd ed.; American Association of Cereal Chemists: St. Paul, MN, USA, 2001; pp. 145–169. [Google Scholar]
- Siesler, H.W.; Ozaki, Y.; Kawata, S.; Heise, H.M. Near-Infrared Spectroscopy: Principles, Instruments, Applications; John Wiley & Sons: Weinheim, Germany, 2008. [Google Scholar]
- Pandiselvam, R.; Prithviraj, V.; Manikantan, M.R.; Kothakota, A.; Rusu, A.V.; Trif, M.; Khaneghah, A.M. Recent advancements in NIR spectroscopy for assessing the quality and safety of horticultural products: A comprehensive review. Front. Nutr. 2022, 9, 973457. [Google Scholar] [CrossRef]
- Pasquini, C. Near infrared spectroscopy: A mature analytical technique with new perspectives—A review. Anal. Chim. Acta 2018, 1026, 8–36. [Google Scholar] [CrossRef]
- Reich, G. Near-infrared spectroscopy and imaging: Basic principles and pharmaceutical applications. Adv. Drug Deliv. Rev. 2005, 57, 1109–1123. [Google Scholar] [CrossRef]
- Huang, H.; Liu, L.; Ngadi, M.O. Recent developments in hyperspectral imaging for assessment of food quality and safety. Sensors 2014, 14, 7248–7276. [Google Scholar] [CrossRef] [PubMed]
- Ballabio, D.; Consonni, V. Classification tools in chemistry. Part 1: Linear models. PLS-DA Anal. Methods 2013, 5, 3790–3798. [Google Scholar] [CrossRef]
- Balabin, R.M.; Lomakina, E.I. Support vector machine regression (SVR/LS-SVM)—An alternative to neural networks (ANN) for analytical chemistry? Analyst 2011, 136, 1703–1712. [Google Scholar] [CrossRef] [PubMed]
- Ncama, K.; Opara, U.L.; Tesfay, S.Z.; Fawole, O.A.; Magwaza, L.S. Application of Vis/NIR spectroscopy for predicting sweetness and flavour parameters of Valencia orange and Star Ruby grapefruit. J. Food Eng. 2017, 193, 86–94. [Google Scholar] [CrossRef]
- Mishra, P.; Woltering, E.; Brouwer, B.; Hogeveen-van Echtelt, E. Improving moisture and soluble solids content prediction in pear fruit using near-infrared spectroscopy with variable selection and model updating approach. Postharvest Biol. Technol. 2021, 171, 111348. [Google Scholar] [CrossRef]
- Mishra, P.; Asaari, M.S.M.; Herrero-Langreo, A.; Lohumi, S.; Diezma, B.; Scheunders, P. Close range hyperspectral imaging of plants: A review. Biosyst. Eng. 2017, 164, 49–67. [Google Scholar] [CrossRef]
- Anderson, N.T.; Walsh, K.B.; Subedi, P.P.; Hayes, C.H. Achieving robustness across season, location and cultivar for a NIRS model for intact mango fruit dry matter content. Postharvest Biol. Technol. 2020, 168, 111202. [Google Scholar] [CrossRef]
- Lorente, D.; Aleixos, N.; Gómez-Sanchis, J.; Cubero, S.; García-Navarrete, O.L.; Blasco, J. Recent advances and applications of hyperspectral imaging for fruit and vegetable quality assessment. Food Bioprocess Technol. 2012, 5, 1121–1142. [Google Scholar] [CrossRef]
- Zou, X.B.; Zhao, J.W.; Povey, M.J.; Holmes, M.; Mao, H.P. Variables selection methods in near-infrared spectroscopy. Anal. Chim. Acta 2010, 667, 14–32. [Google Scholar] [CrossRef]




| Data Type | Calibration (n = 85) | Prediction (n = 85) | ||||||
|---|---|---|---|---|---|---|---|---|
| Class | Intact | Mold | Accuracy (%) | Class | Intact | Mold | Accuracy (%) | |
| Original | Intact | 32 | 11 | 71.76 | Intact | 33 | 9 | 60.00 |
| Mold | 13 | 29 | Mold | 25 | 18 | |||
| SNV | Intact | 32 | 11 | 74.12 | Intact | 24 | 18 | 51.76 |
| Mold | 11 | 31 | Mold | 23 | 20 | |||
| MSC | Intact | 32 | 11 | 75.29 | Intact | 23 | 19 | 50.59 |
| Mold | 10 | 32 | Mold | 23 | 20 | |||
| 1D | Intact | 25 | 18 | 60.00 | Intact | 19 | 23 | 50.59 |
| Mold | 16 | 26 | Mold | 19 | 24 | |||
| 2D | Intact | 28 | 15 | 61.18 | Intact | 23 | 19 | 55.29 |
| Mold | 18 | 24 | Mold | 19 | 24 | |||
| Data Type | Calibration (n = 85) | Prediction (n = 85) | ||||||
|---|---|---|---|---|---|---|---|---|
| Class | Intact | Mold | Accuracy (%) | Class | Intact | Mold | Accuracy (%) | |
| Original | Intact | 301 | 129 | 65.88 | Intact | 311 | 109 | 61.41 |
| Mold | 161 | 259 | Mold | 219 | 211 | |||
| SNV | Intact | 309 | 121 | 66.00 | Intact | 323 | 97 | 60.59 |
| Mold | 168 | 252 | Mold | 238 | 192 | |||
| MSC | Intact | 266 | 164 | 58.12 | Intact | 274 | 146 | 56.94 |
| Mold | 192 | 228 | Mold | 220 | 210 | |||
| 1D | Intact | 335 | 95 | 77.29 | Intact | 288 | 132 | 63.53 |
| Mold | 98 | 322 | Mold | 178 | 252 | |||
| 2D | Intact | 275 | 155 | 60.94 | Intact | 255 | 165 | 58.12 |
| Mold | 177 | 243 | Mold | 191 | 239 | |||
| Week | Optimal Data Preprocessing and Accuracy; PLS-DA | Optimal Data Preprocessing and Accuracy; ANN | Accuracy Gain (%) | F1-Score (ANN) | Key Observation |
|---|---|---|---|---|---|
| Week 0 | SNV; 85.71% | MSC; 87.14% | +1.43 | 0.87 | ANN marginal advantage; scatter correction critical |
| Week 1 | Original; 68.75% | Original; 76.88% | +8.13 | 0.75 | ANN notable gain; same preprocessing optimal |
| Week 2 | MSC; 75.00% | SNV; 85.00% | +10.00 | 0.85 | ANN clear advantage; optimal detection window |
| Week 3 | Original; 68.75% | SNV; 79.38% | +10.63 | 0.81 | Largest ANN gain; active colonization phase |
| Week 4 | 2D; 72.73% | Original; 76.36% | +3.63 | 0.75 | Moderate ANN gain; degradation-induced heterogeneity |
| Week 5 | Original; 75.00% | 2D; 80.00% | +5.00 | 0.81 | ANN recovery with derivative preprocessing |
| Overall | Original; 60.00% | 1D; 63.53% | +3.53 | 0.65 | ANN superior overall; week-specific models recommended |
| Data Type | Classification | Prediction | ||||
|---|---|---|---|---|---|---|
| Sensitivity | Specificity | F1-Score | Sensitivity | Specificity | F1-Score | |
| Original | 0.70 | 0.62 | 0.67 | 0.74 | 0.49 | 0.65 |
| SNV | 0.72 | 0.60 | 0.68 | 0.77 | 0.45 | 0.66 |
| MSC | 0.62 | 0.54 | 0.60 | 0.65 | 0.49 | 0.60 |
| 1D | 0.78 | 0.77 | 0.78 | 0.69 | 0.59 | 0.65 |
| 2D | 0.64 | 0.58 | 0.62 | 0.61 | 0.56 | 0.59 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Ali, M.Z.; Seehanam, P.; Naksavi, D.; Maniwara, P. Mold Detection in Sweet Tamarind During Storage Performed by Near-Infrared Spectroscopy and Chemometrics. Horticulturae 2026, 12, 462. https://doi.org/10.3390/horticulturae12040462
Ali MZ, Seehanam P, Naksavi D, Maniwara P. Mold Detection in Sweet Tamarind During Storage Performed by Near-Infrared Spectroscopy and Chemometrics. Horticulturae. 2026; 12(4):462. https://doi.org/10.3390/horticulturae12040462
Chicago/Turabian StyleAli, Muhammad Zeeshan, Pimjai Seehanam, Darunee Naksavi, and Phonkrit Maniwara. 2026. "Mold Detection in Sweet Tamarind During Storage Performed by Near-Infrared Spectroscopy and Chemometrics" Horticulturae 12, no. 4: 462. https://doi.org/10.3390/horticulturae12040462
APA StyleAli, M. Z., Seehanam, P., Naksavi, D., & Maniwara, P. (2026). Mold Detection in Sweet Tamarind During Storage Performed by Near-Infrared Spectroscopy and Chemometrics. Horticulturae, 12(4), 462. https://doi.org/10.3390/horticulturae12040462

