浙江农业学报 ›› 2025, Vol. 37 ›› Issue (7): 1556-1566.DOI: 10.3969/j.issn.1004-1524.20240333

• 生物系统工程 • 上一篇    下一篇

基于YOLOv8-Swin Transformer模型的翻覆肉鸭实时检测

吕胤春1,2(), 段恩泽2, 朱一星2, 郑霞2, 柏宗春2,3,*()   

  1. 1.江苏大学 农业工程学院,江苏 镇江 212000
    2.江苏省农业科学院 农业设施与装备研究所,江苏 南京 210014
    3.农业农村部长江中下游设施农业工程重点实验室,江苏 南京 210014
  • 收稿日期:2024-08-05 出版日期:2025-07-25 发布日期:2025-08-20
  • 作者简介:吕胤春(1997—),男,江苏高邮人,硕士,研究方向为畜禽养殖技术与装备。E-mail:18851730800@163.com
  • 通讯作者: *柏宗春,E-mail:vipmaple@126.com
  • 基金资助:
    江苏省农业科技自主创新资金“江苏现代农业重大核心技术创新”类项目(CX〔22〕1008)

Real-time detection of overturned meat ducks based on YOLOv8-Swin Transformer model

LYU Yinchun1,2(), DUAN Enze2, ZHU Yixing2, ZHENG Xia2, BAI Zongchun2,3,*()   

  1. 1. College of Agricultural Engineering, Jiangsu University, Zhenjiang 212000, Jiangsu, China
    2. Institute of Agricultural Facilities and Equipment, Jiangsu Academy of Agricultural Sciences, Nanjing 210014, China
    3. Key Laboratory of Protected Agriculture Engineering in the Middle and Lower Reaches of Yangtze River, Ministry of Agriculture and Rural Affairs, Nanjing 210014, China
  • Received:2024-08-05 Online:2025-07-25 Published:2025-08-20

摘要:

针对规模化养殖场笼内肉鸭个体小、易被遮挡,且肉鸭翻覆目标检测方法不易在嵌入式端部署等问题,提出一种适用于Jetson Orin端部署的肉鸭翻覆行为检测方法,在准确检测翻覆肉鸭目标的同时,轻量化部署模型,提高检测效率。使用1 000幅翻覆肉鸭图像建立数据集,按8∶1∶1划分为训练集、测试集和验证集。利用深度学习网络提取肉鸭翻覆行为特征,构建肉鸭翻覆行为目标检测模型。使用Swin Transformer-tiny模块替换YOLOv8的主干网络,有效提升复杂环境下的小目标检测能力,通过对模型进行剪枝与量化以减轻模型的复杂度,同时保持精度,较好地平衡了模型的准确性和速度。将优化后的模型部署在嵌入式端,当置信度阈值设定为60时,YOLOv8n-Swin Transformer和YOLOv8s-Swin Transformer模型对肉鸭翻覆的识别平均准确率分别为96.0%和97.1%,识别误检率分别为2.7%和2.0%,单帧图像处理时间分别为6.8 ms和7.4 ms。

关键词: 机器视觉, 翻覆肉鸭识别, 笼养肉鸭, 深度学习, 设施养殖

Abstract:

To address the challenges of detecting small and easily occluded meat ducks in cages within large-scale farms, as well as the difficulty of deploying existing detection methods for overturned ducks on embedded devices, this study proposes a detection method for identifying overturned meat ducks suitable for deployment on Jetson Orin. This approach ensures accurate detection of overturned ducks while achieving lightweight model deployment and improved detection efficiency. A dataset of 1 000 images of overturned meat ducks was constructed and divided into training, testing, and validation sets in an 8∶1∶1 ratio. A deep learning network was employed to extract behavioral features of overturned ducks and build a target detection model. The Swin Transformer-tiny module was integrated to replace the backbone network of YOLOv8, significantly enhancing the detection capability for small targets in complex environments. Model pruning and quantization were applied to reduce computational complexity while maintaining accuracy, achieving a better balance between model precision and speed. When deploying the optimized models on embedded devices with a confidence threshold set to 60, the YOLOv8n-Swin Transformer and YOLOv8s-Swin Transformer models demonstrated average recognition accuracies of 96.0% and 97.1%, respectively, for detecting overturned meat ducks. Their false recognition rates were 2.7% and 2.0%, while the single-frame image processing times measured 6.8 ms and 7.4 ms, respectively.

Key words: machine vision, overturned meat duck recognition, caged meat duck, deep learning, facility breeding

中图分类号: