Machine Learning Algorithms to Classify and Quantify Multiple Behaviours in Dairy Calves Using a Sensor: Moving beyond Classification in Precision Livestock
Abstract
:1. Introduction
- Create machine learning algorithms to classify two postures (standing and lying) and seven behaviours (locomotor play, self-grooming, active lying, non-active lying, non-nutritive sucking at the automatic feeder, nutritive sucking at the feeder, and ruminating) using a single sensor.
- Explore signal feature importance and the impact of sampling frequency on classification performance.
- Implement a quantification algorithm to accurately estimate the number of samples of locomotor play behaviour in test dataset with a low prevalence of positive samples.
2. Materials and Methods
2.1. Raw Data Collection
2.2. Behavioural Observations
2.3. Data Processing
2.4. Classification Algorithm
2.5. Quantification Algorithm
2.6. Feature Ranking and Down-Sampling
- for down-sampling to 50 Hz.
- for down-sampling to 20 Hz.
- for down-sampling to 10 Hz.
- for down-sampling to 4 Hz.
3. Results
3.1. Classification Results
3.2. Feature Ranking and Down-Sampling
3.3. Quantification Results
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Broom, D.M. The scientific assessment of animal welfare. Appl. Anim. Behav. Sci. 1988, 20, 5–19. [Google Scholar] [CrossRef]
- Dawkins, M.S. Behaviour as a tool in the assessment of animal welfare. Zoology 2003, 106, 383–387. [Google Scholar] [CrossRef] [PubMed]
- Weary, D.M.; Huzzey, J.M.; Von Keyserlingk, M.A.G. Board-invited review: Using behaviour to predict and identify ill health in animals. J. Anim. Sci. 2009, 87, 770–777. [Google Scholar] [CrossRef] [Green Version]
- Cooke, S.J.; Hinch, S.G.; Wikelski, M.; Andrews, R.D.; Kuchel, L.J.; Wolcott, T.G.; Butler, P.J. Biotelemetry: A mechanistic approach to ecology. Trends Ecol. Evol. 2004, 19, 334–343. [Google Scholar] [CrossRef] [PubMed]
- Brown, D.D.; Kays, R.; Wikelski, M.; Wilson, R.; Klimley, A.P. Observing the unwatchable through acceleration logging of animal behaviour. Anim. Biotelemetry 2013, 1, 20. [Google Scholar] [CrossRef] [Green Version]
- Berckmans, D. Precision livestock farming technologies for welfare management in intensive livestock systems. Rev. Sci. Tech. 2014, 33, 189–196. [Google Scholar] [CrossRef] [PubMed]
- Robert, B.; White, B.J.; Renter, D.G.; Larson, R.L. Evaluation of three-dimensional accelerometers to monitor and classify behaviour patterns in cattle. Comput. Electron. Agric. 2009, 67, 80–84. [Google Scholar] [CrossRef]
- Swartz, T.H.; McGilliard, M.L.; Petersson-Wolfe, C.S. Technical note: The use of an accelerometer for measuring step activity and lying behaviors in dairy calves. J. Dairy Sci. 2016, 99, 9109–9113. [Google Scholar] [CrossRef] [Green Version]
- Hanzlicek, G.A.; White, B.J.; Mosier, D.; Renter, D.G.; Anderson, D.E. Serial evaluation of physiologic, pathological, and behavioural changes related to disease progression of experimentally induced Mannheimia haemolytica pneumonia in postweaned calves. Am. J. Vet. Res. 2010, 71, 359–369. [Google Scholar] [CrossRef]
- Toaff-Rosenstein, R.L.; Gershwin, L.J.; Zanella, A.J.; Tucker, C.B. The sickness response in steers with induced bovine respiratory disease before and after treatment with a non-steroidal anti-inflammatory drug. Appl. Anim. Behav. Sci. 2016, 181, 49–62. [Google Scholar] [CrossRef]
- Costa, J.H.; Cantor, M.C.; Neave, H.W. Symposium review: Precision technologies for dairy calves and management applications. J. Dairy Sci. 2020. [Google Scholar] [CrossRef] [PubMed]
- Roland, L.; Schweinzer, V.; Kanz, P.; Sattlecker, G.; Kickinger, F.; Lidauer, L.; Berger, A.; Auer, W.; Mayer, J.; Sturm, V.; et al. Evaluation of a triaxial accelerometer for monitoring selected behaviours in dairy calves. J. Dairy Sci. 2018, 101, 10421–10427. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Matthews, S.G.; Miller, A.L.; Clapp, J.; Plötz, T.; Kyriazakis, I. Early detection of health and welfare compromises through automated detection of behavioural changes in pigs. Vet. J. 2016, 217, 43–51. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Matthews, S.G.; Miller, A.L.; PlÖtz, T.; Kyriazakis, I. Automated tracking to measure behavioural changes in pigs for health and welfare monitoring. Sci. Rep. 2017, 7, 17582. [Google Scholar] [CrossRef]
- Borderas, T.F.; De Passillé, A.M.; Rushen, J. Behaviour of dairy calves after a low dose of bacterial endotoxin. J. Anim. Sci. 2008, 86, 2920–2927. [Google Scholar] [CrossRef] [PubMed]
- Crestani, F.; Seguy, F.; Dantzer, R. Behavioural effects of peripherally injected interleukin-1: Role of prostaglandins. Brain Res. 1991, 542, 330–335. [Google Scholar] [CrossRef]
- Hixson, C.L.; Krawczel, P.D.; Caldwell, J.M.; Miller-Cushon, E.K. Behavioural changes in group-housed dairy calves infected with Mannheimia haemolytica. J. Dairy Sci. 2018, 101, 10351–10360. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Svensson, C.; Jensen, M.B. Identification of diseased calves by use of data from automatic milk feeders. J. Dairy Sci. 2007, 90, 994–997. [Google Scholar] [CrossRef]
- Fagen, R. Animal Play Behaviour; Oxford University Press: New York, NY, USA, 1981. [Google Scholar]
- Krachun, C.; Rushen, J.; de Passillé, A.M. Play behaviour in dairy calves is reduced by weaning and by a low energy intake. Appl. Anim. Behav. Sci. 2010, 122, 71–76. [Google Scholar] [CrossRef]
- Rushen, J.; de Passillé, A.M. Automated measurement of acceleration can detect effects of age, dehorning and weaning on locomotor play of calves. Appl. Anim. Behav. Sci. 2012, 139, 169–174. [Google Scholar] [CrossRef]
- Forman, G. Quantifying counts and costs via classification. Data Min. Knowl. Disc. 2008, 17, 164–206. [Google Scholar] [CrossRef]
- Brenner, H.; Gefeller, O.L.A.F. Variation of sensitivity, specificity, likelihood ratios and predictive values with disease prevalence. Stat. Med. 1997, 16, 981–991. [Google Scholar] [CrossRef]
- Größbacher, V.; Bučková, K.; Lawrence, A.B.; Špinka, M.; Winckler, C. Discriminating spontaneous locomotor play of dairy calves using accelerometers. J. Dairy Sci. 2020, 103, 1866–1873. [Google Scholar] [CrossRef]
- Trénel, P.; Jensen, M.B.; Decker, E.L.; Skjøth, F. Quantifying and characterizing behaviour in dairy calves using the IceTag automatic recording device. J. Dairy Sci. 2009, 92, 3397–3401. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Rodrigues, J.P.P.; Pereira, L.G.R.; Neto, H.D.C.D.; Lombardi, M.C.; de Assis Lage, C.F.; Coelho, S.G.; Sacramento, J.P.; Machado, F.S.; Tomich, T.R.; Maurício, R.M.; et al. Evaluation of an automatic system for monitoring rumination time in weaning calves. Livest. Sci. 2019, 219, 86–90. [Google Scholar] [CrossRef]
- Walton, E.; Casey, C.; Mitsch, J.; Vázquez-Diosdado, J.A.; Yan, J.; Dottorini, T.; Ellis, K.A.; Winterlich, A.; Kaler, J. Evaluation of sampling frequency, window size and sensor position for classification of sheep behaviour. R. Soc. Open Sci. 2018, 5, 171442. [Google Scholar] [CrossRef] [Green Version]
- Bulling, A.; Blanke, U.; Schiele, B. A tutorial on human activity recognition using body-worn inertial sensors. ACM Comput. Surv. 2014, 46, 1–33. [Google Scholar] [CrossRef]
- Rokach, L. Ensemble-based classifiers. Artif. Intell. Rev. 2010, 33, 1–39. [Google Scholar] [CrossRef]
- Kohavi, R. A study of cross-validation and bootstrap for accuracy estimation and model selection. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI), Montreal, QC, Canada, 20–25 August 1995; pp. 1137–1145. [Google Scholar]
- He, H.; Garcia, E.A. Learning from imbalanced data. IEEE Trans. Knowl. Data Eng. 2009, 21, 1263–1284. [Google Scholar] [CrossRef]
- Ben-David, A. Comparison of classification accuracy using Cohen’s weighted kappa. Expert Syst. Appl. 2008, 34, 825–832. [Google Scholar] [CrossRef]
- Dohoo, I.R.; Martin, W.; Stryhn, H.E. Veterinary Epidemiologic Research; AVC Inc.: Charlottetown, PEI, Canada, 2003. [Google Scholar]
- Kononenko, I. Estimating attributes: Analysis and extensions of RELIEF. In European Conference on Machine Learning; Springer: Berlin/Heidelberg, Germany, 1994; pp. 171–182. [Google Scholar] [CrossRef] [Green Version]
- Vázquez-Diosdado, J.A.V.; Barker, Z.E.; Hodges, H.R.; Amory, J.R.; Croft, D.P.; Bell, N.J.; Codling, E.A. Classification of behaviour in housed dairy cows using an accelerometer-based activity monitoring system. Anim. Biotelemetry 2015, 3, 15. [Google Scholar] [CrossRef] [Green Version]
- Martiskainen, P.; Järvinen, M.; Skön, J.P.; Tiirikainen, J.; Kolehmainen, M.; Mononen, J. Cow behaviour pattern recognition using a three-dimensional accelerometer and support vector machines. Appl. Anim. Behav. Sci. 2009, 119, 32–38. [Google Scholar] [CrossRef]
- Barwick, J.; Lamb, D.W.; Dobos, R.; Welch, M.; Trotter, M. Categorising sheep activity using a tri-axial accelerometer. Comput. Electron. Agric. 2018, 145, 289–297. [Google Scholar] [CrossRef]
- Hokkanen, A.H.; Hänninen, L.; Tiusanen, J.; Pastell, M. Predicting sleep and lying time of calves with a support vector machine classifier using accelerometer data. Appl. Anim. Behav. Sci. 2011, 134, 10–15. [Google Scholar] [CrossRef]
- Gladden, N.; Cuthbert, E.; Ellis, K.; McKeegan, D. Use of a tri-axial accelerometer can reliably detect play behaviour in newborn calves. Animals 2020, 10, 1137. [Google Scholar] [CrossRef]
- Fawcett, T.; Flach, P.A. A response to webb and ting’s on the application of ROC analysis to predict classification performance under varying class distributions. Mach. Learn. 2005, 58, 33–38. [Google Scholar] [CrossRef] [Green Version]
- Vázquez-Diosdado, J.A.; Paul, V.; Ellis, K.A.; Coates, D.; Loomba, R.; Kaler, J. A combined offline and online algorithm for real-time and long-term classification of sheep behaviour: Novel approach for precision livestock farming. Sensors 2019, 19, 3201. [Google Scholar] [CrossRef] [Green Version]
- Vázquez-Diosdado, J.A.; Miguel-Pacheco, G.G.; Plant, B.; Dottorini, T.; Green, M.; Kaler, J. Developing and evaluating threshold-based algorithms to detect drinking behaviour in dairy cows using reticulorumen temperature. J. Dairy. Sci. 2019, 102, 10471–10482. [Google Scholar] [CrossRef] [Green Version]
- Mansbridge, N.; Mitsch, J.; Bollard, N.; Ellis, K.; Miguel-Pacheco, G.G.; Dottorini, T.; Kaler, J. Feature selection and comparison of machine learning algorithms in classification of grazing and rumination behaviour in sheep. Sensors 2018, 18, 3532. [Google Scholar] [CrossRef] [Green Version]
Posture states | Description |
Lying | Calf is lying down on the sternum or side, body to the floor. |
Standing | Calf is standing and shows head movements and may be moving one or more limbs in a forward or backwards motion. |
Behaviour states | Description |
Non-active lying | Calf lying down on the sternum or side, body on the floor with head not moving. |
Active lying | Calf is lying down and with the head lifted from the ground, supported by the neck and moving. |
Ruminating | Calf is lying down and shows regular jaw movements interrupted by regurgitation and swallow cycles with the head remaining in a constant position. |
Self-grooming | All self-grooming movements where tongue is visible across body surface. |
Nutritive suckling | Calf is standing in milk feeder, holds teat in his/her mouth and makes swallowing movements. The automatic feeder dispenses milk (milk flows through tube visible on video). |
Non-nutritive suckling | Calf is standing in milk feeder, regularly (<every 3 s) holds teat in his/her mouth. The automatic feeder does not dispense any milk (milk does not flow through tube visible on video). |
Locomotor play | Rapid forward movement that lasts 3 s or longer (in real time) and could include instances of jumping or bucking. It includes all instances of trotting (two beat leg movements synchronized diagonally), cantering (three-beat gait in between a trot and a gallop) and galloping (four-beat gait with a phase where all legs are off the ground). |
Postures | Behaviours | |
---|---|---|
Rank | Feature Characteristics | Feature Characteristic |
1 | Minimum | Difference Zero crossing |
2 | First quantile * | Zero Crossings |
3 | Minimum * | Kurtosis |
4 | Difference Kurtosis | Difference Zero Crossing * |
5 | Difference Spectral Entropy * | Zero Crossing * |
6 | Mean | Min |
7 | Signal Area | Difference Spectral Entropy * |
8 | Difference Zero Crossing | Kurtosis |
9 | Difference Zero Crossing | Difference Kurtosis |
10 | Spectral Entropy * | Signal Area * |
Sampling Frequency (Hz) | 50 | 20 | 10 | 4 |
---|---|---|---|---|
% decrease in Accuracy from 100 Hz | ||||
Active Lying | 1.33 | 2.16 | 3.37 | 4.78 |
Non-Active Lying | 0.04 | 0.49 | 1.63 | 1.67 |
Ruminating | 0.49 | 2.16 | 2.20 | 5.35 |
Non-nutritive Suckling | 0.42 | 1.55 | 2.96 | 6.14 |
Nutritive Suckling | 0.00 | 0.87 | 2.99 | 6.33 |
Self-Grooming | 0.42 | 0.98 | 1.55 | 3.15 |
Locomotor Play | 0.00 | 0.00 | 0.00 | 0.19 |
% decrease in Specificity from 100 Hz | ||||
Active Lying | 1.34 | 0.67 | 0.89 | 1.74 |
Non-Active Lying | 0.13 | 0.53 | 1.16 | 1.61 |
Ruminating | 0.22 | 1.83 | 1.92 | 3.48 |
Non-nutritive Suckling | 0.09 | 0.84 | 1.96 | 3.61 |
Nutritive Suckling | 0.09 | 0.67 | 1.92 | 3.92 |
Self-Grooming | 0.00 | 0.30 | 0.76 | 1.60 |
Locomotor Play | 0.00 | 0.00 | 0.00 | 0.00 |
% decrease in Recall from 100 Hz | ||||
Active Lying | 1.26 | 10.61 | 17.42 | 21.97 |
Non-Active Lying | 1.01 | 0.25 | 4.29 | 2.02 |
Ruminating | 2.02 | 4.04 | 3.79 | 15.91 |
Non-nutritive Suckling | 2.30 | 5.61 | 8.67 | 20.66 |
Nutritive Suckling | 0.00 | 2.02 | 9.09 | 19.95 |
Self-Grooming | 4.78 | 6.99 | 8.52 | 16.73 |
Locomotor Play | 0.00 | 0.00 | 0.00 | 0.25 |
% decrease in Precision from 100 Hz | ||||
Active Lying | 5.72 | 6.86 | 11.04 | 16.88 |
Non-Active Lying | 0.00 | 2.41 | 5.79 | 7.14 |
Ruminating | 1.43 | 8.75 | 9.03 | 18.50 |
Non-nutritive Suckling | 0.80 | 4.60 | 9.57 | 18.88 |
Nutritive Suckling | 0.39 | 3.81 | 11.24 | 23.00 |
Self-Grooming | 0.00 | 3.08 | 6.88 | 14.55 |
Locomotor Play | 0.00 | 0.00 | 0.00 | 1.01 |
% decrease in F-score from 100 Hz | ||||
Active Lying | 3.39 | 8.98 | 14.77 | 19.89 |
Non-Active Lying | 0.24 | 1.40 | 5.09 | 4.79 |
Ruminating | 1.73 | 6.44 | 6.47 | 17.21 |
Non-nutritive Suckling | 1.49 | 5.07 | 9.19 | 19.73 |
Nutritive Suckling | 0 | 2.86 | 10.11 | 21.41 |
Self-Grooming | 2.31 | 5.05 | 7.69 | 15.64 |
Locomotor Play | 0 | 0 | 0 | 0.63 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Carslake, C.; Vázquez-Diosdado, J.A.; Kaler, J. Machine Learning Algorithms to Classify and Quantify Multiple Behaviours in Dairy Calves Using a Sensor: Moving beyond Classification in Precision Livestock. Sensors 2021, 21, 88. https://doi.org/10.3390/s21010088
Carslake C, Vázquez-Diosdado JA, Kaler J. Machine Learning Algorithms to Classify and Quantify Multiple Behaviours in Dairy Calves Using a Sensor: Moving beyond Classification in Precision Livestock. Sensors. 2021; 21(1):88. https://doi.org/10.3390/s21010088
Chicago/Turabian StyleCarslake, Charles, Jorge A. Vázquez-Diosdado, and Jasmeet Kaler. 2021. "Machine Learning Algorithms to Classify and Quantify Multiple Behaviours in Dairy Calves Using a Sensor: Moving beyond Classification in Precision Livestock" Sensors 21, no. 1: 88. https://doi.org/10.3390/s21010088
APA StyleCarslake, C., Vázquez-Diosdado, J. A., & Kaler, J. (2021). Machine Learning Algorithms to Classify and Quantify Multiple Behaviours in Dairy Calves Using a Sensor: Moving beyond Classification in Precision Livestock. Sensors, 21(1), 88. https://doi.org/10.3390/s21010088