Classifying cow stall numbers using YOLO
Dheeraj Vajjarapu
TL;DR
This study tackles automatic cow stall number identification from teat video feeds using YOLO to enable real-time tracking in dairy farms. It introduces the CowStallNumbers dataset with 1042 training and 246 testing images spanning 61 stall numbers 0–60 and reports strong performance including recall of $92\%$, mAP at IoU 0.5 of $0.902$, and mAP at IoU 0.5–0.95 of $0.964$, achieving an overall accuracy of $95.4\%$. The method combines unsupervised key-frame extraction for data collection, Albumentations-based augmentation, and YOLOv8n training on Google Colab, resulting in robust stall-number localization. This work advances precision livestock farming by providing a scalable, automated approach for labeling and tracking cows within barns using camera feeds.
Abstract
This paper introduces the CowStallNumbers dataset, a collection of images extracted from videos focusing on cow teats, designed to advance the field of cow stall number detection. The dataset comprises 1042 training images and 261 test images, featuring stall numbers ranging from 0 to 60. To enhance the dataset, we performed fine-tuning on a YOLO model and applied data augmentation techniques, including random crop, center crop, and random rotation. The experimental outcomes demonstrate a notable 95.4\% accuracy in recognizing stall numbers.
