Behavior classification of goats using 9-axis multi sensors: The effect of imbalanced datasets on classification performance

Abstract Recent developments of small electronic instruments have enabled the classification of animal behavior using simultaneous measurements of various bio-logging data such as acceleration, magnetism, and angular velocity. Following technological progress, studies on the behavioral classification of ruminants combining measurements based on accelerometers, magnetometers, and gyroscopes have received attention. However, while the issue of class imbalance has recently become a serious challenge in classification by machine learning, few behavioral classification studies on livestock animals have focused on the effect of equalizing the prevalence of each behavior to improve the problem caused by the imbalance of data on classification performance. The aims of this study were to classify the behaviors of goats using a back-mounted 9-axis multi sensor (a tri-axial accelerometer, a tri-axial gyroscope, and a tri-axial magnetometer) with machine learning algorithms, and to evaluate changes in the predictive scores by equalizing the prevalence of each behavior. The behaviors of three goats grazing on an experimental pasture were logged for approximately 12 h with the multi sensors. The behaviors were recorded at 1-second intervals with time-lapse cameras throughout the experimental period. Three behaviors were classified: lying, standing, and grazing. Over 100 different variables were extracted from the raw sensor data, and classification was executed by inputting the variables into two supervised machine learning algorithms: K-nearest neighbors (KNN) and decision tree (DT). Moreover, because the prevalence of standing was low compared to that of grazing, the number of observations of each behavior in the training datasets for classification models was equalized by undersampling. As expected, the results indicated that the overall accuracies of both algorithms using all variables derived from the three sensors were higher than those using only variables from the acceleration data. Furthermore, both the algorithms using the variables from the acceleration and magnetism data could classify the behaviors as accurate as the algorithms using variables from all sensor data. Balancing the prevalence of each behavior resulted in a decrease in the F1 scores of the lying and grazing classifications but a slight increase in those of the standing classification by DT. In conclusion, our results suggest that, in addition to tri-axial acceleration, tri-axial magnetism is useful for classifying lying, standing, and grazing activities of ruminants and that equalizing the number of data for each behavior is important to correctly assess the predictive accuracy of behavioral classifications, particularly for the behavior with low prevalence.

[1]  Edward A. Codling,et al.  Classification of behaviour in housed dairy cows using an accelerometer-based activity monitoring system , 2015, Animal Biotelemetry.

[2]  Md. Sumon Shahriar,et al.  Behavior classification of cows fitted with motion collars: Decomposing multi-class classification into a set of binary problems , 2016, Comput. Electron. Agric..

[3]  Orr Spiegel,et al.  AcceleRater: a web application for supervised learning of behavioral modes from acceleration measurements , 2014, Movement ecology.

[4]  Eugene D. Ungar,et al.  Classifying cattle jaw movements: Comparing IGER Behaviour Recorder and acoustic techniques , 2006 .

[5]  Stephen Dodd,et al.  Interpreting behaviors from accelerometry: a method combining simplicity and objectivity , 2015, Ecology and evolution.

[6]  Rory P. Wilson,et al.  Assessing the development and application of the accelerometry technique for estimating energy expenditure. , 2011, Comparative biochemistry and physiology. Part A, Molecular & integrative physiology.

[7]  Keith A. Ellis,et al.  Feature Selection and Comparison of Machine Learning Algorithms in Classification of Grazing and Rumination Behaviour in Sheep , 2018, Sensors.

[8]  Nobuaki Arai,et al.  Animal-mounted gyroscope/accelerometer/magnetometer: In situ measurement of the movement performance of fast-start behaviour in fish , 2014 .

[9]  Y. Naito,et al.  A method for reconstructing three-dimensional dive profiles of marine mammals using geomagnetic intensity data: results from two lactating Weddell seals , 2003, Polar Biology.

[10]  Rory P. Wilson,et al.  Moving towards acceleration for estimates of activity-specific metabolic rate in free-living animals: the case of the cormorant. , 2006, The Journal of animal ecology.

[11]  Manuel K. Schneider,et al.  Inferring Behavioral States of Grazing Livestock from High-Frequency Position Data Alone , 2014, PloS one.

[12]  N. Arai,et al.  Monitoring attitude and dynamic acceleration of free-moving aquatic animals using a gyroscope , 2012 .

[13]  A. Ozgul,et al.  Behavioural compass: animal behaviour recognition using magnetometers , 2019, Movement ecology.

[14]  Léon Bottou,et al.  Local Learning Algorithms , 1992, Neural Computation.

[15]  Rory P. Wilson,et al.  Tri-Axial Dynamic Acceleration as a Proxy for Animal Energy Expenditure; Should We Be Summing Values or Calculating the Vector? , 2012, PloS one.

[16]  Wensheng Wang,et al.  Comparison of grazing behaviour of sheep on pasture with different sward surface heights using an inertial measurement unit sensor , 2018, Comput. Electron. Agric..

[17]  Joachim M. Buhmann,et al.  The Balanced Accuracy and Its Posterior Distribution , 2010, 2010 20th International Conference on Pattern Recognition.

[18]  Klaus Manfred Scheibe,et al.  Application testing of a new three-dimensional acceleration measuring system with wireless data transfer (WAS) for behavior analysis , 2006, Behavior research methods.

[19]  Kazato Oishi,et al.  Application of Overall Dynamic Body Acceleration as a Proxy for Estimating the Energy Expenditure of Grazing Farm Animals: Relationship with Heart Rate , 2015, PloS one.

[20]  Guy W. Oliver,et al.  Visualizing the tracking and diving behavior of marine mammals: a case study , 1995, Proceedings Visualization '95.

[21]  Rory P. Wilson,et al.  Identification of animal movement patterns using tri-axial magnetometry , 2017, Movement ecology.

[22]  David J. Augustine,et al.  Assessing Herbivore Foraging Behavior with GPS Collars in a Semiarid Grassland , 2013, Sensors.

[23]  Anthony Winterlich,et al.  Evaluation of sampling frequency, window size and sensor position for classification of sheep behaviour , 2018, Royal Society Open Science.

[24]  B J White,et al.  BIG DATA ANALYTICS AND PRECISION ANIMAL AGRICULTURE SYMPOSIUM: Data to decisions. , 2018, Journal of animal science.

[25]  L. Halsey,et al.  Accelerometry to Estimate Energy Expenditure during Activity: Best Practice with Data Loggers , 2008, Physiological and Biochemical Zoology.

[26]  Carlos M. Duarte,et al.  Estimates for energy expenditure in free-living animals using acceleration proxies; a reappraisal. , 2019, The Journal of animal ecology.

[27]  M. Kolehmainen,et al.  Cow behaviour pattern recognition using a three-dimensional accelerometer and support vector machines , 2009 .

[28]  Haibo He,et al.  Learning from Imbalanced Data , 2009, IEEE Transactions on Knowledge and Data Engineering.

[29]  Corrado Dimauro,et al.  Automatic classification system for grazing, ruminating and resting behaviour of dairy sheep using a tri-axial accelerometer , 2017 .

[30]  Andrew E. Myers,et al.  Derivation of body motion via appropriate smoothing of acceleration data , 2008 .

[31]  Andreas Buerkert,et al.  Use of a tri-axial accelerometer for automated recording and classification of goats' grazing behaviour , 2009 .

[32]  Kensuke Kawamura,et al.  Development of an automatic classification system for eating, ruminating and resting behavior of cattle using an accelerometer , 2008 .

[33]  Greg P. Timms,et al.  Bag of Class Posteriors, a new multivariate time series classifier applied to animal behaviour identification , 2015, Expert Syst. Appl..

[34]  J. A. Lines,et al.  A review of livestock monitoring and the need for integrated systems , 1997 .

[35]  John Joseph Valletta,et al.  Applications of machine learning in animal behaviour studies , 2017, Animal Behaviour.

[36]  H. Kumagai,et al.  Estimation of the energy expenditure of grazing ruminants by incorporating dynamic body acceleration into a conventional energy requirement system. , 2017, Journal of animal science.

[37]  Lei Zhao,et al.  A Practical GPU Based KNN Algorithm , 2009 .

[38]  Francisco Herrera,et al.  An insight into classification with imbalanced data: Empirical results and current trends on using data intrinsic characteristics , 2013, Inf. Sci..

[39]  Rory P. Wilson,et al.  Construction of energy landscapes can clarify the movement and distribution of foraging animals , 2012, Proceedings of the Royal Society B: Biological Sciences.

[40]  David E. Amrine,et al.  Comparison of classification algorithms to predict outcomes of feedlot cattle identified and treated for bovine respiratory disease , 2014 .

[41]  E A Codling,et al.  Use of novel sensors combining local positioning and acceleration to measure feeding behavior differences associated with lameness in dairy cattle. , 2018, Journal of dairy science.

[42]  Juan Ramón Rico-Juan,et al.  Clustering-based k-nearest neighbor classification for large-scale data with neural codes representation , 2018, Pattern Recognit..

[43]  Greg Bishop-Hurley,et al.  Behavioral classification of data from collars containing motion sensors in grazing cattle , 2015, Comput. Electron. Agric..

[44]  Brad J. White,et al.  Predicting bull behavior events in a multiple-sire pasture with video analysis, accelerometers, and classification algorithms , 2017, Comput. Electron. Agric..

[45]  H. Kumagai,et al.  Correcting the Activity-Specific Component of Heart Rate Variability Using Dynamic Body Acceleration Under Free-Moving Conditions , 2018, Front. Physiol..

[46]  J. Hutchinson,et al.  Simple heuristics and rules of thumb: Where psychologists and behavioural biologists might meet , 2005, Behavioural Processes.

[47]  V. H. Oddy,et al.  Using a three-axis accelerometer to identify and classify sheep behaviour at pasture , 2016 .

[48]  Michael T. Rose,et al.  Fixed-time data segmentation and behavior classification of pasture-based cattle: Enhancing performance using a hidden Markov model , 2017 .

[49]  Mark Trotter,et al.  Categorising sheep activity using a tri-axial accelerometer , 2018, Comput. Electron. Agric..