A computer vision framework for barn-wide monitoring of dairy cows in free-traffic systems with robotic milking

• Non-invasive multi-camera computer vision framework for barn-wide cow monitoring. • Three YOLO architectures (v8x, v11x, v12x) were optimized and compared. • Image resolution had the strongest impact on detection accuracy across models. • YOLOv11x provided the best balance between accuracy and computational efficiency. • Spatial projection enabled barn-level visualization of cow flow and congestion zones. Free‐traffic cow barns equipped with robotic milking systems are increasingly recognized for supporting better animal welfare, as cows can move according to their own schedule. However, this freedom may also introduce management challenges, such as congestion, uneven cow flow, and inefficient use of barn space. This study aimed to develop and test a non-invasive computer-vision framework capable of continuously monitoring cow movement in a free-traffic barn under real commercial conditions. To manage the large amount of video produced, an entropy-based selection process condensed more than 216,000 frames into 600 diverse, representative images. Consequently, three YOLO models (v8x, v11x, and v12x) were trained and compared, running 675 training experiments to find the most accurate and efficient setup for detecting cows and supporting barn-wide spatial analysis. Across these tests, image resolution had the biggest effect on performance, while factors like optimizer choice and batch size played a smaller role. On an independent test set, YOLOv11x offered the best overall balance between accuracy and computational load (mAP@[0.50:0.95] = 0.735; precision = 0.862; recall = 0.897). YOLOv12x performed slightly better in terms of mAP (0.739) but required more processing power. Cow centroids were projected onto a calibrated barn map to create movement trajectories and highlight areas where cows tended to cluster or slow down. Overall, the framework performed efficiently under real farm conditions reducing annotation work and providing a scalable, non-invasive way to track spatial behaviour. The findings showed that computer vision can support data-driven decisions about barn layout and management, improving efficiency in automated dairy systems.

Authors

Institutions

Publication Details

Journal
Smart Agricultural Technology
Published
2026-02-13
DOI
https://doi.org/10.1016/j.atech.2026.101878
Primary Topic
Animal Behavior and Welfare Studies
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A computer vision framework for barn-wide monitoring of dairy cows in free-traffic systems with robotic milking

Edoardo Fiorilla, Marco Grangetto, Laura Ozella, Marco Bovo et al.
Smart Agricultural Technology
Animal Behavior and Welfare Studies
article

A computer vision framework for barn-wide monitoring of dairy cows in free-traffic systems with robotic milking

Edoardo Fiorilla, Marco Grangetto, Laura Ozella, Marco Bovo, Davide Vitturini
article en

Abstract

• Non-invasive multi-camera computer vision framework for barn-wide cow monitoring. • Three YOLO architectures (v8x, v11x, v12x) were optimized and compared. • Image resolution had the strongest impact on detection accuracy across models. • YOLOv11x provided the best balance between accuracy and computational efficiency. • Spatial projection enabled barn-level visualization of cow flow and congestion zones. Free‐traffic cow barns equipped with robotic milking systems are increasingly recognized for supporting better animal welfare, as cows can move according to their own schedule. However, this freedom may also introduce management challenges, such as congestion, uneven cow flow, and inefficient use of barn space. This study aimed to develop and test a non-invasive computer-vision framework capable of continuously monitoring cow movement in a free-traffic barn under real commercial conditions. To manage the large amount of video produced, an entropy-based selection process condensed more than 216,000 frames into 600 diverse, representative images. Consequently, three YOLO models (v8x, v11x, and v12x) were trained and compared, running 675 training experiments to find the most accurate and efficient setup for detecting cows and supporting barn-wide spatial analysis. Across these tests, image resolution had the biggest effect on performance, while factors like optimizer choice and batch size played a smaller role. On an independent test set, YOLOv11x offered the best overall balance between accuracy and computational load (mAP@[0.50:0.95] = 0.735; precision = 0.862; recall = 0.897). YOLOv12x performed slightly better in terms of mAP (0.739) but required more processing power. Cow centroids were projected onto a calibrated barn map to create movement trajectories and highlight areas where cows tended to cluster or slow down. Overall, the framework performed efficiently under real farm conditions reducing annotation work and providing a scalable, non-invasive way to track spatial behaviour. The findings showed that computer vision can support data-driven decisions about barn layout and management, improving efficiency in automated dairy systems.

Smart Agricultural TechnologyVol. 13
University of Turin (IT), University of Bologna (IT)
Openalex Percentile: Top 57%
Animal Behavior and Welfare Studies
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.