基于改进YOLOv5l的轻量化鸭蛋裂纹检测算法

    Lightweight detection algorithm for duck egg cracks based on improved YOLOv5l

    • 摘要: 鸭蛋裂纹检测技术对于禽蛋加工工厂实现智能化蛋品检测、分级具有重要意义。该研究针对鸭蛋裂纹检测流程复杂、计算量大、模型尺寸大等问题,提出了一种基于改进YOLOv5l(you only look once version5 large)的轻量裂纹检测算法,通过在黑暗条件下使用LED灯照射鸭蛋,根据裂纹蛋壳与完好蛋壳透光性不同产生的图像差异进行检测。通过在YOLOv5中引入Ghost_conv模块,大大减少了模型的浮点计算量和参数量,并在模型的骨干网络中加入ECA(efficient channel attention)注意力机制以及使用多尺度特征融合方法BIFPN(bi-directional feature pyramid network),增加模型对有效信息的关注度,以提高算法检测精度。同时使用CIoU与α-IoU损失函数融合后替代YOLOv5原始GIoU函数加速回归预测。利用自建的鸭蛋裂纹数据集验证改进后模型的性能,结果表明,本研究提出的改进YOLOv5l网络模型检测精准率为93.8%,与原始YOLOv5l模型相比,检测精度提高了6.3个百分点,参数量和浮点计算量分别减少了30.6%、39.4%。检测帧速率为28.954帧/s,较原始YOLOv5l模型仅下降3.824帧/s。与其他的目标检测常用网络SSD(single shot multibox detector)、YOLOv4、Faster-RCNN(faster region convolutional neural networks)相比,精度分别提高了13.1、12.5、8.2个百分点。本研究提出的方法能够在低硬件资源条件下进行高精度检测,可为实际场景应用提供解决方案和技术支持。

       

      Abstract: Accurate and rapid crack detection has been one of the most important steps in duck eggs before processing. The shell of duck eggs may crack, particularly when subjected to the vibration, extrusion, and collision during production, transportation, packaging and storage. The microorganism can then invade through the crack, easy to cause the deterioration of duck eggs. Furthermore, the damage of one duck egg can greatly affect the processing requirements of the whole batch. However, manual detection cannot fully meet the large-scale production in recent years, due to the unstable accuracy rate, low efficiency and industrialization in the poultry egg industry at present. In this study, a lightweight detection was proposed for the multi-column cracks of duck eggs using improved YOLOv5l (you only look once version5 large). The better detection of duck egg was achieved in the simple, small amount of calculation and storage. A LED light was used to illuminate the duck egg under dark conditions. There was the difference of light transmittance between cracked eggshell and intact eggshell. Specifically, the Ghost_conv module was introduced to replace the original convolution in YOLOv5. The calculation and parameters of model were greatly reduced to increase the training speed with more lightweight. In addition, ECA (efficient channel attention) attention mechanism was added to the backbone Network and BIFPN (bi-directional feature pyramid network). The effective information was detected using the attention mechanism. Among them, the BIFPN was used to extract and fuse some features at different scales. The accuracy of model was improved to reduce the missing and wrong detection. At the same time, the fusion of CIoU and α-IoU loss function was used to replace the original GIoU function of YOLOv5, thus accelerating the regression prediction. A dataset of duck egg was obtained with 892 images, where a camera was used to capture duck eggs rolling on a conveyor. The dataset was then enhanced by random cropping, adding noise and mixup, in order to further improve the generalization and robustness of the model. The self-developed dataset of duck egg cracks was utilized to verify the detection performance of the improved model. The results show that the improved YOLOv5l network model shared the high performance. The detection accuracy of the improved model on the test set was 93.8%, which was 6.3 percentage points higher than that of the original YOLOv5l model. The number of parameters, floating point arithmetic and the occupied storage was reduced by 30.6%, 39.4% and 34.6%, respectively. The frame rate of detection was 28.954 frames /s, which was only 3.824 frames /s lower than the original YOLOv5l model. The detection accuracy of the improved YOLOv5l increased by 13.1, 12.5 and 8.2 percentage points, respectively, compared with the common target detection networks, such as single shot MultiBox detector (SSD), YOLOv4, and faster-RCNN (faster region convolutional neural networks). The high-precision detection with the low hardware resources can be expected to provide the promising solutions and technical applications.

       

    /

    返回文章
    返回