作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2025, Vol. 51 ›› Issue (3): 320-333. doi: 10.19678/j.issn.1000-3428.0070049

• 开发研究与工程应用 • 上一篇    下一篇

基于域自适应NWD-YOLOv5的复杂环境下水稻幼苗计数

崔金荣1, 叶伟浩1, 郑鸿1, 刘同来2, 齐龙3, 徐勇4,*()   

  1. 1. 华南农业大学数学与信息学院, 广东 广州 510642
    2. 仲恺农业工程学院信息科学与技术学院, 广东 广州 510550
    3. 华南农业大学水利与土木工程学院, 广东 广州 510642
    4. 哈尔滨工业大学(深圳)计算机科学与技术学院, 广东 深圳 518055
  • 收稿日期:2024-06-27 出版日期:2025-03-15 发布日期:2024-09-11
  • 通讯作者: 徐勇
  • 基金资助:
    广东省重点领域研发计划项目(2023B0202130001); 国家水稻产业技术体系建设专项基金(CARS-01); 岭南现代农业实验室科研项目(NT2021009); 广东省杰出青年基金(2019B151502056); 2023年广东省自然科学基金面上项目(2023A1515011230); 广东省安全智能新技术重点实验室项目(2022B1212010005)

Rice Seedling Counting in Complex Environments Based on Domain-Adaptive NWD-YOLOv5

CUI Jinrong1, YE Weihao1, ZHENG Hong1, LIU Tonglai2, QI Long3, XU Yong4,*()   

  1. 1. College of Mathematics and Informatics, South China Agricultural University, Guangzhou 510642, Guangdong, China
    2. College of Information Science and Technology, Zhongkai University of Agriculture and Engineering, Guangzhou 510550, Guangdong, China
    3. College of Water Resources and Civil Engineering, South China Agricultural University, Guangzhou 510642, Guangdong, China
    4. School of Computer Science and Technology, Harbin Institute of Technology (Shenzhen), Shenzhen 518055, Guangdong, China
  • Received:2024-06-27 Online:2025-03-15 Published:2024-09-11
  • Contact: XU Yong

摘要:

水稻种植初期经常会遇到绿色水藻等干扰微小水稻幼苗计数的复杂环境, 使得微小水稻幼苗与背景难以区分, 容易造成检测计数模型性能显著下降, 然而目前通用的深度学习方法无法应对复杂跨域场景下的水稻幼苗检测计数任务。为此, 提出一种基于平均教师的域自适应NWD-YOLOv5模型, 以解决无人机视角下的复杂环境微小水稻幼苗计数问题。为了提高模型对复杂背景下微小幼苗的检测计数能力, 将基于平均教师模型的半监督域自适应训练策略集成到YOLOv5网络中, 并且在YOLOv5的损失中使用基于归一化高斯Wasserstein距离(NWD)的预测框度量方法, 来提高微小目标的正负样本分配准确性。实验结果表明: 与原始的YOLOv5模型相比, 改进模型泛化性能大幅提升, mAP@0.5值从60.0%提升到95.9%;与经典目标检测模型相比, 所提的域自适应模型在mAP、模型大小和检测速度等指标上均有着较大优势; 与传统人工方法相比, 所提水稻幼苗计数方法准确率达到98.6%, 计数时间仅为人工方法的1/5, 决定系数R2达到了0.900 3;所提域自适应模型与监督学习方法Oracle性能接近, 并且性能明显优于基准方法Source Only。所提方法可以大幅提高复杂多变环境下水稻植株计数的精度, 能够作为水稻作物管理方法的技术支撑。

关键词: 水稻幼苗计数, 平均教师模型, 目标检测, YOLOv5, 多目标跟踪

Abstract:

Complex environments, such as green algae, that interfere with the counting of microscopic rice seedlings are often encountered in the early stages of rice cultivation, making it difficult to distinguish microscopic rice seedlings from the background, which can in turn degrade the performance of detection and counting models. However, current general-purpose deep learning methods face challenges in detecting tiny seedlings in complex cross-domain scenarios. Therefore, this paper proposes a domain-adaptive Normalized Gaussian Wasserstein Distance (NWD)-YOLOv5 model based on Mean Teacher to solve the problem of counting tiny rice seedlings from the perspective of an Unmanned Aerial Vehicle (UAV). To improve the detection and counting ability of tiny seedlings in complex backgrounds, a semi-supervised domain-adaptive training strategy based on the Mean Teacher model is integrated into the YOLOv5 network. Furthermore, as the loss function of YOLOv5, a prediction box metric based on NWD is used to improve the accuracy of positive and negative sample assignment for tiny objects. Experimental results show that the improved model has better generalizability compared with the original YOLOv5 model. The mAP@0.5 increases from 60.0% to 95.9%. Compared with other object detection models, the proposed domain adaptive model has greater advantages. Compared with the traditional manual method, the designed rice seedling counting method has an accuracy of 98.6%, achieves an R2 value of 0.900 3, and requires only one-fifth of the counting time required by the manual method. Ablation experiments show that the proposed domain-adaptive model achieves a performance that is comparable to that of Oracle, a supervised learning method, and is significantly superior to that of Source Only, a baseline method. This study provides insights to improve the accuracy of rice plant counting in complex and variable application environments and can serve as technical support for rice crop management methods.

Key words: rice seedling counting, Mean Teacher model, object detection, YOLOv5, multi-object tracking