Research Summary - 2

Machine Learning Model for Predicting Dairy Cattle Lameness Using Sensor-derived Behavioral Metrics

Date/Time: 8/28/2026    11:45
Author: Gerard  Cramer
Clinic: Univerisy of Minnesota
City, State, ZIP: SAINT PAUL, MN  55108-2420

Towfiq Rahman, PhD 1 ; Elise Shepley, PhD 1 ;
1University of Minnesota

Introduction:

Lameness is a major welfare and economic issue for the dairy industry. Early detection is key to timely intervention. Visual locomotion scoring is a time-consuming, subjective process, and the widespread use of sensors offers potential alternative methods. This study aimed to develop and evaluate the prediction performance of a hybrid Convolutional Neural Network-Long Short-Term Memory (CNN-LSTM) deep learning model to predict locomotion score up to 30 days before visual diagnosis by combining neck-mounted sensor data with historical hoof health records

Materials and methods:

A retrospective study was conducted using data from 6,146 lactating Holstein cows across 2 commercial farms in Minnesota. Daily behavior metrics (eating, rumination, and inactive time) were collected from neck sensors for each cow, and trained study personnel recorded bi-weekly visual locomotion scores (VLS). Cows were classified as Healthy (VLS < 2) or Lame (VLS ≥ 2). Comprehensive lameness history and hoof trimming records were collected from the herd management software and incorporated into the model database as temporal features. To predict lameness, time-series data were structured using a sliding-window framework evaluating varying prediction gaps (21 days in advance) and historical observation windows (14, 21, and 45 days). The CNN-LSTM architecture was trained on 80% of the sequences and evaluated on a 20% independent test set. Models were evaluated by comparing F1-score, precision (positive predictive value of lame cow), and recall (sensitivity for lame)

Results:

In our dataset, lameness prevalence was 25.5%. The model's performance relied heavily on how much history it looked at and how far ahead it tried to predict. For 3-week early predictions, using 14 days of history yielded an F1-score of 0.62, a precision of 63%, and a sensitivity of 59%. Using a 21-day observation window to predict lameness 21 days in advance, the model achieved a consistent 63% across F1-score, precision, and sensitivity. Extending this window to 45 days (behavioral history), the model achieved an F1 Score of 63% and a precision of 61%. More importantly, it achieved a recall of 78%.

Significance:

Combining daily sensor data with hoof health history into a deep learning model has the potential to create a tool for predicting lameness. Our developed model was able to predict lame cows with reasonable performance 3 weeks in advance when an extended 45-day behavioral history was included. Once successfully tested in a field trial, the algorithm could allow farms to target cows for earlier intervention and potentially reduce the duration of lameness.