YOLOv8-BS: An integrated method for identifying stationary and moving behaviors of cattle with a newly developed datasetarchive.org - Md Ishtiaq Ahmed; Huiping Cao; Andrés Ricardo Perea; Mehmet Emin Bakir; Huiying Chen; Santiago A. Utsumi (Smart Agricultural Technology)
Enhanced identification of cattle behavior can significantly improve animal welfare, support preventive health management, and optimize daily operations. Advances in computer vision (CV) and deep learning have shown great potential to enhance the robustness and sophistication of modern animal monitoring systems. This study introduces YOLOv8-Background Subtraction (YOLOv8-BS), a novel approach combining the CV model YOLOv8, a background subtraction module from OpenCV, and a behavior-counting component to classify four key behaviors in free roaming cattle: standing, feeding, resting (lying), and walking (moving). To train and evaluate the model, a new benchmark dataset of 92,592 labeled video frames, obtained from videos recorded from 11/2023 to 12/2023, with a balanced distribution of the targeted behaviors was curated. While the YOLOv8 model excelled in identifying stationary postures, it faced significant challenges when detecting animal motion. Conversely, the use of YOLOv8-BS, which applied OpenCV’s background subtraction model on YOLOv8, enhanced the detection of walking, with a 20 % increase in precision, a 13 % boost in recall and an 18 % improvement in F1 score compared to the YOLOv8. YOLOv8-BS achieved 89 % precision and 88 % recall for ‘standing’, 100 % precision and 90 % recall for ‘resting’, 86 % of precision and recall for ‘feeding’ and 74 % precision and 72 % recall for ‘walking’, respectively. Datasets curated for this study fill in the gaps of currently available datasets that primarily emphasize the detection of stationary behaviors of cattle in confined environments or one or a few specific behaviors within an individual video frame. This dataset is available online for research purposes.