School of Information and Computer, Anhui Agricultural University, Hefei 230036, China.
Institute of Intelligent Machines, Chinese Academy of Sciences, Hefei 230031, China.
Sensors (Basel). 2023 Nov 3;23(21):8952. doi: 10.3390/s23218952.
The existing algorithms for identifying and tracking pigs in barns generally have a large number of parameters, relatively complex networks and a high demand for computational resources, which are not suitable for deployment in embedded-edge nodes on farms. A lightweight multi-objective identification and tracking algorithm based on improved YOLOv5s and DeepSort was developed for group-housed pigs in this study. The identification algorithm was optimized by: (i) using a dilated convolution in the YOLOv5s backbone network to reduce the number of model parameters and computational power requirements; (ii) adding a coordinate attention mechanism to improve the model precision; and (iii) pruning the BN layers to reduce the computational requirements. The optimized identification model was combined with DeepSort to form the final Tracking by Detecting algorithm and ported to a Jetson AGX Xavier edge computing node. The algorithm reduced the model size by 65.3% compared to the original YOLOv5s. The algorithm achieved a recognition precision of 96.6%; a tracking time of 46 ms; and a tracking frame rate of 21.7 FPS, and the precision of the tracking statistics was greater than 90%. The model size and performance met the requirements for stable real-time operation in embedded-edge computing nodes for monitoring group-housed pigs.
现有的猪圈猪只识别与跟踪算法通常具有大量的参数、相对复杂的网络结构以及对计算资源的高要求,这使得它们不适合部署在农场嵌入式边缘节点上。本研究针对群体饲养的猪只,开发了一种基于改进的 YOLOv5s 和 DeepSort 的轻量级多目标识别与跟踪算法。通过以下方式优化识别算法:(i)在 YOLOv5s 骨干网络中使用扩张卷积来减少模型参数数量和计算需求;(ii)添加坐标注意力机制以提高模型精度;(iii)剪枝 BN 层以降低计算需求。优化后的识别模型与 DeepSort 相结合,形成最终的检测跟踪算法,并移植到 Jetson AGX Xavier 边缘计算节点上。与原始的 YOLOv5s 相比,该算法的模型大小减小了 65.3%。该算法的识别精度为 96.6%,跟踪时间为 46ms,跟踪帧率为 21.7FPS,跟踪统计的精度大于 90%。模型大小和性能满足在嵌入式边缘计算节点上稳定实时运行以监测群体饲养猪只的要求。