De Castro Angelo L, Wang Jin, Bonney-King Jessica G, Morota Gota, Miller-Cushon Emily K, Yu Haipeng
Department of Animal Sciences, University of Florida, Gainesville, FL 32611.
Laboratory of Biometry and Bioinformatics, Department of Agricultural and Environmental Biology, Graduate School of Agricultural and Life Sciences, The University of Tokyo, Bunkyo, Tokyo 113-8657, Japan.
JDS Commun. 2025 Mar 3;6(3):416-421. doi: 10.3168/jdsc.2024-0706. eCollection 2025 May.
Monitoring the movement patterns of dairy cattle can provide important insight into space utilization or space occupancy in a barn. Although several precision livestock technologies have been developed to record dairy cattle movements, there is a lack of open-source tools to track and visualize group-level cattle movement patterns. Therefore, we developed an open-source computer vision software tool, AnimalMotionViz, that allows users to track and visualize group-level dairy cattle movement patterns using motion maps. The software comes with an easy-to-use web-based graphical user interface built with the Python Dash package. It implements a set of background subtraction algorithms in the OpenCV package to track animal motion patterns in real time. The software processes each frame of the input video and identifies the background and foreground using these algorithms. Foreground objects are then subtracted from the background across all frames and cumulatively overlaid on an empty mask image created with the first frame of the input video to visualize the intensity or frequency of motion across different regions. The user can generate a space-use distribution map in an image and video, a core and full-range map in an image, and also track specific regional motion with a custom mask. The software also returns the top 3 peak intensity locations, the total percentage of regions used, and the within-quadrant percentage of regions used. In four 5-min sample videos, quadrants with peak intensity of space use, as identified using the software, aligned with quadrants where calves spent the greatest duration of time, according to continuous recording of behavior from video. The space-use distribution and core and full-range maps generated by AnimalMotionViz can be used to understand space utilization or space occupation by dairy cattle, as well as to assess how space allocation affects their movement. Although AnimalMotionViz was developed to analyze dairy cattle data, its design provides the potential for broader application in studying the movement patterns of other animal species. We conclude that the newly developed AnimalMotionViz is a user-friendly and efficient tool to support research developments in precision livestock farming toward enhancing cattle management practices and improving pen designs.
监测奶牛的运动模式可以为了解牛舍内的空间利用或空间占用情况提供重要见解。尽管已经开发了多种精准畜牧技术来记录奶牛的运动,但缺乏用于跟踪和可视化群体水平奶牛运动模式的开源工具。因此,我们开发了一款开源计算机视觉软件工具AnimalMotionViz,它允许用户使用运动地图来跟踪和可视化群体水平的奶牛运动模式。该软件配备了一个使用Python Dash包构建的易于使用的基于网络的图形用户界面。它在OpenCV包中实现了一组背景减法算法,以实时跟踪动物的运动模式。该软件处理输入视频的每一帧,并使用这些算法识别背景和前景。然后,将所有帧中的前景对象从背景中减去,并累积叠加在使用输入视频的第一帧创建的空掩码图像上,以可视化不同区域的运动强度或频率。用户可以在图像和视频中生成空间使用分布图、在图像中生成核心和全范围图,还可以使用自定义掩码跟踪特定区域的运动。该软件还会返回前3个峰值强度位置、使用区域的总百分比以及象限内使用区域的百分比。在四个5分钟的样本视频中,根据视频中行为的连续记录,使用该软件确定的空间使用峰值强度象限与小牛花费最长时间的象限一致。AnimalMotionViz生成的空间使用分布、核心和全范围图可用于了解奶牛的空间利用或空间占用情况,以及评估空间分配如何影响它们的运动。尽管AnimalMotionViz是为分析奶牛数据而开发的,但其设计为更广泛地应用于研究其他动物物种的运动模式提供了潜力。我们得出结论,新开发的AnimalMotionViz是一个用户友好且高效的工具,可支持精准畜牧养殖的研究发展,以加强奶牛管理实践并改进牛舍设计。