Published February 21, 2022 | Version v1
Journal article Open

Detecting dairy cows' lying behavior using noisy 3D ultra-wide band positioning data

  • 1. Wageningen Livestock Research
  • 2. LUKE
  • 3. Claudia


In precision livestock farming, technology-based solutions are used to monitor and manage livestock and support decisions based on on-farm available data. In this study, we developed a methodology to monitor the lying behavior of dairy cows using noisy spatial positioning data, thereby combining time-series segmentation based on statistical changepoints and a machine-learning classification algorithm using bagged decision trees. Position data (xyz -coordinates) collected with an ultra-wide band positioning system from 30 dairy cows housed in a freestall barn were used. After the data preprocessing and selection, statistical changepoints were detected per cow-day (no. included = 331) in normalized 'distance from the center' and (z) time series. Accelerometer-based lying bout data were used as a practical ground truth. For the segmentation, changepoint detection was compared with getting-up or lying-down events as indicated by the accelerometers. For the classification of segments into lying or non-lying behavior, two data splitting techniques resulting in 2 different training and test sets were implemented to train and evaluate performance: one based on the data collection day and one based on cow identity. In 85.5% of the lying-down or getting-up events a changepoint was detected in a window of 5 minutes. Of the events where no detection had taken place, 86.2% could be associated with either missing data (large gaps) or a very short lying or non-lying bout. Overall classification and lying behavior prediction performance was above 91% in both independent test sets, with a very high consistency across cow-days. This resulted in sufficient accuracy for automated quantification of lying behavior in dairy cows, for example for health or welfare monitoring purposes.



Files (528.0 kB)

Name Size Download all
528.0 kB Preview Download

Additional details

Related works

Is new version of
Preprint: 10.31220/agriRxiv.2022.00132 (DOI)
Is supplemented by
Dataset: 10.5281/zenodo.6373645 (DOI)