Behaviour classification of extensively grazed sheep using machine learning

https://doi.org/10.1016/j.compag.2019.105175Get rights and content

Highlights

  • Ear-tag accelerometers can detect multiple behaviours with reasonable accuracy.

  • Epochs of 10 s and 30 s proved superior for behaviour detection.

  • ML performance is dependent on the method of behaviour classification.

Abstract

The application of accelerometer sensors for automated animal behaviour monitoring is becoming increasingly common. Despite the rapid growth of research in this area, there is little consensus on the most appropriate method of data summation and analysis. The objective of this current study was to explore feature creation and machine learning (ML) algorithm options to provide the most accurate behavioural classification from an ear-borne accelerometer in extensively grazed sheep. Nineteen derived movement features, three epochs (5, 10 and 30 s) and four ML-algorithms (Classification and Regression Trees (CART), Linear Kernel Support-Vector Machines (SVM), Linear Discriminant Analysis (LDA) and Quadratic Discriminant Analysis (QDA)) were assessed. Behaviour classification was also evaluated using three different ethograms, including detection of (i) grazing, lying, standing, walking; (ii) active and inactive behaviour; and (iii) body posture. Detection of the four mutually-exclusive behaviours (grazing, lying, standing and walking) was most accurately performed using a 10 s epoch by an SVM (76.9%). Activity was most accurately detected using a 30 s epoch by a CART (98.1%). LDA and a 30 s epoch was superior for detecting posture (90.6%). Differentiation relied on identification of disparities between behaviours rather than pattern recognition within a behaviour. The choice of epoch and ML algorithm will be dependent on the application purpose, with different combinations of each more accurate across the different ethograms. This study provides a crucial foundation for development of algorithms which can identify multiple behaviours in pasture-based sheep. This knowledge could be applied across a number of contexts, particularly at times of change in physiological or mental state e.g. during parturition or stress-inducing husbandry procedures.

Introduction

Behaviour is often used by researchers to better understand an animal’s interaction with their environment and physiological state (Frost et al., 1997, Barwick et al., 2018a). However, behaviour is often difficult to consistently monitor, especially when animals are in large numbers or spread over vast distances (Dobos et al., 2015). The development of sensor technologies has improved our ability to remotely monitor livestock in a broad range of contexts and on scales not previously possible (Brown et al., 2013, Schmoelzl et al., 2016). Of these sensors, one type that has increased in popularity is the accelerometer (Fogarty et al., 2018). Accelerometers measure both gravitational and inertial acceleration associated with movement, usually on three different axes (called tri-axial) (Brown et al., 2013, Alvarenga et al., 2016, Barwick et al., 2018b). Recent advances in miniaturisation of technology has increased accelerometer uptake, with reduced size, mass and power consumption making attachment to the animal easier and less invasive (Watanabe et al., 2008, Alvarenga et al., 2016, Walton et al., 2018). Extensive beef and sheep industries are now exploring the potential for these systems to optimise production, reduce costs and enhance sustainability (Trotter, 2018).

In sheep, accelerometers have previously been used to detect basic behaviours (specifically, behavioural states rather than behavioural events) such as high- and low-level general activity (McLennan et al., 2015), gait and posture (Radeski and Ilieski, 2017) or some combination of grazing, lying, standing, ruminating, running and/or walking (Nadimi et al., 2012, Alvarenga et al., 2016, Giovanetti et al., 2017, Barwick et al., 2018b, Decandia et al., 2018, Mansbridge et al., 2018, Walton et al., 2018). More specific applications have included the detection of suckling (Kuźnicka and Gburzyński, 2017) and lameness (Barwick et al., 2018a). These studies vary in their approach, with differences in study purpose, design, sensor attachment and data sample rate. Some have also been conducted in controlled pen environments, either wholly (Alvarenga et al., 2016, Giovanetti et al., 2017, Barwick et al., 2018a) or in part (Radeski and Ilieski, 2017). As these sensors evolve into commercially affordable systems, further evaluation in sheep kept under normal grazing conditions is warranted. This is particularly important for behaviour signatures that may subtly differ between pen and pasture environments (e.g. differences in biting signatures of animals eating a total mixed ration compared to those actively tearing pasture (Martz and Belyea, 1986)) or behaviours that may arise due to extensive management conditions (e.g. increased insect-defence behaviours such as ear-flicking or head shaking (Dougherty et al., 1993, Mooring et al., 2003)).

In addition to differing study design, there has also been a number of ways in which behaviour states have been interpreted and classified. For example, Alvarenga et al. (2016) used accelerometers to classify five mutually-exclusive sheep behaviours (grazing, lying, running, standing and walking). Similarly, Barwick et al., 2018b, Walton et al., 2018 classified lying, standing and walking behaviours, with Barwick et al. (2018b) including an additional classification of grazing. Other approaches include Mansbridge et al. (2018), where classification was focused on grazing, ruminating and other non-eating behaviours and Rurak et al., 2008, Umstätter et al., 2008 where behaviours were classified as either ‘active’ or ‘inactive’. While a higher degree of resolution in behavioural observation might be desirable from a research perspective, it is entirely feasible that simple bivariate classifications (e.g. active/inactive) may prove reliable enough to be applied in commercial contexts and should not be immediately dismissed.

The first step in most accelerometer-based data analysis involves the process of feature extraction. There have been a large number of features proposed in the literature, ranging from simple averages of a single accelerometer axis (Hokkanen et al., 2011) to more complex metrics designed to capture the variability of signal magnitude across all three axes (Alvarenga et al., 2016, Barwick et al., 2018b, Walton et al., 2018). Most features are created using a fixed time segment commonly referred to as the ‘epoch’ (Decandia et al., 2018). Epochs help to reduce both the amount and complexity of data and reduce noise in the dataset (Chen and Bassett, 2005, Barwick, 2016). However, choosing an optimal epoch length can be challenging, as epochs are required to be both short enough to maximise the likelihood of capturing a single behaviour yet sufficient in duration to allow adequate differentiation between behaviours (Chen and Bassett, 2005). While this method of data summation is common, there is not yet a consensus on the most appropriate epoch length for behaviour detection.

Once the features have been created, these are then analysed using any one of a number of machine learning (ML) algorithms e.g. discriminant analysis (Giovanetti et al., 2017, Barwick et al., 2018a, Barwick et al., 2018b, Decandia et al., 2018); classification trees (Alvarenga et al., 2016); random forest (Barwick et al., 2018a, Barwick et al., 2018b, Mansbridge et al., 2018, Walton et al., 2018); support vector machine (Mansbridge et al., 2018). Whilst some studies have compared the value of different epochs and ML algorithms, none have comprehensively evaluated the many different combinations in parallel and the resulting ability to classify multiple behaviour states in extensively grazed sheep.

The objective of this current study was to explore how a range of ML algorithms (Classification and Regression Trees (CART), Linear Kernel Support Vector Machine (SVM), Linear Discriminant Analysis (LDA) and Quadratic Discriminant Analysis (QDA)) can be used to predict behavioural states in sheep. Algorithms were assessed using three epoch lengths (5, 10, 30 s). Assessment of calculated features was also conducted to determine the best features for behaviour prediction. Analysis was applied to three different ethograms: (i) detection of four mutually-exclusive behavioural states (grazing, lying, standing, walking); (ii) detection of general activity (active – grazing, walking; inactive – standing, lying); and (iii) detection of body posture (upright – grazing, standing, walking; prostrate – lying). Though similar aspects of accelerometer application have been studied in sheep (Umstätter et al., 2008, Alvarenga et al., 2016, Giovanetti et al., 2017, Barwick et al., 2018b, Decandia et al., 2018, Mansbridge et al., 2018, Walton et al., 2018) and cattle (Martiskainen et al., 2009, Robert et al., 2009, Smith et al., 2016, Abell et al., 2017), the focus of this study was to assess multiple combinations of analysis protocols, with the objective of identifying algorithms appropriate for commercial application in extensively grazed sheep. Further to this, while comparable applications are already present in the dairy industry (Trotter, 2013), there is still a requirement to study these aspects in sheep given the differences between the two species e.g. bio-mechanical differences related to common behaviours and the resulting difference in acceleration signatures (Chambers et al., 1981, Barwick et al., 2018b).

Section snippets

Animals, location and instrumentation

All procedures were approved by the Massey University Animal Ethics Committee (MUAEC 18-67).

This study was conducted at a commercial mixed enterprise property on the South Island of New Zealand (43.0°S and 173.2°E). Twelve pregnant mixed-aged ewes (Merino or Merino cross) were selected for observation and fitted with ear-borne accelerometers (Axivity AX3, Axivity Ltd, Newcastle, UK). These animals were part of a larger flock (39 ewes in total) also fitted with ear tag accelerometers being

Sensor and observation results

A summary of the total number of epoch observations collected for each behaviour is presented in Table 3.

The proportion of available data for the 5 s and 10 s epoch was 40% grazing, 45% lying, 13% standing and 2% walking. This equates to 42% active compared to 58% inactive behaviour and 55% upright compared to 45% prostrate posture. The low amount of walking data resulted in the development and application of the under-sampling protocol described in Section 2.6.

The proportion of available data

Discussion

In this study, a number of features, epoch lengths and ML algorithms were used to successfully classify various behaviour states in extensively grazed sheep using an ear-borne accelerometer. Given the value of the ear-tag form and its application in current husbandry practice (Barwick et al., 2018b), this research provides valuable insight of the behaviour assessments that can be conducted using this attachment method.

The results indicate that the ear attachment method is able to distinguish

Conclusion

Accelerometers allow for fine-scale monitoring of animal movement and behaviour, and are becoming increasingly used in animal behaviour research (Fogarty et al., 2018). Despite the technology’s growing popularity, there is still no consistent protocol for data analysis, particularly for sheep behaviour classification using ear-borne accelerometers. The current study found that ear-borne accelerometers are able to distinguish between four main behaviours, two activity states and two postures in

CRediT authorship contribution statement

Eloise S. Fogarty: Conceptualization, Methodology, Investigation, Data curation, Writing - original draft, Writing - review & editing. David L. Swain: Supervision. Greg M. Cronin: Supervision. Luis E. Moraes: Validation. Mark Trotter: Conceptualization, Methodology, Supervision, Writing - review & editing.

Declaration of Competing Interest

The authors declare no conflicts of interest.

Acknowledgements

This work was supported by Central Queensland University in conjunction with The New Zealand Merino company. The authors wish to acknowledge the significant contribution of Ms Kelly McClean (The New Zealand Merino Company) for assistance in study preparation, device deployment and general logistics. Dr Rene Corner-Thomas is also gratefully acknowledged for her assistance with ethics application and submission. Finally, the authors would like to acknowledge the great support provided by the

References (53)

  • L.R. Fell et al.

    Behavioural and hormonal responses to acute surgical stress in sheep

    Appl. Animal Behav. Sci.

    (1989)
  • E.S. Fogarty et al.

    Autonomous on-animal sensors in sheep research: A systematic review

    Comput. Electron. Agric.

    (2018)
  • A.R. Frost et al.

    A review of livestock monitoring and the need for integrated systems

    Comput. Electron. Agric.

    (1997)
  • V. Giovanetti et al.

    Automatic classification system for grazing, ruminating and resting behaviour of dairy sheep using a tri-axial accelerometer

    Livestock Sci.

    (2017)
  • A.-H. Hokkanen et al.

    Predicting sleep and lying time of calves with a support vector machine classifier using accelerometer data

    Appl. Animal Behav. Sci.

    (2011)
  • E. Kuźnicka et al.

    Automatic detection of suckling events in lamb through accelerometer data classification

    Comput. Electron. Agric.

    (2017)
  • P. Martiskainen et al.

    Cow behaviour pattern recognition using a three-dimensional accelerometer and support vector machines

    Appl. Animal Behav. Sci.

    (2009)
  • F.A. Martz et al.

    Role of particle size and forage quality in digestion and passage by cattle and sheep

    J. Dairy Sci.

    (1986)
  • K.M. McLennan et al.

    Technical note: Validation of an automatic recording system to assess behavioural activity level in sheep (Ovis aries)

    Small Ruminant Res.

    (2015)
  • E.S. Nadimi et al.

    Monitoring and classifying animal behavior using ZigBee-based mobile ad hoc wireless sensor networks and artificial neural networks

    Comput. Electron. Agric.

    (2012)
  • J.L. Owens et al.

    Behaviour at parturition and lamb survival of Booroola Merino sheep

    Livestock Prod. Sci.

    (1985)
  • M. Radeski et al.

    Gait and posture discrimination in sheep using a tri-axial accelerometer

    Animal

    (2017)
  • B. Robert et al.

    Evaluation of three-dimensional accelerometers to monitor and classify behavior patterns in cattle

    Comput. Electron. Agric.

    (2009)
  • D. Smith et al.

    Behavior classification of cows fitted with motion collars: Decomposing multi-class classification into a set of binary problems

    Comput. Electron. Agric.

    (2016)
  • C. Umstätter et al.

    An automated sensor-based method of simple behavioural classification of sheep in extensive systems

    Comput. Electron. Agric.

    (2008)
  • J.J. Valletta et al.

    Applications of machine learning in animal behaviour studies

    Anim. Behav.

    (2017)
  • Cited by (78)

    • A multi-sensor approach to calving detection

      2024, Information Processing in Agriculture
    View all citing articles on Scopus
    View full text