Nondestructive detection of codling moth infestation in apples using pixel-based nir hyperspectral imaging with machine learning and feature selection

Nader Ekramirad, Alfadhl Y. Khaled, Lauren E. Doyle, Julia R. Loeb, Kevin D. Donohue, Raul T. Villanueva, Akinbode A. Adedeji

Research output: Contribution to journalArticlepeer-review

10 Scopus citations


Codling moth (CM) (Cydia pomonella L.), a devastating pest, creates a serious issue for apple production and marketing in apple-producing countries. Therefore, effective nondestructive early detection of external and internal defects in CM-infested apples could remarkably prevent postharvest losses and improve the quality of the final product. In this study, near-infrared (NIR) hyperspectral reflectance imaging in the wavelength range of 900–1700 nm was applied to detect CM infestation at the pixel level for three organic apple cultivars, namely Gala, Fuji and Granny Smith. An effective region of interest (ROI) acquisition procedure along with different machine learning and data processing methods were used to build robust and high accuracy classification models. Optimal wavelength selection was implemented using sequential stepwise selection methods to build multispectral imaging models for fast and effective classification purposes. The results showed that the infested and healthy samples were classified at pixel level with up to 97.4% total accuracy for validation dataset using a gradient tree boosting (GTB) ensemble classifier, among others. The feature selection algorithm obtained a maximum accuracy of 91.6% with only 22 selected wavelengths. These findings indicate the high potential of NIR hyperspectral imaging (HSI) in detecting and classifying latent CM infestation in apples of different cultivars.

Original languageEnglish
Article number8
Issue number1
StatePublished - Jan 1 2022

Bibliographical note

Funding Information:
Funding: This research was funded by the National Institute of Food and Agriculture (NIFA), U.S. Department of Agriculture (USDA), Foundational and Applied Science Program, with grant award #: 2019-67021-29692.

Funding Information:
Acknowledgments: The authors would like to acknowledge the Kentucky Agricultural Experiment Station and for supporting and sponsoring this work.

Publisher Copyright:
© 2021 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 (https:// 4.0/).


  • Apples
  • Codling moth
  • Feature selection
  • Hyperspectral imaging
  • Machine learning
  • Near-infrared

ASJC Scopus subject areas

  • Food Science
  • Microbiology
  • Health(social science)
  • Health Professions (miscellaneous)
  • Plant Science


Dive into the research topics of 'Nondestructive detection of codling moth infestation in apples using pixel-based nir hyperspectral imaging with machine learning and feature selection'. Together they form a unique fingerprint.

Cite this