Monitoring of milking routines for dairy cows using a computer vision system: A diagnostic accuracy study

The primary objective was to assess the performance of a computer vision system for the detection of reattachment and manual removal of the milking unit, as well as the assessment of the preparation lag time of the milking routine. The secondary objective was to investigate the association between preparation lag time and the milking performance indices milk yield, milking duration, and occurrence of bimodal milk flow curves. In this observational field study, we analyzed video footage containing data from 2,917 cow milking observations collected from one dairy farm. The occurrences of reattachment and manual detachment of the milking unit were identified using both the computer vision system and visual inspection of the same video footage, with the latter serving as the gold standard. The duration of the preparation lag time was assessed by the computer vision system and visual assessment of the video footage and calculated as the time lag between start of the forestripping step and the attachment of the milking unit. Milk yield, milking duration, and the occurrence of bimodality were assessed with electronic on-farm milk flow meters. The κ statistics and diagnostic test performance metrics (95% CI) for the comparison between the computer vision system and the gold standard for reattachment and manual removal of the milking unit, respectively, were κ, 0.96 (0.91-1.00) and 0.85 (0.80-0.90); sensitivity, 0.95 (0.83-0.99) and 0.85 (0.78-0.91); specificity, 1.00 (0.99-1.00) and 0.98 (0.96-0.99), positive predictive value, 0.97 (0.86-1.00) and 0.90 (0.84-0.95); negative predictive value, 1.00 (0.99-1.00) and 0.96 (0.95-0.98); accuracy, 0.99 (0.99-1.00) and 0.95 (0.94-0.97); and F1 score; 0.96 (0.90-1.00) and 0.88 (0.83-0.92). General linear mixed models revealed an association between preparation lag time as assessed with the computer vision system and milk yield, but no association for milking duration. The estimated marginal means (95% CI) for milk yield were 13.1 (12.8-13.4) for a preparation lag time of <90 s, 13.4 (13.1-13.7) for a preparation lag time of 90 to 150 s, and 13.1 (12.6-13.6) kg/milking session for a preparation lag time of >150 s. Milking durations were 314 s (308-320 s) for <90 s, 319 s (311-326 s) for 90 to 150 s, and 321 s (308-334 s) for >150 s. A generalized linear mixed model showed an association between preparation lag time and the occurrence of bimodality. Compared with a preparation lag time of >150 s, the odds (95% CI) of bimodality were 0.52 (0.29-0.93) for <90 s and 0.44 (0.24-0.81) for 90 to 150 s. We conclude that the computer vision system tested here can accurately detect manual removal and reattachments of the milking unit and precisely assess the preparation lag time of the milking routine. Furthermore, our data add to the existing literature suggesting that inadequate preparation lag time can negatively affect milking performance.

Authors

Institutions

Publication Details

Journal
Journal of Dairy Science
Published
2025-07-16
DOI
https://doi.org/10.3168/jds.2025-26571
Citations
2
Primary Topic
Effects of Environmental Stressors on Livestock
Type
article
Field-Weighted Citation Impact
2.39

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Monitoring of milking routines for dairy cows using a computer vision system: A diagnostic accuracy study

Matthias Wieland, W. Heuwieser
2 citations
Journal of Dairy Science
Effects of Environmental Stressors on Livestock
2.39
article

Monitoring of milking routines for dairy cows using a computer vision system: A diagnostic accuracy study

Matthias Wieland, W. Heuwieser
article en
2 citations

Abstract

The primary objective was to assess the performance of a computer vision system for the detection of reattachment and manual removal of the milking unit, as well as the assessment of the preparation lag time of the milking routine. The secondary objective was to investigate the association between preparation lag time and the milking performance indices milk yield, milking duration, and occurrence of bimodal milk flow curves. In this observational field study, we analyzed video footage containing data from 2,917 cow milking observations collected from one dairy farm. The occurrences of reattachment and manual detachment of the milking unit were identified using both the computer vision system and visual inspection of the same video footage, with the latter serving as the gold standard. The duration of the preparation lag time was assessed by the computer vision system and visual assessment of the video footage and calculated as the time lag between start of the forestripping step and the attachment of the milking unit. Milk yield, milking duration, and the occurrence of bimodality were assessed with electronic on-farm milk flow meters. The κ statistics and diagnostic test performance metrics (95% CI) for the comparison between the computer vision system and the gold standard for reattachment and manual removal of the milking unit, respectively, were κ, 0.96 (0.91-1.00) and 0.85 (0.80-0.90); sensitivity, 0.95 (0.83-0.99) and 0.85 (0.78-0.91); specificity, 1.00 (0.99-1.00) and 0.98 (0.96-0.99), positive predictive value, 0.97 (0.86-1.00) and 0.90 (0.84-0.95); negative predictive value, 1.00 (0.99-1.00) and 0.96 (0.95-0.98); accuracy, 0.99 (0.99-1.00) and 0.95 (0.94-0.97); and F1 score; 0.96 (0.90-1.00) and 0.88 (0.83-0.92). General linear mixed models revealed an association between preparation lag time as assessed with the computer vision system and milk yield, but no association for milking duration. The estimated marginal means (95% CI) for milk yield were 13.1 (12.8-13.4) for a preparation lag time of <90 s, 13.4 (13.1-13.7) for a preparation lag time of 90 to 150 s, and 13.1 (12.6-13.6) kg/milking session for a preparation lag time of >150 s. Milking durations were 314 s (308-320 s) for <90 s, 319 s (311-326 s) for 90 to 150 s, and 321 s (308-334 s) for >150 s. A generalized linear mixed model showed an association between preparation lag time and the occurrence of bimodality. Compared with a preparation lag time of >150 s, the odds (95% CI) of bimodality were 0.52 (0.29-0.93) for <90 s and 0.44 (0.24-0.81) for 90 to 150 s. We conclude that the computer vision system tested here can accurately detect manual removal and reattachments of the milking unit and precisely assess the preparation lag time of the milking routine. Furthermore, our data add to the existing literature suggesting that inadequate preparation lag time can negatively affect milking performance.

Journal of Dairy ScienceVol. 108(9)
Cornell University (US), New York State College of Veterinary Medicine (US)
National Institute of Food and Agriculture
Zero hunger
Openalex Percentile: Top 12%
Effects of Environmental Stressors on Livestock
2.39
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.