Surface defect detection of Hami melon using deep learning and image processing

被引:10
|
作者
Li X. [1 ]
Ma B. [1 ,2 ]
Yu G. [1 ]
Chen J. [1 ,3 ]
Li Y. [1 ]
Li C. [1 ]
机构
[1] College of Mechanical and Electrical Engineering, Shihezi University, Shihezi
[2] Key Laboratory of Northwest Agricultural Equipment, Ministry of Agriculture and Rural Affairs, Shihezi
[3] Mechanical Equipment Research Institute, Xinjiang Academy of Agricultural and Reclamation Science, Shihezi
关键词
Convolutional neural network; Defects; Hami melon; Image processing; Nondestructive detection; Visualization;
D O I
10.11975/j.issn.1002-6819.2021.01.027
中图分类号
学科分类号
摘要
An improved Convolutional Neural Network (CNN) was proposed to solve the time-consuming and inefficient detection for the surface defect on the Hami melon in recent years. The Hami melons were purchased from 103 Regiment, 6th Agricultural Division, the Xinjiang Production and Construction Corps, China. A total of 200 images of normal Hami melons were taken by a camera in a black box. 100 images of Hami melons were collected with the various surface defects, such as mildew, sunburn and crack. Since it is difficult to collect samples with three defect types, the data enhancement technique was used to expand the dataset. A total of 10 000 sample images were obtained, and then divided into a training and test dataset, according to the proportion of 4: 1. A VGG-like model was improved by adding a convolutional layer and a pooling layer at the beginning. As such, the improved VGG-like model included three convolutional layers, three max-pooling layers, a flatten layer, and two fully-connected layers. The softmax classifier was used in the last fully-connected layer. The Rectified Linear Unit (ReLU) function was chosen as the activation function. The Stochastic Gradient Descent (SGD) was chosen as the optimizer. The improved VGG-like model was used to identify four-class defect samples. The optimal hyperparameters in the CNN models were determined via the performance under the different learning rates and epochs. In all established CNN models, the test data showed that the AlexNet model outperformed other VGG-16 models, with the learning rate of 0.001 and the epochs of 500. Moreover, the AlexNet model can achieve the best performance with the accuracy of 99.69% and 96.62% in the training and test dataset, respectively. Three image processing techniques were compared to evaluate the preprocessing impact, including the Principal Components Analysis (PCA), Singular Value Decomposition (SVD), and binarization. The results indicated that the preprocessing provided a better detection performance on the various surface features of Hami melon in image preprocessing. The improved VGG-like model was the optimal to detect four-class defect on the Hami melon surface, indicating the learning rate of 0.001 and the epochs of 500. The prediction accuracy of improved VGG-like model in test set reached 97.14%. A visualization technique was used to analyze the features of convolutional layers, particularly on feature extraction in a CNN model. The visualization results showed that the defect features became more and more obvious with the increase of the convolutional layers. The defect features were the clearest in the captured images by the last convolutional layer. In addition, the convolutional features with the input as the preprocessing images were clearer than before. Finally, the improved VGG-like model was verified by the developed software on the plateform of PyQt5. The developed software functions included Open Camera, Read Image, Image Processing (Gray, PCA, SVD and Binarization), and Image Identification. The detection time of a single image was less than 0.7 s. In each type, 50 images were captured under the same environment. A total of 200 test images were collected. The test results showed that none of normal samples was predicted as defect samples. Only 8 crack Hami melons was incorrectly identified, due mainly to the unobvious feature. The average prediction accuracy of 200 samples was 93.5%. The improved VGG-like model with the preprocessing can be expected to apply for the detection of defects on the Hami melon surface, and other on-line nondestructive detection in the future. © 2021, Editorial Department of the Transactions of the Chinese Society of Agricultural Engineering. All right reserved.
引用
收藏
页码:223 / 232
页数:9
相关论文
共 31 条
  • [21] Xiang Yang, Lin Jiewen, Li Yajun, Et al., Mango double-sided maturity online detection and classification system, Transactions of the Chinese Society of Agricultural Engineering (Transaction of the CSAE), 35, 10, pp. 259-266, (2019)
  • [22] Nasiri A, Taheri-Garavand A, Zhang Yudong, Et al., Image based deep learning automated sorting of date fruit, Postharvest Biology & Technology, 153, pp. 133-141, (2019)
  • [23] Wang Gaihua, Lu Meng, Li Tao, Et al., Convolutional neural network based on spatial pyramid for image classification, Journal of Beijing Institute of Technology, 27, 4, pp. 630-636, (2018)
  • [24] Wang Hongxia, Zhou Jiaqi, Gu Chenghao, Et al., Design of activation function in CNN for image classification, Journal of Zhejiang University: Engineering Science, 53, 7, pp. 1363-1373, (2019)
  • [25] Xiao Jinsheng, Liu Enyu, Zhu Li, Et al., Improved image super resolution algorithm based on convolutional neural network, Acta Optica Sinica, 37, 3, pp. 103-111, (2017)
  • [26] Zeng Yaojun, Wu Junhang, Ma Benxue, Et al., Localization and defect detection of jujubes based on search of shortest path between frames and Ensemble-CNN model, Transactions of the Chinese Society for Agricultural Machinery, 50, 2, pp. 307-314, (2019)
  • [27] Chen Yingyi, Gong Chuanyang, Liu Yeqi, Et al., Fish identification method based on FTVGG16 convolutional neural network, Transactions of the Chinese Society for Agricultural Machinery, 50, 5, pp. 223-231, (2019)
  • [28] Alex K, Ilya S, Hinton G., ImageNet classification with deep convolutional neural networks, Communications of the ACM, 60, 6, pp. 84-90, (2017)
  • [29] Zhou Feiyan, Lin Peng, Dong Jun, Review of convolutional neural network, Chinese Journal of Computers, 40, 6, pp. 1229-1251, (2017)
  • [30] Cui Yongjie, Gao Zongbin, Liu Haozhou, Et al., Feature extraction of kiwi trunk based on convolution layer feature visualization, Transactions of the Chinese Society for Agricultural Machinery, 51, 4, pp. 181-190, (2020)