Abstract:Chinese hickory shell is the endogenous foreign body in its kernel production. Since the shell and kernel is similar in color, it is difficult to distinguish the shell and kernel accurately by color. In order to solve this problem, a nondestructive method based on hyperspectral imaging and deep learning for detecting endogenous foreign body in Chinese hickory nut was proposed. According to composition and structure of hickory nut, all samples can be divided into the inner shell, outer shell, inner kernel and outer kernel groups. After the hyperspectral images of each group was collected, the background of each hyperspectral image was removed by the Otsu method morphological algorithm and logical ‘a(chǎn)nd’ operation. The spectra of pixels in each group were extracted and preprocessed by multiplicative scatter correction (MSC) method. The deep features of the spectra were extracted by one dimension convolutional neural networks (1DCNN) and an 1DCNN model was established for detection of endogenous foreign body in hickory nut. To improve the detection accuracy, the spectra of pixels were normalized and reshaped into two-dimensional vector as the input of two dimension convolutional neural networks (2DCNN). The performance of the proposed 2DCNN model was better than that of the 1DCNN model. The accuracies of 100% and 98.5% were achieved for the training set and testing set, respectively.