Skip to main content
Log in

Investigation of pre-processing NIR spectroscopic data and classification algorithms for the fast identification of chocolate-coated peanuts and sultanas

  • Original Paper
  • Published:
European Food Research and Technology Aims and scope Submit manuscript

Abstract

Chocolate-coated confectionery, including fruits and nuts, is an increasingly popular snack food. Non-destructive discrimination of the core composition could be useful for quality assurance purposes, such as ensuring the absence of peanuts in a batch of chocolate-coated sultanas. This study investigated the optimum pre-processing methods and discrimination algorithms for identifying chocolate-coated peanuts and sultanas from their near-infrared (NIR) spectra. The best-performing results were found using partial least squares discriminant analysis (PLS-DA) and principal component analysis with linear discriminant analysis (PCA-LDA), which both demonstrated 100% classification accuracy when applied to the validation set. Principal component analysis with support vector machine (PCA-SVM) showed slightly poorer results, particularly when using non-optimal pre-processing techniques. In general, the most accurate results were found when using either the unprocessed or SNV-processed spectral data. This work supports the prospect of using near-infrared spectroscopy for the quality assurance in the manufacture or wholesale of panned chocolate goods.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4

Similar content being viewed by others

Data availability

The data supporting the results of this manuscript are available from the authors upon request.

References

  1. Statista. Size of the chocolate confectionery market worldwide from 2016 to 2026. Available online: https://www.statista.com/forecasts/983554/global-chocolate-confectionery-market-size Accessed on 29 Aug.

  2. Kiss M, Czine P, Balogh P, Szakály Z (2022) The connection between manufacturer and private label brands and brand loyalty in chocolate bar buying decisions–A hybrid choice approach. Appetite 177:106145. https://doi.org/10.1016/j.appet.2022.106145

    Article  PubMed  Google Scholar 

  3. Depypere F, Delbaere C, De Clercq N, Dewettinck K (2009) Fat bloom and cracking of filled chocolates: issues for the European manufacturer? New Food 12:9–12

    Google Scholar 

  4. Hartel RW, von Elbe JH, Hofberger R (2018) Chocolate Panning. In Confectionery Science and Technology. Springer International Publishing, Cham

    Book  Google Scholar 

  5. Gutiérrez TJ (2017) State-of-the-art chocolate manufacture: a review. Comprehen Rev Food Sci Food Safety 16:1313–1344. https://doi.org/10.1111/1541-4337.12301

    Article  Google Scholar 

  6. Aebi M (2017) Chocolate panning. In: Aebi M (ed) Beckett’s Industrial Chocolate Manufacture and Use. John Wiley and Sons Chichester, UK

    Google Scholar 

  7. Geschwindner G, Drouven H (2009) 18 Manufacturing processes: chocolate panning and inclusions. In: Talbot G (ed) Science and Technology of Enrobed and Filled Chocolate, Confectionery and Bakery Products. Woodhead Publishing, Elsevier

    Google Scholar 

  8. Leroux H, Langlois A, Paradis L, Des Roches A, Bégin P (2020) Visual assessment does not reliably predict peanut content in chocolate-covered peanut candies used for oral immunotherapy. J Allergy Clin Immunol 8:368–370. https://doi.org/10.1016/j.jaip.2019.08.046

    Article  Google Scholar 

  9. Jördens C, Koch M (2008) Detection of foreign bodies in chocolate with pulsed terahertz spectroscopy. Optical Eng 47:037003

    Article  Google Scholar 

  10. Agour M, Falldorf C, Taleb F, Koch M, Bergmann RB, Castro-Camus E (2022) Chocolate inspection by means of phase-contrast imaging using multiple-plane terahertz phase retrieval. Opt Lett 47:3283–3286. https://doi.org/10.1364/OL.464102

    Article  CAS  PubMed  Google Scholar 

  11. Johnson JB, Walsh KB, Naiker M, Ameer K (2023) The use of infrared spectroscopy for the quantification of bioactive compounds in food: a review. Molecules 28:3215. https://doi.org/10.3390/molecules28073215

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  12. Amorim TL, Duarte LM, de Oliveira MAL, de la Fuente MA, Gómez-Cortés P (2020) Prediction of fatty acids in chocolates with an emphasis on c18:1 trans fatty acid positional isomers using ATR-FTIR associated with multivariate calibration. J Agric Food Chem 68:10893–10901. https://doi.org/10.1021/acs.jafc.0c04316

    Article  CAS  PubMed  Google Scholar 

  13. da Costa Filho PA (2009) Rapid determination of sucrose in chocolate mass using near infrared spectroscopy. Anal Chim Acta 631:206–211. https://doi.org/10.1016/j.aca.2008.10.049

    Article  CAS  PubMed  Google Scholar 

  14. Gatti RF, de Santana FB, Poppi RJ, Ferreira DS (2021) Portable NIR spectrometer for quick identification of fat bloom in chocolates. Food Chem 342:128267. https://doi.org/10.1016/j.foodchem.2020.128267

    Article  CAS  PubMed  Google Scholar 

  15. Bin, Z.; Lei, D.; Qiao, G.; Xinyu, W.; Yangsheng, X. 2008 Fast discrimination of chocolate varieties using near infrared spectroscopy. In Proceedings of the 2008 IEEE International Conference on Automation and Logistics, 2008: 730–735.

  16. Johnson JB (2022) Discrimination of centre composition in panned chocolate goods using near infrared spectroscopy. J Near Infrared Spectrosc 30:130–137. https://doi.org/10.1177/09670335221085616

    Article  CAS  Google Scholar 

  17. Huang M, Kim MS, Chao K, Qin J, Mo C, Esquerre C, Delwiche S, Zhu Q (2016) Penetration depth measurement of near-infrared hyperspectral imaging light for milk powder. Sensors 16:441. https://doi.org/10.3390/s16040441

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  18. Xu L, Li J, Zhang D (2018) Near-infrared light penetration depth analysis inside melon with thick peel by a novel strategy of slicing combining with least square fitting method. J Food Proc Eng. 41:e12886. https://doi.org/10.1111/jfpe.12886

    Article  CAS  Google Scholar 

  19. Bro R, Smilde AK (2014) Principal component analysis. Anal Meth 6:2812–2831. https://doi.org/10.1039/C3AY41907J

    Article  CAS  Google Scholar 

  20. El Orche A, Mamad A, Elhamdaoui O, Cheikh A, El Karbane M, Bouatia M (2021) Comparison of machine learning classification methods for determining the geographical origin of raw milk using vibrational spectroscopy. J Spectrosc 2021:5845422. https://doi.org/10.1155/2021/5845422

    Article  CAS  Google Scholar 

  21. Li Z, Wang P-P, Huang C-C, Shang H, Pan S-Y, Li X-J (2014) Application of Vis/NIR spectroscopy for chinese liquor discrimination. Food Anal Methods 7:1337–1344. https://doi.org/10.1007/s12161-013-9755-9

    Article  Google Scholar 

  22. Johnson JB, El Orche A, Naiker M (2022) Prediction of anthocyanin content and variety in plum extracts using ATR-FTIR spectroscopy and chemometrics. Vibrat Spect 121:103406. https://doi.org/10.1016/j.vibspec.2022.103406

    Article  CAS  Google Scholar 

  23. Brereton RG, Lloyd GR (2016) Re-evaluating the role of the mahalanobis distance measure. J Chemom 30:134–143. https://doi.org/10.1002/cem.2779

    Article  CAS  Google Scholar 

  24. El Orche A, Bouatia M, Mbarki M (2020) Rapid analytical method to characterize the freshness of olive oils using fluorescence spectroscopy and chemometric algorithms. J Anal Meth Chem 2020:8860161. https://doi.org/10.1155/2020/8860161

    Article  CAS  Google Scholar 

  25. Subasi A (2020) Chapter 3 machine learning techniques practical machine learning for data analysis using python. In: Subasi A (ed) Academic Press. Machine learning techniques, USA

    Google Scholar 

  26. Tremblay M, Kammer M, Lange H, Plattner S, Baumgartner C, Stegeman JA, Duda J, Mansfeld R, Döpfer D (2019) Prediction model optimization using full model selection with regression trees demonstrated with FTIR data from bovine milk. Prev Vet Med 163:14–23. https://doi.org/10.1016/j.prevetmed.2018.12.012

    Article  CAS  PubMed  Google Scholar 

  27. Feng L, Wu B, Zhu S, Wang J, Su Z, Liu F, He Y, Zhang C (2020) Investigation on data fusion of multisource spectral data for rice leaf diseases identification using machine learning methods. Front Plant Sci. https://doi.org/10.3389/fpls.2020.577063

    Article  PubMed  PubMed Central  Google Scholar 

  28. Zeaiter M, Rutledge D (2009) 304 Preprocessing Methods. In: Walczak B (ed) Comprehensive chemometrics. Elsevier, Oxford. USA

    Google Scholar 

  29. Luo J, Ying K, He P, Bai J (2005) Properties of Savitzky-Golay digital differentiators. Digital Signal Proc 15:122–136. https://doi.org/10.1016/j.dsp.2004.09.008

    Article  Google Scholar 

  30. Sun X, Subedi P, Walker R, Walsh KB (2020) NIRS prediction of dry matter content of single olive fruit with consideration of variable sorting for normalisation pre-treatment. Posth Biol Technol 163:111140. https://doi.org/10.1016/j.postharvbio.2020.111140

    Article  CAS  Google Scholar 

  31. Tao F, Yao H, Hruska Z, Liu Y, Rajasekaran K, Bhatnagar D (2019) Use of visible–near-infrared (Vis-NIR) spectroscopy to detect aflatoxin B1 on peanut kernels. Appl Spectrosc 73:415–423. https://doi.org/10.1177/0003702819829725

    Article  CAS  PubMed  Google Scholar 

  32. Huxsoll CC (2000) Assessment of near infrared (NIR) diffuse reflectance analysis for measuring moisture and water activity in raisins. J Food Process Preserv 24:315–333. https://doi.org/10.1111/j.1745-4549.2000.tb00422.x

    Article  Google Scholar 

  33. Rahman A, Wang S, Yan J, Xu H (2021) Intact macadamia nut quality assessment using near-infrared spectroscopy and multivariate analysis. J Food Comp Anal 102:104033

    Article  CAS  Google Scholar 

  34. Carvalho LCDV, Lima PFM (2019) Assessment of macadamia kernel quality defects by means of near infrared spectroscopy (NIRS) and nuclear magnetic resonance (NMR). Food Control 106:106695. https://doi.org/10.1016/j.foodcont.2019.06.021

    Article  CAS  Google Scholar 

Download references

Funding

This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.

Author information

Authors and Affiliations

Authors

Contributions

Conceptualization: AEO and JBJ. Methodology: AEO. Software: AEO. Validation: AEO and JBJ. Formal analysis: AEO and JBJ. Investigation: AEO and JBJ. Resources: JBJ. Data curation: JBJ. Writing—original draft preparation: AEO. Writing—review and editing: JBJ. Visualization: AEO. Supervision: JBJ. Project administration: AEO and JBJ. All authors have read and agreed to the published version of the manuscript.

Corresponding author

Correspondence to Aimen El Orche.

Ethics declarations

Conflict of interest

The authors declare no conflict of interest.

Compliance with ethics requirements

This study does not contain any studies with human participants or animals performed by any of the authors.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

El Orche, A., Johnson, J.B. Investigation of pre-processing NIR spectroscopic data and classification algorithms for the fast identification of chocolate-coated peanuts and sultanas. Eur Food Res Technol 249, 2287–2297 (2023). https://doi.org/10.1007/s00217-023-04300-2

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00217-023-04300-2

Keywords

Navigation