目的 针对蔬菜包装前的分拣流水线边缘设备算力受限、蔬菜表面微小缺陷检测中精度与模型规模难以兼顾的问题,本文提出一种轻量化缺陷检测模型(Ghost-ECA-Frequency Decoupling YOLO,GEF-YOLO)。方法 以YOLOv8s为基准模型,从特征提取、通道注意力和检测头三方面改进,即主干与颈部用GhostConv、C3Ghost替换标准卷积和C2f模块,以低成本线性操作削减通道冗余。主干末端加入ECA注意力,用无降维的跨通道交互强化病斑响应;设计频率解耦交互预测器FDIP替换原解耦头,将特征分为低、高频分量分别送入分类与回归分支,缓解两者的特征偏好冲突。在公开的Fresh and Rotten Vegetable数据集(5类蔬菜、新鲜与腐烂2种状态、11 660张图像)上训练与测试,以精确率、召回率、mAP50和mAP50-95为指标,开展消融与主流模型对比实验并对复杂场景做可视化分析。结果 与YOLOv8s相比,GEF-YOLO的参数量(Params)降低54.4%,浮点运算量(FLOPs)降低47.5%,精确率达到92.83%,召回率达到90.47%,mAP50为94.56%,mAP50-95为76.86%,推理速度(FPS)达到116.73帧/s,较YOLOv8s提高11.1%。结论 GEF-YOLO在大幅压缩模型规模的同时保持了与基准模型相当的检测精度,可为资源受限场景下的蔬菜缺陷检测提供一种轻量化方案。
Abstract
To address the limited computing power of edge devices on pre-packaging vegetable sorting lines and the difficulty of balancing accuracy and model size in detecting small surface defects, the work aims to propose a lightweight detection model named GEF-YOLO (Ghost-ECA-Frequency Decoupling YOLO). With YOLOv8s as the baseline, the model was improved from three aspects of feature extraction, channel attention, and detection head. In the backbone and neck, GhostConv and C3Ghost replaced the standard convolutions and C2f modules, cutting channel redundancy through low-cost linear operations to shrink the model. An ECA module was added at the end of the backbone to strengthen the response to lesion features via cross-channel interaction without dimensionality reduction. A Frequency Decoupling Interaction Predictor (FDIP) was designed to replace the original decoupled head, decomposing features into low- and high-frequency components that were fed into the classification and regression branches respectively, so as to ease the feature-preference conflict between the two branches. The model was trained and tested on the public Fresh and Rotten Vegetable dataset (5 vegetable types, fresh and rotten states, 11 660 images). With precision, recall, mAP50, and mAP50-95 as metrics, ablation studies and comparisons with mainstream models were conducted, and detection results in complex scenes were analyzed qualitatively. Compared with YOLOv8s, GEF-YOLO reduced the Params and FLOPs by 54.4% and 47.5% respectively, with a precision of 92.83%, a recall of 90.47%, an mAP50 of 94.56%, and an mAP50-95 of 76.86%, with an inference speed of 116.73 frames/s, 11.1% higher than that of YOLOv8s. These results show that GEF-YOLO substantially compresses the model while maintaining accuracy comparable to the baseline, offering a practical lightweight solution for vegetable defect detection in resource-constrained settings.
关键词
蔬菜缺陷检测 /
YOLOv8s /
轻量化模型 /
频率解耦 /
ECA注意力机制
Key words
vegetable defect detection /
YOLOv8s /
lightweight model /
frequency decoupling /
ECA attention mechanism
{{custom_sec.title}}
{{custom_sec.title}}
{{custom_sec.content}}
参考文献
[1] REN S, HE K, GIRSHICK R, et al.Faster R-CNN: Towards Real-time Object Detection with Region Proposal Networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137-1149.
[2] CARION N, MASSA F, SYNNAEVE G, et al.End-to-end object detection with transformers[C]// Computer Vision—ECCV 2020. Cham: Springer, 2020: 213-229.
[3] DOSOVITSKIY A, BEYER L, KOLESNIKOV A, et al.An Image is Worth 16×16 Words: Transformers for Image Recognition at Scale[C]// International Conference on Learning Representations. Austria: OpenReview.net, 2021: 1-22.
[4] ZOU Z, CHEN K, SHI Z, et al.Object Detection in 20 Years: A Survey[J]. IEEE Access, 2023, 111(3): 257-276.
[5] CHENG G, YUAN X, YAO X, et al.Towards Large-scale Small Object Detection: Survey and Benchmarks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2023, 45(11): 13467-13488.
[6] HAN K, WANG Y, TIAN Q, et al.GhostNet: More Features from Cheap Operations[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2020: 1580-1589.
[7] WANG Q, WU B, ZHU P, et al.ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2020: 11534-11542.
[8] LIN T Y, DOLLAR P, GIRSHICK R, et al.Feature Pyramid Networks for Object Detection[C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Honolulu: IEEE, 2017: 2117-2125.
[9] LIU S, QI L, QIN H, et al.Path Aggregation Network for Instance Segmentation[C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Salt Lake City: IEEE, 2018: 8759-8768.
[10] TANG Y, HAN K, GUO J, et al.GhostNetV2: Enhance Cheap Operation with Long-range Attention[C]// Proceedings of the 36th International Conference on Neural Information Processing Systems. Red Hook: Curran Associates Inc., 2022: 9969-9982.
[11] HU J, SHEN L, ALBANIE S, et al.Squeeze-and-excitation Networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020, 42(8): 2011-2023.
[12] ZHANG M, SONG G, LIU Y, et al.Decoupled DETR: Spatially Disentangling Localization and Classification for Improved End-to-end Object Detection[C]// Proceedings of the IEEE/CVF International Conference on Computer Vision. Paris: IEEE, 2023: 6601-6610.
[13] FENG C, ZHONG Y, GAO Y, et al.TOOD: Task-aligned One-stage Object Detection[C]// Proceedings of the IEEE/CVF International Conference on Computer Vision. Montreal: IEEE, 2021: 3510-3519.
[14] QIN Z, ZHANG P, WU F, et al.FcaNet: Frequency Channel Attention Networks[C]// Proceedings of the IEEE/CVF International Conference on Computer Vision. Montreal: IEEE, 2021: 783-792.
[15] CHEN Y, FAN H, XU B, et al.Drop an Octave: Reducing Spatial Redundancy in Convolutional Neural Networks with Octave Convolution[C]// Proceedings of the IEEE/CVF International Conference on Computer Vision. Seoul: IEEE, 2019: 3435-3444.
[16] ZHAO Y, LYU W, XU S, et al.DETRs Beat YOLOs on Real-time Object Detection[C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle: IEEE, 2024: 16965-16974.
[17] WANG A, CHEN H, LIU L, et al.YOLOv10: Real-time end-to-end object detection[C]// Advances in Neural Information Processing Systems 37. NewYork: Curran Associates, Inc., 2024: 107984-108011.
基金
数字化印刷装备北京市重点实验室建设项目(KYCPT202508); 人工智能在自动化专业教育教学的应用研究(22150226001)