• Chinese Core Journal
  • Chinese Science Citation Database (CSCD) Source journal
  • Journal of Citation Report of Chinese S&T Journals (Core Edition)
HUI Yongyong, ZHAO Chunyu, SONG Zhaoyang, et al. A YOLOv5s algorithm based on BiFPN and Triplet attention mechanism for identifing defective apple[J]. Journal of South China Agricultural University, 2025, 46(3): 419-428. DOI: 10.7671/j.issn.1001-411X.202407012
Citation: HUI Yongyong, ZHAO Chunyu, SONG Zhaoyang, et al. A YOLOv5s algorithm based on BiFPN and Triplet attention mechanism for identifing defective apple[J]. Journal of South China Agricultural University, 2025, 46(3): 419-428. DOI: 10.7671/j.issn.1001-411X.202407012

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

More Information
  • Received Date: July 09, 2024
  • Available Online: March 02, 2025
  • Published Date: March 05, 2025
  • 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 different 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 that the model payed more attention to defective apple recognition, and improved the perception ability of the model. Different loss functions were compared through ablation experiments. The position of attention 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 14.7 MB. 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 high-quality apples and defective apples in the picking process.

  • [1]
    牛桂草, 宋卓展, 刘畅, 等. 中国苹果贸易竞争力评价与分析[J]. 河北农业科学, 2022, 26(3): 97-100.
    [2]
    李大华, 孔舒, 李栋, 等. 基于改进YOLOv7的苹果表面缺陷轻量化检测算法[J]. 河南农业科学, 2024, 53(3): 141-150.
    [3]
    李大华, 赵辉, 于晓. 基于改进谱聚类的重叠绿苹果识别方法(英文)[J]. 光谱学与光谱分析, 2019, 39(9): 2974-2981.
    [4]
    王迎超, 张婧婧, 贾东霖, 等. 基于K-means聚类和改进MLP的苹果分级研究[J]. 河南农业科学, 2023, 52(1): 161-171.
    [5]
    宋怡焕, 饶秀勤, 应义斌. 基于DT-CWT和LS-SVM的苹果果梗/花萼和缺陷识别[J]. 农业工程学报, 2012, 28(9): 114-118.
    [6]
    张震, 周俊, 江自真, 等. 基于改进YOLO v7轻量化模型的自然果园环境下苹果识别方法[J]. 农业机械学报, 2024, 55(3): 231-242. doi: 10.6041/j.issn.1000-1298.2024.03.023
    [7]
    袁杰, 谢霖伟, 郭旭, 等. 基于改进YOLO v7的苹果叶片病害检测方法[J]. 农业机械学报, 2024, 55(11): 68-74.
    [8]
    张莉, 王晓格, 鲍春, 等. 轻量级多任务的苹果成熟度分类模型(特邀)[J]. 激光与光电子学进展, 2024, 61(20): 141-149.
    [9]
    闫彬, 樊攀, 王美茸, 等. 基于改进YOLOv5m的采摘机器人苹果采摘方式实时识别[J]. 农业机械学报, 2022, 53(9): 28-38.
    [10]
    张阳婷, 黄德启, 王东伟, 等. 基于深度学习的目标检测算法研究与应用综述[J]. 计算机工程与应用, 2023, 59(18): 1-13.
    [11]
    REN S Q, HE K M, 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. doi: 10.1109/TPAMI.2016.2577031
    [12]
    HE K, GKIOXARI G, DOIIAR P, et al. Mask R-CNN [C]//Proceedings of the IEEE International Conference on Computer Vision(ICCV). Venice: IEEE, 2017: 2961-2969.
    [13]
    LIN T Y, GOYAL P, GIRSHICK R, et al. Focal loss for dense object detection[C]// Proceedings of the IEEE International Conference on Computer Vision (ICCV). Venice: IEEE, 2017: 2999-3007.
    [14]
    LIU W, ANGUELOV D, ERHAN D, et al. SSD: Single shot MultiBox detector[C]// Computer Vision – ECCV 2016. Cham: Springer International Publishing, 2016: 21-37.
    [15]
    LIU X D, GONG W Y, SHANG L L, et al. Remote sensing image target detection and recognition based on YOLOv5[J]. Remote Sensing, 2023, 15(18): 4459. doi: 10.3390/rs15184459
    [16]
    LI C, LI L, JIANG H, et al. YOLOv6: A single-stage object detection framework for industrial applications[EB/OL]. arXiv: 2209.02976. (2022-09-07)[2024-06-18]. https://doi.org/10.48550/arXiv.2209.02976.
    [17]
    WANG C Y, BOCHKOVSKIY A, LIAO H M. YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[C]//2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Vancouver: IEEE, 2023: 7464-7475.
    [18]
    TIAN L L, ZHANG H X, LIU B, et al. VMF-SSD: A novel V-space based multi-scale feature fusion SSD for apple leaf disease detection[J]. IEEE/ACM Transactions on Computational Biology and Bioinformatics, 2023, 20(3): 2016-2028. doi: 10.1109/TCBB.2022.3229114
    [19]
    WANG D D, HE D J. Channel pruned YOLO V5s-based deep learning approach for rapid and accurate apple fruitlet detection before fruit thinning[J]. Biosystems Engineering, 2021, 210: 271-281. doi: 10.1016/j.biosystemseng.2021.08.015
    [20]
    化春键, 孙明春, 蒋毅, 等. 基于改进YOLOv7-tiny的多光谱苹果表层缺陷检测[J]. 激光与光电子学进展, 2024, 61(10): 236-244.
    [21]
    朱琦, 周德强, 盛卫锋, 等. 基于DSCS-YOLO的苹果表面缺陷检测方法[J]. 南京农业大学学报, 2024, 47(3): 592-601.
    [22]
    LIN T Y, DOLLAR P, GIRSHICK R, et al. Feature pyramid networks for object detection[C]//2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Honolulu: IEEE, 2017: 936-944.
    [23]
    LIU S, QI L, QIN H F, et al. Path aggregation network for instance segmentation[C]//2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City: IEEE, 2018: 8759-8768.
    [24]
    TAN M X, PANG R M, LE Q V. EfficientDet: Scalable and efficient object detection[C]//2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Seattle: IEEE, 2020: 10778-10787.
    [25]
    HU J, SHEN L, SUN G. Squeeze-and-excitation networks[C]//2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City: IEEE, 2018: 7132-7141.
    [26]
    WOO S, PARK J, LEE J Y, et al. CBAM: Convolutional block attention module[C]// Computer Vision – ECCV 2018. Cham: Springer International Publishing, 2018: 3-19.
    [27]
    MISRA D, NALAMADA T, ARASANIPALAI A U, et al. Rotate to attend: Convolutional triplet attention module[C]//2021 IEEE Winter Conference on Applications of Computer Vision (WACV). Waikoloa: IEEE, 2021: 3138-3147.
    [28]
    LIN T Y, GOYAL P, GIRSHICK R, et al. Focal loss for dense object detection[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020, 42(2): 318-327. doi: 10.1109/TPAMI.2018.2858826
    [29]
    ZHENG Z H, WANG P, LIU W, et al. Distance-IoU loss: Faster and better learning for bounding box regression[J]. Proceedings of the AAAI Conference on Artificial Intelligence, 2020, 34(7): 12993-13000. doi: 10.1609/aaai.v34i07.6999

Catalog

    Article views (50) PDF downloads (10) Cited by()

    /

    DownLoad:  Full-Size Img  PowerPoint
    Return
    Return