中国农业科技导报 ›› 2025, Vol. 27 ›› Issue (7): 111-121.DOI: 10.13304/j.nykjdb.2024.0025

• 智慧农业 农机装备 • 上一篇    

融合动态稀疏注意力的茶叶分类检测

张世浩1,2(), 夏宇薪2, 吴文斗3, 谢瑾1, 陈逍4, 施皓天1, 樊宗毓1, 王白娟1()   

  1. 1.云南农业大学茶学院,昆明 650201
    2.云南农业大学机电工程学院,昆明 650201
    3.云南农业大学大数据学院,昆明 650201
    4.云南农业大学,云南省高校智能有机茶园建设重点实验室,昆明 650201
  • 收稿日期:2024-01-10 接受日期:2024-04-11 出版日期:2025-07-15 发布日期:2025-07-11
  • 通讯作者: 王白娟
  • 作者简介:张世浩 E-mail:18637905872@163.com
  • 基金资助:
    国家重点研发计划项目(2022YFD1601803);国家自然科学基金项目(32060702);云南省基础研究专项重点项目(202301AS070083);云南省重大专项(202302AE090020);云南省乡村振兴科技专项-科技特派团(队)项目(202304BI090013)

Classification and Detection of Tea Based on Dynamic Sparse Attention

Shihao ZHANG1,2(), Yuxin XIA2, Wendou WU3, Jin XIE1, Xiao CHEN4, Haotian SHI1, Zongyu FAN1, Baijuan WANG1()   

  1. 1.College of Tea Science,Yunnan Agricultural University,Kunming 650201,China
    2.College of Mechanical and Electrical Engineering,Yunnan Agricultural University,Kunming 650201,China
    3.College of Big Data,Yunnan Agricultural University,Kunming 650201,China
    4.Yunnan Province University Intelligent Organic Tea Garden Construction Primary Laboratory,Yunnan Agricultural University,Kunming 650201,China
  • Received:2024-01-10 Accepted:2024-04-11 Online:2025-07-15 Published:2025-07-11
  • Contact: Baijuan WANG

摘要:

为解决采茶机器人对茶叶的精准检测和采摘问题,提出一种基于双层路由动态稀疏注意力机制和FasterNet改进的YOLOv7算法,以实现对茶叶鲜叶的分类检测。该算法通过PConv和FasterNet替换原有网络结构,减少浮点运算的数量、提升浮点运算效率;在neck层加入基于双层路由的动态稀疏注意力机制,使计算分配和内容感知更灵活;将损失函数替换为EIoU(efficient intersection over union),加速收敛提高回归精度,减少检测过程中的误检。结果表明,改进算法生成的模型比YOLOv7在精确度上提升4.8个百分点,召回率提升5.3个百分点,平衡分数提高5.0个百分点,平均精度均值(mean average precision,mAP)提升2.6个百分点;且在外部验证中浮点运算数量降低15.1 G,每秒传输帧数提升5.52%,mAP提升2.4个百分点。改进后的模型不仅可以高效准确地对茶叶鲜叶进行分类检测,同时具备高识别率、低运算量和快速检测的特点。研究结果为云南高原山地采茶机器人的实现奠定了基础。

关键词: 茶叶, 双层路由动态稀疏注意力机制, 精准检测, FasterNet, YOLOv7

Abstract:

In order to effectively address the challenge of precisely detecting and selecting tea leaves with a tea-picking robot, an improved YOLOv7 algorithm based on double-layer routing dynamic sparse attention mechanism and FasterNet was proposed to realize the classification and detection of fresh tea leaves. The algorithm implemented involves replacing the original network’s structure with PConv and FasterNet methodologies. This replacement was aimed at decreasing the number of floating-point operations and enhancing their efficiency. Additionally, a dynamic sparse attention mechanism, which was based on a double-layer routing approach, was incorporated into the neck layer. This addition ensured greater flexibility in computing allocation and content perception. To expedite convergence, enhance regression accuracy, and minimize false detection, the loss function was substituted with efficient intersection over union(EIoU)during the detection process. The results showed that, compared with the original YOLOv7, the model generated by the improved algorithm improved the accuracy by 4.8 percentage point, the recall rate by 5.3 percentage point, the balance score by 5.0 percentage point, and the mean average precision(mAP) value by 2.6 percentage point. In the external verification, the number of floating-point operations was reduced by 15.1 G, the frame per second was increased by 5.52%, and the mAP value was increased by 2.4 percentage point. The improved model could not only classify and detect fresh tea leaves efficiently and accurately, but also had the characteristics of high recognition rate, low computation and fast detection. Above results laid a foundation for the realization of tea picking robot in Yunnan plateau.

Key words: tea, vision transformer with Bi-level routing attention, accurate detection, FasterNet, YOLOv7

中图分类号: