首页 | 本学科首页   官方微博 | 高级检索  
     检索      

基于深度学习与图像处理的哈密瓜表面缺陷检测
引用本文:李小占,马本学,喻国威,陈金成,李玉洁,李聪.基于深度学习与图像处理的哈密瓜表面缺陷检测[J].农业工程学报,2021,37(1):223-232.
作者姓名:李小占  马本学  喻国威  陈金成  李玉洁  李聪
作者单位:1. 石河子大学机械电气工程学院,石河子 832003;;1. 石河子大学机械电气工程学院,石河子 832003; 2. 农业农村部西北农业装备重点实验室,石河子 832003;;1. 石河子大学机械电气工程学院,石河子 832003; 3. 新疆农垦科学院机械装备研究所,石河子 832000;
基金项目:西部特果精选关键技术研发与集成示范(2015BAD19B03)
摘    要:针对传统人工检测哈密瓜表面缺陷效率低等问题,提出利用卷积神经网络(Convolutional Neural Networks, CNN)对哈密瓜表面缺陷进行快速检测。对原始图像进行主成分分析(Principal Components Analysis,PCA)、奇异值分解(Singular Value Decomposition, SVD)和二值化等预处理操作,通过数据扩充得到正常、霉菌、晒伤和裂纹的哈密瓜图像各2 500幅。构建一种改进的类似VGG卷积神经网络模型,将预处理后的图像输入模型,并使用随机梯度下降(StochasticGradient Descent,SGD)优化器进行算法优化,为探究CNN模型的特征提取原理,将改进的类似VGG模型每层卷积的特征进行可视化,最后利用开发的哈密瓜表面缺陷检测软件对模型进行试验验证。研究结果表明:图像预处理算法提高了模型的鲁棒性和泛化能力,改进的类似VGG模型优于Alex Net和VGG-16模型,其训练集和测试集准确率分别为100.00%和97.14%;对比预处理前后4类哈密瓜卷积特征可视化结果表明,随着卷积层层数的增加,哈密瓜表面缺陷特征越来越明显,图像预处理后卷积层特征提取效果优于原始图像提取效果。软件测试结果表明:静态下哈密瓜缺陷检测速率达到0.7 s/幅,识别准确率达到93.50%。研究结果可为哈密瓜表面缺陷在线检测技术提供理论依据和技术参考。

关 键 词:图像处理  缺陷  无损检测  卷积神经网络  可视化  哈密瓜
收稿时间:2020/9/15 0:00:00
修稿时间:2020/11/10 0:00:00

Surface defect detection of Hami melon using deep learning and image processing
Li Xiaozhan,Ma Benxue,Yu Guowei,Chen Jincheng,Li Yujie,Li Cong.Surface defect detection of Hami melon using deep learning and image processing[J].Transactions of the Chinese Society of Agricultural Engineering,2021,37(1):223-232.
Authors:Li Xiaozhan  Ma Benxue  Yu Guowei  Chen Jincheng  Li Yujie  Li Cong
Institution:1. College of Mechanical and Electrical Engineering, Shihezi University, Shihezi 832003, China;;1. College of Mechanical and Electrical Engineering, Shihezi University, Shihezi 832003, China; 2. Key Laboratory of Northwest Agricultural Equipment, Ministry of Agriculture and Rural Affairs, Shihezi 832003, China;;1. College of Mechanical and Electrical Engineering, Shihezi University, Shihezi 832003, China; 3. Mechanical Equipment Research Institute, Xinjiang Academy of Agricultural And Reclamation Science, Shihezi 832000, China;
Abstract: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 10000 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 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.7s. 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 50 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.
Keywords:image processing  defects  nondestructive detection  convolutional neural network  visualization  Hami melon
本文献已被 CNKI 等数据库收录!
点击此处可从《农业工程学报》浏览原始摘要信息
点击此处可从《农业工程学报》下载免费的PDF全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号