Variable segmentation and ensemble classifiers for predicting dairy cow behaviour

Manod Williams, William P. James, Michael Rose

Research output: Contribution to journalArticlepeer-review

22 Citations (Scopus)
39 Downloads (Pure)


Automatically classifying cattle behaviour using high frequency data usually involves segmentation of data with fixed window sizes for feature extraction. Machine learning algorithms can then be used for supervised modelling of the most biologically important behaviours using these segments. In this work, variable segmentation was applied to GPS data gathered from 30 dairy cows at pasture. Using these segments, the performance of 13 machine learning algorithms (base learners) implemented in WEKA were compared using default parameters in classifying grazing, resting and walking. Two Stacking ensembles (WEKA implementation of Super Learner) were then derived. The first ensemble contained the best performing base learners. The second was an optimised version derived using a manual ensemble selection method. Both versions of the ensemble were evaluated on an independent test set derived from 10 cows. Overall, the variable segmentation strategy identified 90.2% of changepoints. On the training set, all base learners achieved classification accuracies and F-measures ≥0.90. Optimising the Stacking ensemble led to no further improvement in F-measure (full ensemble = 0.93; optimised ensemble = 0.92) on the test set. The ensembles performed well but base learners utilising boosting algorithms (e.g. simple logistic; logistic model trees) performed as well as the more computationally expensive ensembles. Variable segmentation and ensemble classifiers are promising strategies for classifying the behaviour of dairy cows. However, more work is needed to fully explore and evaluate the potential of ensembles because some base learners may perform equally if not better in some contexts.
Original languageEnglish
Pages (from-to)156-167
Number of pages12
JournalBiosystems Engineering
Early online date11 Dec 2018
Publication statusPublished - 28 Feb 2019


  • Changepoint
  • Dairy cattle behaviour classification
  • Ensemble classifier
  • Machine learning
  • Stacking algorithm
  • Variable segmentation


Dive into the research topics of 'Variable segmentation and ensemble classifiers for predicting dairy cow behaviour'. Together they form a unique fingerprint.

Cite this