李善军, 胡定一, 高淑敏, 林家豪, 安小松, 朱明. 基于改进SSD的柑橘实时分类检测[J]. 农业工程学报, 2019, 35(24): 307-313. DOI: 10.11975/j.issn.1002-6819.2019.24.036
    引用本文: 李善军, 胡定一, 高淑敏, 林家豪, 安小松, 朱明. 基于改进SSD的柑橘实时分类检测[J]. 农业工程学报, 2019, 35(24): 307-313. DOI: 10.11975/j.issn.1002-6819.2019.24.036
    Li Shanjun, Hu Dingyi, Gao Shuming, Lin Jiahao, An Xiaosong, Zhu Ming. Real-time classification and detection of citrus based on improved single short multibox detecter[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(24): 307-313. DOI: 10.11975/j.issn.1002-6819.2019.24.036
    Citation: Li Shanjun, Hu Dingyi, Gao Shuming, Lin Jiahao, An Xiaosong, Zhu Ming. Real-time classification and detection of citrus based on improved single short multibox detecter[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(24): 307-313. DOI: 10.11975/j.issn.1002-6819.2019.24.036

    基于改进SSD的柑橘实时分类检测

    Real-time classification and detection of citrus based on improved single short multibox detecter

    • 摘要: 针对人工分拣柑橘过程中,检测表面缺陷费时费力的问题,该文提出了一种基于改进SSD深度学习模型的柑橘实时分类检测方法。在经改装的自制打蜡机试验台架下采集单幅图像含有多类多个柑橘的样本2 500张,随机选取其中2 000张为训练集,500张为测试集,在数据集中共有正常柑橘19 507个,表皮病变柑橘9 097个,机械损伤柑橘4 327个。该方法通过单阶段检测模型SSD-ResNet18对图片进行计算和预测,并返回图中柑橘的位置与类别,以此实现柑橘的分类检测。以平均精度AP(average precision)的均值mAP(mean average precision)作为精度指标,平均检测时间作为速度指标,在使用不同特征图、不同分辨率和ResNet18、MobileNetV3、ESPNetV2、VoVNet39等4种不同特征提取网络时,进行模型分类检测效果对比试验研究。研究表明,该模型使用C4、C5特征图,768×768像素的分辨率较为合适,特征提取网络ResNet18在检测速度上存在明显优势,最终该模型的mAP达到87.89%,比原SSD的87.55%高出0.34个百分点,平均检测时间为20.27 ms,相较于原SSD的108.83 ms,检测耗时降低了436.90%。该模型可以同时对多类多个柑橘进行实时分类检测,可为自动化生产线上分拣表面缺陷柑橘的识别方面提供技术借鉴。

       

      Abstract: Abstract: Manually classifying citrus based on its surface defects is tedious and time-consuming and a new real-time method is proposed in this paper based on the improved SSD deep learning model. In the testing bench of the waxing machine, 2 500 images of a variety of citrus species were taken, of which 2 000 were randomly selected as training set and 500 as testing set. Among them, the method classified 19 507 as normal, 9 097 skin defects and 4 327 mechanically damaged. Considering that traditional methods using near-infrared spectra, support vector machines, HSV and RGB color space model are inefficient to detect surface defects of citrus and can only identify one, we proposed an improved method to calculate the image using the one-stage detection model - SSD-ResNet18. The method gets the feature maps through backbone first, and then predicts the number of boundary boxes from the feature maps before determining the location and category of citrus using confidence and non-maximum suppression. This can detect a batch of citrus. In the proposed method, we used the mAP (mean average precision) as the precision index and the mean detection time as the speed index. Optimization in the proposed method was solved using the SGD (stochastic gradient descent) algorithm. The learning scheduler was based on cosine decay, enabling the learning rate to drop to 0 at the end of the training period. This ensures the lost value during the training period to continuously decline. As the model was stable at the end of the training period, it can be saved at the end of the training for further use. While the VGG16 was used as the original SSD backbone, it needs a multitude of parameters and is hence computationally inefficient. We replaced it with the ResNet18, which is approximately 100 times more efficient than the VGG16. An improved feature map was obtained from the analysis of the effective sensory field of different feature maps and the size of citrus in the map, the anchor in which was obtained using the K-means clustering algorithm from the manual label box. The suitable image resolution for the proposed model was obtained by comparing images taken at five resolutions: 512×512 pixels, 640×640 pixels, 768×768 pixels, 896×896 pixels and 1024×1024 pixels. The results showed that the accuracy of the mAP of SSD-ResNet18 was 87.89%, improving 0.34 percentage points higher than the original SSD. The average detecting time of the SSD-ResNet18 was 20.72 ms, reduced by 436.90% compared to the original SSD's 108.83 ms. The accuracy of the AP of SSD-ResNet18 was 94.72%, 85.79% and 83.17%, respectively, for detecting normal, skin lesion and mechanical damage. We compared MobileNetV3, ESPNetV2, VoVNet39 and ResNet18 as backbones and did not find significant difference between their accuracy, but ResNet18 was 10.52 ms, 16.78 ms and 36.76 ms less than MobileNetV3, ESPNetV2 and VoVNet39 in detection time, respectively. The method proposed in the paper meets the requirement on detecting speed in real-time citrus production line and can effectively classify and detect a multitude of citrus simultaneously.

       

    /

    返回文章
    返回