Liang Ziyuan, Xu Aijun, Ye Junhua, Zhou Suyin, Weng Xiaoxing, Bao Sian
School of Mathematics and Computer Science, Zhejiang Agriculture and Forestry University, Hangzhou 311300, China.
School of Environmental and Resource Science, Zhejiang Agriculture and Forestry University, Hangzhou 311300, China.
Animals (Basel). 2024 Oct 16;14(20):2985. doi: 10.3390/ani14202985.
Continuous movement monitoring helps quickly identify pig abnormalities, enabling immediate action to enhance pig welfare. However, continuous and precise monitoring of daily pig movement on farms remains challenging. We present an approach to automatically and precisely monitor the movement of group-housed pigs. The instance segmentation model YOLOv8m-seg was applied to detect the presence of pigs. We then applied a spatial moment algorithm to quantitatively summarize each detected pig's contour as a corresponding center point. The agglomerative clustering (AC) algorithm was subsequently used to gather the pig center points of a single frame into one point representing the group-housed pigs' position, and the movement volume was obtained by calculating the displacements of the clustered group-housed pigs' center points of consecutive frames. We employed the method to monitor the movement of group-housed pigs from April to July 2023; more than 1500 h of top-down pig videos were recorded by a surveillance camera. The F1 scores of the trained YOLOv8m-seg model during training were greater than 90% across most confidence levels, and the model achieved an mAP50-95 of 0.96. The AC algorithm performs with an average extraction time of less than 1 millisecond; this method can run efficiently on commodity hardware.
持续运动监测有助于快速识别猪的异常情况,从而能够立即采取行动提高猪的福利。然而,在农场中对猪的日常运动进行持续且精确的监测仍然具有挑战性。我们提出了一种自动且精确地监测群养猪运动的方法。实例分割模型YOLOv8m-seg被用于检测猪的存在。然后,我们应用空间矩算法将每个检测到的猪的轮廓定量总结为一个相应的中心点。随后,凝聚聚类(AC)算法被用于将单帧中的猪中心点聚合成一个代表群养猪位置的点,并通过计算连续帧中聚类后的群养猪中心点的位移来获得运动量。我们使用该方法在2023年4月至7月期间监测群养猪的运动;监控摄像头记录了超过1500小时的自上而下的猪的视频。训练期间,经过训练的YOLOv8m-seg模型在大多数置信水平下的F1分数均大于90%,该模型的mAP50-95为0.96。AC算法的平均提取时间不到1毫秒;该方法可以在商用硬件上高效运行。