食品科学 ›› 2026, Vol. 47 ›› Issue (5): 324-334.doi: 10.7506/spkx1002-6630-20250914-104

• 安全检测 • 上一篇    

基于可解释性机器学习和高光谱成像技术的苹果表面农药异常残留无损检测

李子豪,刘羽烔,王树桐,李波   

  1. (河北农业大学植物保护学院,河北 保定 071001)
  • 发布日期:2026-04-13
  • 基金资助:
    中央支持地方科技发展引导资金项目(246Z6501G);石家庄市驻冀高校重点研发专项(241490112A); 现代农业产业技术体系建设专项(CARS-27)

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

摘要: 为实现苹果表面戊唑醇异常残留的精准、无损检测,本研究提出一种融合高光谱成像与可解释机器学习的方法。以富士苹果为研究对象,对其表面施以不同质量浓度的戊唑醇处理,采集高光谱图像并提取感兴趣区域的平均光谱。系统比较多种预处理方法结合多种机器学习模型的分类性能,确认二阶导数(second derivative,2D)为最佳预处理方法。利用变量投影重要性、连续投影算法和结合夏普利加性解释(SHapley Additive exPlanations,SHAP)分析的递归特征添加(recursive feature addition,RFA)算法进行特征波长筛选,分别基于全波段与特征波段建立支持向量机(support vector machine,SVM)与偏最小二乘判别分析模型,并借助SHAP分析对最优模型进行特征贡献解析。实验结果表明,经2D预处理后结合SHAP分析的RFA算法所构建的SVM模型(2D-SHAP-RFA-SVM)性能最优,仅使用51 个特征波长实现在训练集和测试集的分类准确率分别达到94.99%、94.87%。SHAP分析进一步揭示了562.5、728.1 nm等关键波长对不同残留等级分类的贡献方向与程度,增强了模型决策过程的透明度。本研究不仅为实现苹果表面戊唑醇异常残留的精准、无损检测提供了有效方法,所筛选的特征波长子集为模型优化及专用传感器设计提供理论依据。

关键词: 苹果;农药残留;高光谱成像;可解释机器学习;夏普利加性解释分析;特征筛选

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

中图分类号: