食品科学 ›› 2025, Vol. 46 ›› Issue (12): 287-296.doi: 10.7506/spkx1002-6630-20241227-241

• 安全检测 • 上一篇    下一篇

基于X射线和视觉图像融合特征的霉变核桃无损检测

宁鑫跃,张慧,姬帅,赖丽思   

  1. (新疆大学智能制造现代产业学院,新疆?乌鲁木齐 830017)
  • 出版日期:2025-06-25 发布日期:2025-05-23
  • 基金资助:
    国家自然科学基金青年科学基金项目(32302205)

Non-destructive Identification of Moldy Walnuts by Fusing X-Ray and Visual Image Features

NING Xinyue, ZHANG Hui, JI Shuai, LAI Lisi   

  1. (College of Intelligent Manufacturing Modern Industry, Xinjiang University, ürümqi 830017, China)
  • Online:2025-06-25 Published:2025-05-23

摘要: 针对霉变核桃检测难、效率低的问题,提出一种融合X射线和视觉图像的霉变核桃无损检测方法,以准确判别核桃内外皆霉变、内霉外正常、内正常外霉变和内外皆正常4 类情况。首先采用灰度共生矩阵提取X射线和视觉图像的纹理特征,并在不同颜色空间下分别计算视觉图像的一阶矩和二阶矩,以全面捕捉核桃内外部霉变特征,从而构建原始霉变核桃特征集。随后,基于竞争自适应重加权算法和连续投影算法对提取的特征进行优选,构建对不同霉变情况敏感的核桃特征集。在此基础上,分别构建极限学习机和K-最近邻霉变核桃分类模型,并通过实验对比不同特征集下分类模型的性能,验证了融合X射线和视觉图像特征检测霉变核桃的可行性。结果表明,使用连续投影算法优选特征集构建的极限学习机模型性能最优,测试集准确率、召回率、模型精确率和召回率的调和平均值(F1)分别达到90.32%、92.58%和91.29%,平均特异性和Kappa系数分别达到97.02%和88.44%,对多数类和少数类的霉变核桃均有较高的判别能力。本研究可为核桃内外部霉变情况的综合、准备识别以及在线无损检测系统的研发提供理论参考。

关键词: X射线;计算机视觉;霉变核桃;特征优选;机器学习

Abstract: To address the difficulty of detecting moldy walnuts and the problem of low detection efficiency, a non-destructive method based on fused features of X-ray and visual images was proposed to accurately distinguish four grades of moldy walnuts: moldy both internally and externally, moldy internally and normal externally, normal internally and moldy externally, and normal both internally and externally. First, the gray-level co-occurrence matrix (GLCM) was used to extract texture features from X-ray and visual images, and the first and second moments of the visual images were computed in different color spaces to comprehensively capture the internal and external moldiness characteristics of walnuts in order to construct an original moldy walnut feature set. Subsequently, using competitive adaptive reweighted sampling (CARS) and successive projection algorithm (SPA), the extracted features were optimized to construct a walnut feature set sensitive to different degrees of moldiness. On this basis, an extreme learning machine (ELM) model and a K-nearest neighbors (KNN) model were developed for moldy walnut classification, and the performance of the classification models under different feature sets was compared through experiments to verify the feasibility of fusing X-ray and visual image features for detecting moldy walnuts. The experimental results showed that the ELM model developed using SPA optimized feature set had the best performance. The accuracy and recall for the test set, and the harmonic mean of precision and recall (F1) value of the model were 90.32%, 92.58%, and 91.29%, respectively. The average specificity and Kappa coefficient values were 97.02% and 88.44%, respectively, indicating high ability to discriminate both majority and minority moldy walnuts. This study provides a theoretical reference for the comprehensive and accurate identification of the internal and external moldiness of walnuts, as well as the development of online non-destructive testing systems.

Key words: X-ray; computer vision; moldy walnut; feature selection; machine learning

中图分类号: