CVB: A Video Dataset of Cattle Visual Behaviors

Ali Zia, Renuka Sharma, Reza Arablouei, Greg Bishop-Hurley, Jody McNally, Neil Bagnall, Vivien Rolland, Brano Kusy, Lars Petersson, Aaron InghamarXiv 2023

Abstract

Existing image/video datasets for cattle behavior recognition are mostly small, lack well-defined labels, or are collected in unrealistic controlled environments. This limits the utility of machine learning (ML) models learned from them. Therefore, we introduce a new dataset, called Cattle Visual Behaviors (CVB), that consists of 502 video clips, each fifteen seconds long, captured in natural lighting conditions, and annotated with eleven visually perceptible behaviors of grazing cattle. We use the Computer Vision Annotation Tool (CVAT) to collect our annotations. To make the procedure more efficient, we perform an initial detection and tracking of cattle in the videos using appropriate pre-trained models. The results are corrected by domain experts along with cattle behavior labeling in CVAT. The pre-hoc detection and tracking step significantly reduces the manual annotation time and effort. Moreover, we convert CVB to the atomic visual action (AVA) format and train and evaluate the popular SlowFast action recognition model on it. The associated preliminary results confirm that we can localize the cattle and recognize their frequently occurring behaviors with confidence. By creating and sharing CVB, our aim is to develop improved models capable of recognizing all important behaviors accurately and to assist other researchers and practitioners in developing and evaluating new ML models for cattle behavior classification using video data.

Introduction

The global livestock industry is a trillion-dollar sector where animal welfare and productivity are paramount. Monitoring cattle behavior—such as how long they graze versus ruminate—is a vital indicator for detecting health issues, stress, or suboptimal pasture management. However, automating this monitoring via Computer Vision (CV) is difficult due to the limitations of existing datasets, which often lack scale, realistic environmental conditions, and granular labeling. Furthermore, cattle present unique challenges such as visual similarity and frequent occlusions in natural grazing settings.

Methodology: AI-Assisted Labeling

To address these challenges, we developed a semi-automated pipeline to curate the CVB dataset efficiently. Data was captured using four GoPro5 Black cameras positioned at the corners of a 25m x 25m field containing eight Angus beef cattle.

The CVB data processing and annotation pipeline.

As shown in the pipeline above, we utilized YOLOv7 for initial object detection and the Botsort algorithm for tracking individual animals. Domain experts then used the Computer Vision Annotation Tool (CVAT) to verify and correct these automated "tracklets." This hybrid approach significantly reduced manual labor, with experts only needing to adjust 29% of the bounding boxes. For action recognition, the data was formatted into the Atomic Visual Action (AVA) standard and used to train a SlowFast model.

The Cattle Visual Behaviors (CVB) Dataset

The CVB dataset consists of 502 video clips, each 15 seconds long, featuring Bos taurus in natural lighting. It includes 11 mutually exclusive behavior labels: grazing, walking, running, ruminating-standing, ruminating-lying, resting-standing, resting-lying, drinking, grooming, other, and hidden.

A significant finding during curation was the "long-tail" distribution of behaviors. Grazing accounts for 39% of the data, while behaviors like grooming or running occur less than 5% of the time. This Zipfian distribution highlights a major hurdle for AI models, which must learn to recognize rare but critical events amidst common ones.

Experimental Results

Preliminary evaluation using the SlowFast model demonstrates the dataset's utility for training robust action recognition models. The model achieved a 73.96% test accuracy for grazing (at IoU > 50% and 89% confidence). More complex behaviors, such as resting-lying, were identified with 58% accuracy.

Examples of behavior annotations in the CVB dataset, including grazing, resting-lying, and hidden classes.

The results confirm that the system can reliably localize cattle and recognize frequent behaviors even in complex outdoor scenes with varying light and camera angles. The "hidden" label (shown in Figure 5b) is particularly important for handling occlusions in dense groups.

Conclusion and Future Work

CVB provides a high-quality benchmark that moves beyond the limitations of previous datasets. While the model performs well on frequent behaviors, future work will focus on improving recognition for rare actions and handling severe occlusions. By sharing CVB, we aim to assist the research community in developing more accurate ML models for livestock monitoring in real-world environments.

Summary updated

BibTeX
@misc{zia2023cvb,
  author = {Ali Zia and Renuka Sharma and Reza Arablouei and Greg Bishop-Hurley and Jody McNally and Neil Bagnall and Vivien Rolland and Brano Kusy and Lars Petersson and Aaron Ingham},
  title = {{CVB: A Video Dataset of Cattle Visual Behaviors}},
  year = {2023},
  eprint = {2305.16555},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.16555},
}
Figure