食品科学 ›› 2019, Vol. 40 ›› Issue (16): 314-320.doi: 10.7506/spkx1002-6630-20180612-180

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

基于X射线和卷积神经网络的异物水饺识别

王 强,武 凯,王新宇,孙 宇,杨晓燕,楼晓华   

  1. 1.南京理工大学机械工程学院,江苏 南京 210094;2.南通四方冷链装备股份有限公司,江苏 南通 226300
  • 出版日期:2019-08-25 发布日期:2019-08-26
  • 基金资助:
    江苏省高端装备研制赶超工程项目(JSJXZB201606);江苏省科技成果转化专项(BA2013101)

Recognition of Dumplings with Foreign Body Based on X-Ray and Convolutional Neural Network

WANG Qiang, WU Kai, WANG Xinyu, SUN Yu, YANG Xiaoyan, LOU Xiaohua   

  1. 1. School of Mechanical Engineering, Nanjing University of Science & Technology, Nanjing 210094, China; 2. Nantong Square Cold Chain Equipment Co. Ltd., Nantong 226300, China
  • Online:2019-08-25 Published:2019-08-26

摘要: 针对盒装水饺中的异物严重危害消费者身心健康,以及传统金属检测机只能检测金属、检测结果无法直观可视的现状,建立一种基于LeNet卷积神经网络(convolutional neural networks,CNN)模型的异物水饺识别方法,对含有金属钢球、铁丝、螺钉、石头和玻璃5 种异物的X射线水饺图像进行检测。首先利用X射线检测设备获取无异物和异物水饺图像,对图像进行去噪和对比度拉伸变换处理。其次,采用批量归一化方法、Softmax线性回归分类器,以ReLu为激活函数、Max-Pooling为下采样方法,对设计的CNN模型进行优化、训练和验证。利用训练好的网络模型对无异物和异物水饺图像各100 幅进行测试,结果表明:该方法可以精确地识别异物水饺,识别率为99.78%。最后,通过提取局部二值模式、方向梯度直方图和Gabor常规纹理特征作为识别无异物和异物水饺的特征向量,利用BP神经网络、支持向量机(support vector machine,SVM)、K最邻近分类器、AdaBoost分类器、朴素贝叶斯分类器和决策树类器对水饺图像进行识别,将识别结果与本实验网络模型进行对比,验证了本实验算法的优越性和所提取特征的有效性。该研究为食品中的异物检测提供了新的思路,有利于保障食品安全。

关键词: 盒装水饺, X射线, 异物识别, 卷积神经网络, 特征向量, 食品安全

Abstract: Foreign bodies in quick-frozen dumplings can seriously endanger consumers’ physical and mental health. However, the traditional metal detector can only detect metals and the results cannot be visualized intuitively. Motivated by this problem, in this study, we developed a method of recognizing foreign bodies dumplings with based on LeNet convolutional neural network (CNN) model, which can detect X-ray images of dumplings containing five foreign bodies, including metal balls, wires, screws, stones, and glasses. Firstly, X-ray images of dumplings without foreign bodies and those with foreign bodies were obtained and processed by denoising and contrast stretching transformation. Secondly, the CNN model was optimized, trained and validated using batch normalization (BN) method and Softmax linear regression classifier with ReLu as the activation function and Max-Pooling as the down-sampling method. The trained network model was applied to test 100 dumpling images without foreign bodies and 100 ones with foreign bodies. The experimental results showed that the recognition method could accurately identify the foreign body-containing dumplings with a recognition rate of up to 99.78%. Finally, the traditional texture features of local binary pattern (LBP), histogram of oriented gradient (HOG) and Gabor were extracted and used as the feature vectors for identifying dumpling images with and without foreign objects by using back propagation (BP) neural network, support vector machine (SVM), K-nearest neighbor (KNN) classifier, AdaBoost classifier, Naive Bayes classifier and decision tree classifier. The results were compared with those obtained with the network model, which verified the superiority of the algorithm and the effectiveness of the extracted features. This research provides a new approach for the detection of foreign bodies in food so as to ensure food safety.

Key words: quick-frozen dumplings, X-ray, foreign body recognition, convolutional neural networks, feature vector, food safety

中图分类号: