TLDR: A new AI-powered multi-camera system uses a panoramic view, YOLO11-m for detection, and SAMURAI for precise segmentation to track dairy cows in real-time with over 99% accuracy, significantly outperforming existing methods and minimizing identity switches in complex barn environments.
Monitoring the health and well-being of dairy cows is crucial for farm productivity and disease identification. Traditionally, this has involved labor-intensive manual observations, which are often inconsistent and time-consuming. While various smart devices like pedometers and RFID tags have emerged, they often face limitations such as susceptibility to damage, environmental interference, or being primarily suited for outdoor use. Camera-based surveillance systems offer a promising alternative, but existing multi-object tracking systems for livestock often struggle with challenges like varying cow postures, occlusions, and maintaining individual identity across different camera views.
A recent research paper, “Vision transformer-based multi-camera multi-object tracking framework for dairy cow monitoring,” introduces a novel solution to these challenges. Developed by a team of researchers including Kumail Abbas, Zeeshan Afzal, Aqeel Raza, Taha Mansouri, Andrew W. Dowsey, Chaidate Inchaisri, and Ali Alameer, this framework offers a high-precision, real-time multi-camera system for tracking indoor-housed dairy cows. You can read the full paper here: Research Paper.
A Unified Panoramic View
One of the core innovations of this system is its ability to create a unified, top-down panoramic view of the barn. This is achieved by geometrically aligning feeds from multiple overhead cameras using a technique called homographic transformations. This clever approach eliminates the need for complex cross-camera identity matching, as cows moving between different camera coverages seamlessly remain within a single, continuous coordinate frame. This means the system avoids mistakenly identifying the same cow as a new individual when it moves from one camera’s view to another, and it also prevents duplicate detections.
Advanced Detection and Segmentation
The framework employs cutting-edge computer vision models for accurate cow detection and precise instance segmentation. For detection, a refined YOLO11-m model was fine-tuned using a custom dataset of overhead cow images. This model achieved impressive accuracy, with a mean Average Precision (mAP) of 0.97 at an Intersection over Union (IoU) threshold of 0.5, and an F1 score of 0.95 on test images. This ensures that cows are reliably identified in the video frames.
To generate pixel-precise masks for each detected cow, the system utilizes SAMURAI, an enhanced version of the Segment Anything Model 2.1 (SAM 2.1). SAMURAI is particularly effective because it incorporates a motion-aware memory and a Linear Kalman filter, allowing it to predict mask placement and select high-quality historical frames. This capability is crucial for maintaining consistent and accurate cow silhouettes over time, even when cows are overlapping, occluding each other, or moving rapidly. SAMURAI operates in real-time without requiring specific retraining for this task, demonstrating true zero-shot performance.
Robust Multi-Object Tracking
The tracking component of the system assigns a unique ID to each detected cow at the beginning. It then uses a two-stage algorithm: motion prediction, where the cow’s centroid and area are tracked using a constant-velocity Kalman filter, and data association, which matches current detections to existing tracks based on Intersection over Union (IoU). The system assumes a closed population, meaning no new cows enter or leave, which helps maintain identity continuity. The precise segmentation from SAMURAI further enhances the reliability of these associations, significantly reducing identity switches.
Exceptional Performance
The proposed system was rigorously evaluated using two distinct video sequences of Holstein Friesian dairy cows at the John Oldacre Centre for Dairy Welfare and Sustainability Research. The results were outstanding, consistently outperforming the Deep SORT Realtime tracking method. In one video sequence, the proposed method achieved a Multi-Object Tracking Accuracy (MOTA) of 98.7% and an IDF1 score of 99.3%. In another, longer sequence, it reached a MOTA of 99.3% and an IDF1 of 99.7%. These metrics indicate near-perfect tracking precision and excellent identity preservation, with minimal false positives, false negatives, and very few identity switches. In stark contrast, Deep SORT Realtime showed significantly poorer performance, with negative MOTA values and very low IDF1 scores in some cases, highlighting the superior robustness and effectiveness of the new framework.
Also Read:
- Hydra: A New Multi-Sensor System for Precise Leaf Wetness Detection
- Mapping Sound: A U-Net Approach to Pinpointing Acoustic Sources
Future Outlook
This innovative multi-camera tracking system represents a significant advancement for precision livestock farming, enabling continuous and accurate monitoring of dairy cow activity and behavior. While the system demonstrates strong generalizability and robust performance in complex indoor environments, the authors acknowledge certain limitations. These include the assumption of a fixed set of cow identities (it cannot assign IDs to newly introduced cows), reliance on accurate camera calibration, and challenges with long-term occlusions. Future work aims to scale the system for larger herds and extend data collection for long-term behavioral monitoring, which will be vital for early disease detection and improved animal welfare.


