Angelo L. De Castro , Jin Wang , Jessica G. Bonney-King , Gota Morota , Emily K. Miller-Cushon , Haipeng Yu
{"title":"AnimalMotionViz: An interactive software tool for tracking and visualizing animal motion patterns using computer vision","authors":"Angelo L. De Castro , Jin Wang , Jessica G. Bonney-King , Gota Morota , Emily K. Miller-Cushon , Haipeng Yu","doi":"10.3168/jdsc.2024-0706","DOIUrl":null,"url":null,"abstract":"<div><div>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.</div></div>","PeriodicalId":94061,"journal":{"name":"JDS communications","volume":"6 3","pages":"Pages 416-421"},"PeriodicalIF":0.0000,"publicationDate":"2025-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"JDS communications","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S2666910225000183","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
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.