The use of kinematics to quantify gait attributes and predict gait scores in dairy cows

The use of kinematics to quantify gait attributes and predict gait scores in dairy cows
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

Detecting walking pattern abnormalities in dairy cows early on holds the potential to reduce the occurrence of clinical lameness. This study aimed to predict gait scores in non-clinically lame dairy cows by using gait attributes based on kinematic data. Markers were placed on 20 anatomical landmarks on 12 dairy cows. The cows were walked multiple times through a corridor while recorded by six cameras, representing 69 passages. Specific gait attributes were computed from the 3D coordinates of the hoof markers. Gait was visually assessed using a 5-point numerical rating system (NRS). Due to the limited number of observations with NRS lower than 2 (n = 1) and higher than 3 (n = 6), the NRS labels were combined into three groups, representing NRS <= 2, NRS = 2.5, and NRS >= 3. The dataset was split into training and testing sets (70:30 ratio), stratified by the distribution of the NRS categories. Random forest (RF), gradient boosting machine (GBM), extreme gradient boosting machine (XGBM), and support vector machine (SVM) with a radial basis kernel models were trained using k-fold repeated cross-validation with hyperparameters defined using a Bayesian optimization. Accuracy, sensitivity, specificity, F1 score, and balanced accuracy were calculated to measure model performance. The GBM model performed best, achieving an overall accuracy and F1 score of 0.65 in the testing set. The findings of this study contribute to the development of an automated monitoring system for early identification of gait abnormalities, thereby enhancing the welfare and longevity of dairy cows.


💡 Research Summary

This study addresses the need for early detection of lameness in dairy cattle by developing a kinematics‑based machine‑learning pipeline to predict gait scores. Twelve lactating Holstein cows (average parity 2.25 ± 1.09, days in milk 143 ± 70) were instrumented with 20 reflective spherical markers placed on standardized anatomical landmarks using a 10 × 10 cm stencil to ensure repeatability. The cows walked multiple times through a 7‑meter corridor while six high‑speed Basler Ace cameras captured synchronized video at 60 fps. The Vicon Motus system reconstructed three‑dimensional coordinates for each marker, which were subsequently rotated to correct for initial and final orientation errors.

From the 3‑D trajectories of the hoof markers and rear‑leg hock markers, six gait attributes were derived: (1) track‑up (distance between consecutive hoof prints on the same side), calculated both in the longitudinal (dis X) and combined longitudinal‑transverse (dis XY) axes; (2) stride length (distance between successive contacts of the same hoof); (3) stride time (temporal interval between successive contacts, derived from frame counts); (4) stance time (duration a hoof remains in contact with the ground); (5) velocity (stride length divided by stride time, using the dis XY measure); and (6) joint flexion (hock joint angle computed from three‑dimensional marker geometry). Outlier values that were biologically implausible (e.g., track‑up > 33 cm) were replaced with passage‑level averages rather than discarded, preserving the three‑step structure of each passage.

Gait was visually scored using the 5‑point Numerical Rating Scale (NRS) of Flower and Weary, with half‑point increments when criteria fell between integer scores. Because only one observation fell into NRS < 2 and six into NRS > 3, the scores were collapsed into three categories: NRS ≤ 2, NRS = 2.5, and NRS ≥ 3. The resulting dataset comprised 69 passages, which were split into training (70 %) and testing (30 %) sets while ensuring that all passages from a given cow remained in the same split to avoid information leakage.

Four supervised learning algorithms were evaluated: Random Forest (RF), Gradient Boosting Machine (GBM), Extreme Gradient Boosting Machine (XGBM), and Support Vector Machine with a radial basis function kernel (SVM). Hyper‑parameter tuning employed Bayesian optimization (50 iterations, expected improvement acquisition function, ε = 0.01) within a repeated 3‑fold cross‑validation framework (5 repetitions). For each algorithm, a macro‑averaged F1 score on the hold‑out fold guided the optimization. The final models were retrained on the full training set with the optimal hyper‑parameters and evaluated on the independent test set using accuracy, per‑class sensitivity, specificity, balanced accuracy, and macro‑F1.

The GBM model achieved the highest performance, with an overall accuracy of 0.65 and a macro‑F1 of 0.65 on the test set. RF and XGBM followed with accuracies around 0.58–0.60, while SVM lagged due to the small sample size and the need for feature scaling. Model interpretability was explored using the DALEX package: permutation‑based variable importance identified track‑up XY, stride length, and velocity as the most influential predictors. Accumulated Local Effects (ALE) plots revealed non‑linear relationships; for instance, higher track‑up XY values (≈8–12 cm) were associated with a higher probability of being classified in the NRS ≥ 3 group, indicating potential asymmetry or reduced propulsion.

The study demonstrates that detailed kinematic descriptors, even from a modest number of animals, can be transformed into predictive features for early gait abnormality detection. However, limitations include the small, highly controlled dataset, class imbalance, and the logistical burden of marker placement and multi‑camera calibration. Future work should scale the approach to larger herds, incorporate marker‑less computer‑vision or inertial sensor data to reduce cost, and integrate real‑time analytics for on‑farm decision support. By advancing from binary lameness detection toward multi‑class gait scoring, this research contributes a valuable step toward automated, objective, and welfare‑focused monitoring systems in dairy production.


Comments & Academic Discussion

Loading comments...

Leave a Comment