School of Electrical and Information Engineering, Hubei University of Automotive Technology, Shiyan, China.
Qinyang Beisheng Pastoral Industry Co., Ltd., Qinyang, China.
PLoS One. 2024 Nov 7;19(11):e0313412. doi: 10.1371/journal.pone.0313412. eCollection 2024.
Sheep behavior recognition helps to monitor the health status of sheep and prevent the outbreak of infectious diseases. Aiming at the problems of low detection accuracy and slow speed due to the crowding of sheep in real farming scenarios, which can easily obscure each other, this study proposes a lightweight sheep behavior recognition model based on the YOLOv8n model. First, the Convolutional Block Attention Module (CBAM) is introduced and improved in the YOLOv8n model, and the channel attention module and spatial attention module are changed from serial to parallel to construct a novel attention mechanism, PCBAM, to enhance the network's attention to the sheep and eliminate redundant background information; second, the ordinary convolution in the backbone network is replaced with depth-separable convolution, which effectively reduces the number of parameters in the model and reduces the computational complexity. The study takes the housed breeding sheep as the test object, installs a camera diagonally above the sheep pen to collect images and makes a data set for testing, and in order to verify the superiority of the PD-YOLO model, compares it with a variety of target detection models. The experimental results show that the mean average precision (mAP) of the model proposed in this paper are 95.8%, 98.9%, and 96.2% for the three postures of sheep lying, feeding, and standing, respectively, which are 8.5%, 0.8%, and 0.8% higher than those of YOLOv8n, respectively, and the size of the model has been reduced by 13.3% and the amount of computation has been reduced by 12.1%. The inference speed reaches 52.1 FPS per second, which is better than other models in meeting the real-time detection requirement. To verify the practicality of this research method, the PD-YOLO model was deployed on the RK3399Pro development board for testing, and a high inference speed was achieved. It can provide effective technical support for sheep smart farming.
绵羊行为识别有助于监测绵羊的健康状况,预防传染病的爆发。针对实际养殖场景中由于绵羊拥挤而导致的检测精度低、速度慢的问题,容易相互遮挡,本研究提出了一种基于 YOLOv8n 模型的轻量级绵羊行为识别模型。首先,在 YOLOv8n 模型中引入并改进卷积注意力模块(CBAM),将通道注意力模块和空间注意力模块由串行改为并行,构建新的注意力机制 PCBAM,增强网络对绵羊的注意力,消除冗余背景信息;其次,在骨干网络中的普通卷积替换为深度可分离卷积,有效减少模型的参数量,降低计算复杂度。本研究以圈养绵羊为测试对象,在羊圈上方斜向安装摄像头采集图像,并制作测试数据集,为了验证 PD-YOLO 模型的优越性,与多种目标检测模型进行了比较。实验结果表明,本文提出的模型对绵羊卧、食、站三种姿态的平均精度(mAP)分别为 95.8%、98.9%和 96.2%,分别比 YOLOv8n 高 8.5%、0.8%和 0.8%,模型大小减小了 13.3%,计算量减少了 12.1%。推理速度达到 52.1 FPS/s,在满足实时检测要求方面优于其他模型。为验证本研究方法的实用性,将 PD-YOLO 模型部署在 RK3399Pro 开发板上进行测试,实现了较高的推理速度。可为绵羊智慧养殖提供有效的技术支持。