Skip to main content

Research Repository

Advanced Search

Feature selection and comparison of machine learning algorithms in classification of grazing and rumination behaviour in sheep

Mansbridge, Nicola; Mitsch, Jurgen; Bollard, Nicola; Ellis, Keith; Miguel-Pacheco, Giuliana G.; Dottorini, Tania; Kaler, Jasmeet


Nicola Mansbridge

Jurgen Mitsch

Nicola Bollard

Keith Ellis

Giuliana G. Miguel-Pacheco

Professor of Epidemiology & Precision Livestock Informatics


Grazing and ruminating are the most important behaviours for ruminants, as they spend most of their daily time budget performing these. Continuous surveillance of eating behaviour is an important means for monitoring ruminant health, productivity and welfare. However, surveillance performed by human operators is prone to human variance, time-consuming and costly, especially on animals kept at pasture or free-ranging. The use of sensors to automatically acquire data, and software to classify and identify behaviours, offers significant potential in addressing such issues. In this work, data collected from sheep by means of an accelerometer/gyroscope sensor attached to the ear and collar, sampled at 16 Hz, were used to develop classifiers for grazing and ruminating behaviour using various machine learning algorithms: random forest (RF), support vector machine (SVM), k nearest neighbour (kNN) and adaptive boosting (Adaboost). Multiple features extracted from the signals were ranked on their importance for classification. Several performance indicators were considered when comparing classifiers as a function of algorithm used, sensor localisation and number of used features. Random forest yielded the highest overall accuracies: 92% for collar and 91% for ear. Gyroscope-based features were shown to have the greatest relative importance for eating behaviours. The optimum number of feature characteristics to be incorporated into the model was 39, from both ear and collar data. The findings suggest that one can successfully classify eating behaviours in sheep with very high accuracy; this could be used to develop a device for automatic monitoring of feed intake in the sheep sector to monitor health and welfare.


Mansbridge, N., Mitsch, J., Bollard, N., Ellis, K., Miguel-Pacheco, G. G., Dottorini, T., & Kaler, J. (2018). Feature selection and comparison of machine learning algorithms in classification of grazing and rumination behaviour in sheep. Sensors, 18(10),

Journal Article Type Article
Acceptance Date Oct 17, 2018
Online Publication Date Oct 19, 2018
Publication Date Oct 19, 2018
Deposit Date Oct 23, 2018
Publicly Available Date Oct 23, 2018
Journal Sensors
Publisher MDPI
Peer Reviewed Peer Reviewed
Volume 18
Issue 10
Article Number 3532
Keywords Sheep behaviour; Grazing; Rumination behaviour; Classification algorithm; Accelerometer and gyroscope; Sensor; Machine learning; Precision livestock monitoring
Public URL
Publisher URL