1. 中国科学院西安光学精密机械研究所光谱成像技术重点实验室, 陕西 西安 710119
2. 中国科学院大学, 北京 100039
*通讯联系人 e-mail: hbl@opt.ac.cn

Study on Quality Identification of Macadamia nut Based on Convolutional Neural Networks and Spectral Features
DU Jian1,2, HU Bing-liang1,*, LIU Yong-zheng1, WEI Cui-yu1, ZHANG Geng1, TANG Xing-jia1
1. Key Laboratory of Spectral Imaging Technology of Chinese Academy of Sciences, Xi’an Institute of Optics and Precision Mechanics, Chinese Academy of Sciences, Xi’an 710119, China;
2. University of Chinese Academy of Sciences, Beijing 100049, China
Abstract

Macadamia nut is easy to spoil after being stripped off because of the high level of oil in it. Most of the existing traditional methods are destructive which are difficult to satisfy the demand of non-destructive detection. As one of the widely used deep learning models, convolutional neural network (CNN) has stronger capabilities of feature extraction and model formulation than shallow learning methods and great potential for the application of spectral data. We studied suitable CNN architecture to extract spectral features of Macadamia based on Vis-NIRS analysis, and proposed an efficient non-destructive method to identify the quality of Macadamia. At first, we took three kinds of macadamia nut with different qualities (including better nut, worse nut and moldy nut) as the research object and analyzed the spectral information in the wavelength range of 500~2 100 nm. We introduced the concept of whitening in data preprocessing to strengthen the correlation difference. In the process of model training, we divided the sample into training set and prediction set randomly and then discussed the effects of different structure parameters, such as the number of convolution layer, size of convolution kernel, pooling type, number of neuron in full connection layer and activation function. We applied ReLU and Dropout to prevent over-fitting caused by lack of data. At last, through the analysis of the classification accuracy and computational efficiency, a CNN model of 6-layer structure was established: input layer-convolution layer-pooling layer-full connection layer(including 200 neurons)-full connection layer(including 100 neurons)-output layer. The results show that the final classification accuracy of the calibration set and prediction set reached 100%. This improved CNN model can fully learn the spectral features of macadamia and classify effectively. The combination of the deep learning theory and the spectral analysis method can identify the quality of macadamia accurately, and provide a new idea for the efficient, non-destructive, real-time, online detection of macadamia and other nuts.

Keyword: Vis-NIRS; Macadamia nut; Deep learning; Convolutional neural network (CNN); Quality identification

1 模型与算法

1.1 白化

(1)对零均值化后的数据x构造自相关矩阵

$Rx=E(xxT)≠I(1)$

$Ry=BE(xxT)BT=Ι(2)$

y的各分量是不相关的, 即E(yi yj )=δ ij, 这就是白化的过程, B称为空间白化矩阵。

(2)由式(1)可知, Rx存在特征值分解, 即Rx=Φ Λ Φ T, 其中Φ 是正交矩阵, Λ 是对角化矩阵, 其对角元素是Rx的特征值。 为了使对角元素单位化, 对B进行变换, 令B=Λ -1/2Φ T, 代入式(2)可得

$Ry=(Λ-1/2ΦT)ΦΛΦT(Λ-1/2ΦT)T=I(3)$

1.2 卷积神经网络

 Figure Option 图1 CNN模型基础结构Fig.1 Fundamental architecture of CNN

 Figure Option 图2 夏威夷果光谱数据CNN建模流程图Fig.2 Flow chart of CNN modeling towards spectral data of Macadamia

(1)初始化:

(2)迭代训练:

$J(θ)=-1m∑i=1m∑j=1n61{j=Y(i)}log(yj(i))(5)$

$θ=θ-α·▽θJ(θ)(7)$

1.3 过拟合

(1)利用光谱吸收指数与光谱角填图法对夏威夷果原始光谱进行分析, 并将霉籽从样本集中分出;

(2)对好籽与哈籽构建样本集, 采用白化等方法进行光谱预处理;

(3)以全谱段光谱数据作为输入, 训练CNN模型进行夏威夷果品质的分类鉴定。

2 实验部分
2.1 材料

(1) 好籽组: 共128颗, 果实外壳表面光滑, 无霉菌生长痕迹, 果仁饱满可食用;

(2) 哈籽组: 共106颗, 果实外壳色泽较暗, 果仁有轻微变色, 不可食用;

(3) 霉籽组: 共44颗, 有明显霉菌生长在外壳表面, 果仁也覆盖了部分霉菌, 误食后对人体有害。

2.2 光谱采集

2.3 光谱分析

 Figure Option 图3 夏威夷果平均光谱Fig.3 Average spectra of Macadamia nuts

2.3.1 光谱吸收指数

$SAI=dρ1+(1-d)ρ2ρm(8)$

2.3.2 光谱角填图

3 结果与讨论

 Figure Option 图4 CNN分类模型结构图Fig.4 The architecture of the proposed CNN classifier

 Figure Option 图5 不同神经元个数对应的训练误差比较Fig.5 Training errors with different numbers of neuron

 Figure Option 图6 不同Dropout值对应的训练误差比较Fig. 6 Training errors with different Dropout

4 结 论

The authors have declared that no competing interests exist.

 [1] LIU Jian-fu, HUANG Li(刘建福, 黄莉). Food and Nutrition in China(中国食物与营养), 2005, 2: 25. [本文引用:1] [2] Schmutzler M, Huck C W. Vibrational Spectroscopy, 2014, 72: 97. [本文引用:1] [3] Ferreira D S, Pallone J A L, Poppi R J. Food Control, 2015, 48: 91. [本文引用:1] [4] Miphokasap P, Honda K, Vaiphasa C, et al. Remote Sensing, 2012, 4(6): 1651. [本文引用:1] [5] Jakobek L, Barron A R. Journal of Food Composition and Analysis, 2016, 45: 9. [本文引用:1] [6] Vanoli M, Rizzolo A, Grassi M, et al. Postharvest Biology and Technology, 2014, 91: 112. [本文引用:1] [7] Hinton G E, Salakhutdinov R R. Science, 2006, 313(5786): 504. [本文引用:1] [8] Lecun Y, Bottou L, Bengio Y, et al. Proceedings of the IEEE, 1998, 86(11): 2278. [本文引用:1] [9] Chen Y, Lin Z, Zhao X, et al. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 2014, 7(6): 2094. [本文引用:1] [10] Sainath T N, Mohamed A R, Kingsbury B, et al. In Proceedings of the 38th IEEE International Conference on Acoustics (ICASSP ’13), 2013. 8614. [本文引用:1] [11] Abdel-Hamid O, Mohamed A R, Jiang H, et al. In Proceedings of the IEEE International Conference on Acoustics (ICASSP ’12), 2012. 4277. [本文引用:1]