FOOD SCIENCE ›› 2026, Vol. 47 ›› Issue (5): 324-334.doi: 10.7506/spkx1002-6630-20250914-104

• Safety Detection • Previous Articles    

Non-destructive Detection of Abnormal Pesticide Residues on Apple Surfaces Based on Explainable Machine Learning and Hyperspectral Imaging Technology

LI Zihao, LIU Yutong, WANG Shutong, LI Bo   

  1. (College of Plant Protection, Hebei Agricultural University, Baoding 071001, China)
  • Published:2026-04-13

Abstract: This study proposed an innovative framework integrating hyperspectral imaging with interpretable machine learning for precise and non-destructive detection of abnormal tebuconazole residues on apple surfaces. Hyperspectral images of Fuji apples treated with different concentrations of tebuconazole were acquired and average spectra were extracted from regions of interest (ROI). After systematically comparing the classification performance of various preprocessing methods coupled with multiple machine learning models, the second derivative (2D) method was identified as the optimal preprocessing technique. Feature wavelengths were selected using variable importance in projection (VIP), successive projections algorithm (SPA), and recursive feature addition (RFA) integrated with SHapley Additive exPlanations (SHAP) analysis. Support vector machine (SVM) and partial least squares-discriminant analysis (PLS-DA) models were developed using both full-spectrum and feature-waveband data. The SHAP framework was employed to interpret feature contributions in the optimal model. Experimental results demonstrated that the SVM model based on 2D preprocessing and SHAP-guided RFA (2D-SHAP-RFA-SVM) exhibited the best performance, reaching classification accuracy of 94.99% and 94.87% on the training and test sets, respectively, using only 51 feature wavelengths. SHAP analysis further elucidated the direction and magnitude of contribution of key wavelengths (e.g., 562.5 and 728.1 nm) to discriminating different residue levels, enhancing the transparency of the decision-making process. This study not only provides an effective method for accurate and non-destructive detection of abnormal tebuconazole residues on apple surfaces, but also offers a theoretical foundation for model optimization and the design of dedicated multispectral sensors based on the selected subset of feature wavelengths.

Key words: apple; pesticide residues; hyperspectral imaging; explainable machine learning; SHapley Additive exPlanations analysis; feature selection

CLC Number: