目的:改善现有水果识别与分级方法依赖于人工操作和复杂设备的情况。方法:提出了一种轻量化模型YOLO-FFD(YOLO with fruit and freshen detection),该模型以YOLOv5框架为基础,基于深度可分离卷积和GELU激活函数设计轻量化模块LightweightC3作为主干特征提取网络的基本单元,减少模型参数量和计算量,加快模型的收敛速度;使用大内核深度可分离卷积模块EnhancedC3改进原模型的颈部,抑制信息丢失并增强模型的特征融合能力,提高模型的检测精度;采用GSConv代替特征融合网络中的普通卷积,使模型进一步轻量化。结果:提出模型的平均精度均值达到了 96。12%,在RTX 3090上速度为172帧/s,在嵌入式设备Jetson TX2上速度为20帧/s。相比于原始YOLOv5模型,平均精度均值提高了 2。21%,计算量减少了 26%,在RTX 3090和Jetson TX2上的速度分别提高了 2倍和1倍。结论:YOLO-FFD模型能够满足识别水果品种和新鲜度的需求,且在复杂场景下错检、漏检情况均有改善。
Fruit variety and freshness recognition method based on YOLO-FFD
Objective:In order to improve the situation that existing fruit recognition and classification methods rely on manual operation and complex equipment.Methods:A lightweight model YOLO-FFD(YOLO with fruit and freshen detection)was proposed,which based on the YOLOv5 framework.Firstly,LightweightC3 was designed as the basic unit of the backbone feature extraction network based on the depth separable convolution and GELU activation function,which reduced the number of model parameters and computation,and speeds up the convergence of the model.Secondly,EnhancedC3,a large kernel depth separable convolution module,was used to improve the neck of the original model.suppressed information loss and enhance the feature fusion ability of the model,so as to improve the detection accuracy of the model.Finally,GSConv was used to replace the common convolution in the feature fusion network to further lighten the model.Results:The experimental results showed that the average accuracy of the proposed model reached 96.12%,the FPS on RTX 3090 was 172,and the speed on the embedded Jetson TX2 was 20 frames per second.Compared with the original YOLOv5 model,the mAP was improved by 2.21%,the calculation amount was reduced by 26%,and the speed was increased by two times.Conclusion:YOLO-FFD can meet the requirement of identifying fruit varieties and freshness,and improve the falsely detection and missing detection in complex scenes.