基于BiFPN和Triplet注意力机制的YOLOv5s缺陷苹果识别算法

  • 打印
  • 收藏
收藏成功


打开文本图片集

中图分类号:TP391.4;S225.93 文献标志码:A 文章编号:1001-411X(2025)03-0419-10

A YOLOv5s algorithm based on BiFPN and Triplet attention mechanism for identifing defective apple

HUI Yongyong1², ZHAO Chunyu', SONG Zhaoyang1², ZHAO Xiaoqiang12 (1 Colleg ofElectricalEngieeigandInformationEnginering,Lanzou Unversityofechnology,Lanzhou730,Ca; 2 National Experimental Teaching Center of Electrical and Control Engineering,Lanzhou University of Technology,Lanzhou , China)

Abstract: 【Objective】 In order to make full use of context information and integrate multi-scale features, a YOLOv5s algorithm based on BiFPN and Triplet attention mechanism (BTF-YOLOv5s) for identifing defective apple was proposed. 【Method】 Firstly, the additional weights were introduced to the weighted bidirectional feature pyramid network ( BiFPN) to learn the importance of diferent input features. The model realized the repeated fusion of multi-scale features through the top-down and bottom-up bidirectional paths, and improved the multi-scale detection ability. Secondly,the Triplet attention mechanism was applied to the Neck layer to enhance the model's ability to represent the correlation between target and contextual information,so that the model could focus more on the learning of apple features. Finally,the Focal-CIoU loss function was used to adjust the loss weight,so thatthe model payed more atention todefective apple recognition,and improved the perception ability of the model. Different loss functions were compared through ablation experiments.The position of attntion mechanism in YOLOv5 structure was changed, and compared with the mainstream algorithms. 【Result】 On the basis of the initial YOLOv5s model,BTF-YOLOv5s improved the accuracy,recall and mAP by 5.7, 2.2 and 3.5 percentage points respectively,and the memory usage of the model was 1 4 . 7 M B The average accuracy of BTF-YOLOv5s was 5.7,3.5,13.3,3.5,2.9,2.6,2.8 and 0.3 percentage points higher than those of SSD, YOLOv3, YOLOv4, YOLOv5s, YOLOv7, YOLOv8n, YOLOv8s and YOLOv9, respectively. 【Conclusion】 The model of BTF-YOLOv5s shows significant superiority in identifing defective apples, which provides certain technical support for the picking robot to realize the automatic sorting of highquality apples and defective apples in the picking process.

Key words: YOLOv5s; Defective apple; Atention mechanism; Loss function; Object detection; Picking robot

苹果作为一种常见的水果,其质量问题直接关系到消费者的健康和生产者的经济利益。(剩余13706字)

monitor