Machine learning prediction of sleep stages in dairy cows from heart rate and muscle activity measures

Laura Hunter*, Abdul Baten, MJ Haskell, Fritha Langford, Cheryl O'Connor, James Webster, Kevin Stafford

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

7 Citations (Scopus)
74 Downloads (Pure)


Sleep is important for cow health and shows promise as a tool for assessing welfare, but methods to accurately distinguish between important sleep stages are difficult and impractical to use with cattle in typical farm environments. The objective of this study was to determine if data from more easily applied non-invasive devices assessing neck muscle activity and heart rate (HR) alone could be used to differentiate between sleep stages. We developed, trained, and compared two machine learning models using neural networks and random forest algorithms to predict sleep stages from 15 variables (features) of the muscle activity and HR data collected from 12 cows in two environments. Using k-fold cross validation we compared the success of the models to the gold standard, Polysomnography (PSG). Overall, both models learned from the data and were able to accurately predict sleep stages from HR and muscle activity alone with classification accuracy in the range of similar human models. Further research is required to validate the models with a larger sample size, but the proposed methodology appears to give an accurate representation of sleep stages in cattle and could consequentially enable future sleep research into conditions affecting cow sleep and welfare.
Original languageEnglish
Article number10938
JournalScientific Reports
Early online date25 May 2021
Publication statusFirst published - 25 May 2021


Dive into the research topics of 'Machine learning prediction of sleep stages in dairy cows from heart rate and muscle activity measures'. Together they form a unique fingerprint.

Cite this