Do you see the pattern? Make the most of sensor data in dairy cows

Abstract Sensors are increasingly being used to monitor animal behaviour. Data handling methods have, however, lagged behind the continuous data stream to some extent, often being limited to summarizing data into daily averages at group level. This research reflection presents our opinion of the neglected application of 24-h pattern analysis. Recent studies of dairy cow behaviour have demonstrated that additional ways of analysing data improve our understanding of animal behaviour and add value to data that were already retrieved. The terminology for the described 24-h patterns differs between these studies, making them difficult to compare. Thus, diurnal, circadian, daily, periodicity and 24-h pattern are all terms used to describe dairy cow activities over a 24-h period. Several studies have shown that the 24-h behavioural pattern at herd level is relatively consistent over time, and that with well-established management routines, a specific herd signature will be evident. However, within a herd, individual cows may have individual 24-h patterns with more or less variability. Recent studies suggest that deviations from herd and/or individual 24-h patterns can be used to describe cow robustness, as well as to predict disease. We strongly believe that individual and herd 24-h patterns provide a great deal of information about behaviour and that these patterns offer opportunity for more precise and timely health management and welfare monitoring.

In this research reflection, we present the opinion that 24-h pattern analysis has wider applications than so far presented in dairy research.Many species exhibit patterns in their behaviour and physiology which cycle through the course of 24-h.These patterns are not simply a response to the physical environment, such as light and dark, they are governed by a biological clock, a timekeeping system, in the brain and are called circadian rhythms (Vitaterna et al., 2001).In dairy cows, these rhythms have been studied for behaviours such as activity and rumination time around oestrus (Reith et al., 2014), activity in relation to lameness, mastitis and oestrus (Veissier et al., 2017), as well as the time profile of visits to milking robots (Løvendahl and Buitenhuis, 2022).In addition, the behaviour of housed dairy cows is largely determined by feeding times and concurrent milking (when milked in a milking parlour as opposed to milking in a robot where cows access voluntarily and may have variable milking intervals).
Historically, animal behaviour was recorded by humans performing focal scan sampling, then over the past two decades sensors were increasingly introduced to record different aspects of animal behaviour.Through the rise of precision livestock farming, more and more sensors generate detailed time-series data, often with several data points per second, which are aggregated to the minute or hour either by the sensor itself or via a software system processing the sensor output.For ease of analysis and interpretation, often the minute or hourly aggregated data are converted to daily values, such as daily rumination time or daily number of steps.Aggregation has provided useful information on the time budgets of dairy cows.For example, we now know that a cow's daily time budget is affected by breed, parity, lactation stage and season (Maselyne et al., 2017;Munksgaard et al., 2020).However, cows show daily variations in behaviour and physiology, so additional meaning is conveyed by determining when an event occurs (Casey and Plaut, 2022).This makes it worthwhile to investigate the 24-h pattern of behaviour, both for management purposes and for disease detection.Hence, experiments showed that dry matter intake was unchanged, but overstocking resulted in shorter feeding time and higher feeding rate and different distribution of feeding time across the day (Fregonesi et al., 2007;Collings et al., 2011).Moreover, cows may shift their behaviour to when other cows are not present to avoid competition or compensate for missed time (Munksgaard et al., 2005;Cooper et al., 2008).In orther words, timing is of the essence.
We believe that additional ways of looking at data will provide additional insight as well as added value to data already collected.Through this research reflection, we offer new perspectives on behavioural data to animal scientists, data scientists and tech companies, and we present our opinion of purposes that 24-h pattern analysis may serve.

Terminology
Animal science uses a plethora of terms for animal behaviour patterns, making it difficult to find all and compare across studies.The following section describes some of these terms, highlighting their meaning, similarities, and usefulness.
Diurnal was used synonymously with circadian or circadian rhythm (Winter and Hillerton, 1995;Sheahan et al., 2013;Løvendahl and Buitenhuis, 2022).In zoology, diurnal means active during the light period of the day, as opposed to nocturnal, which means active during the night (Refinetti et al., 2007).Farmed animals, such as dairy cows, may exhibit most of their activity during the daylight hours, nevertheless, they also eat, drink, walk, ruminate, graze and so on at night-time.Indirectly, the terms diurnal and nocturnal divide the 24-h period into either day or night, suggesting a daytime vs. nighttime time-budget, that will only partially describe a behaviour pattern.Infrequently, the terms nycterohemeral or nyctohemeral, i.e., pertaining to both day and night, were used (Deswysen et al., 1993).Perhaps these terms are not intuitive to the general reader and although quite accurate, simpler terms would be preferred.
Daily pattern was the term used to describe synchrony of animals in the same group (Flury and Gygax, 2016), moreover, daily pattern and daily routine were used interchangeably to describe sickness behaviour (Dittrich et al., 2019).The word day is ambiguous, as it might refer to 'daytime' as well as to a 24-h period.In addition, a daily pattern might refer to a day-to-day pattern, or to a within-day pattern.Softer terms, such as periodicity (van Dixhoorn et al., 2018;Rhodes et al., 2022) and 'in relation to time of day' (Stoye et al., 2012) were also found.A term like 'periodicity' opens up to a wider understanding of a concept, which includes some regularity, but lacks immediate information on the length of period.'In relation to time of day' sets a clear timeframe for the period, although the expression might be considered slightly too wordy.
Finally, the term '24-h pattern' was used, for instance, to describe how methane emission (McGinn et al., 2011) and blood values of a dairy cow fluctuate during a 24-h period (Gibbs et al., 1998).In our opinion, '24-h pattern' is the most comprehensive, least ambiguous and intuitively most easily understood term amongst all of these for indicating a pattern from midnight to midnight.Midnight allows for patterns per date timestamp (convenient) and is less ambiguous than a more subjective start time of the day, also facilitating comparison among studies.We shall use the term 24-h pattern through the rest of our paper.

Herd patterns
When 24-h pattern data are available, these can be processed in multiple ways to distil information beyond a cow's daily time budget.The 24-h pattern of a dairy herd is predominantly determined by milking times, feeding regime and pasture access (Flury and Gygax, 2016;Kok et al., 2017;Hendriks et al., 2019).With regular management, herd 24-h patterns are relatively consistent, whereby they form a specific herd signature (Hendriks et al., 2019;Hut et al., 2022).This signature or baseline pattern may, for instance, be based on a rolling average of the previous week, where the variation can be used to create a confidence interval around periods of the day.
Given that 24-h behaviour patterns are largely the result of housing and management, these patterns can convey information about both aspects.A 24-h pattern of lying, standing or activity may, in itself, be useful feedback to farmers.For example, it can quantify the standing time around milking or the response to fresh feed delivery.This pattern may be an average pattern or herd signature based on a few days of monitoring (static pattern), that can be compared to other herds or benchmarks.Regarding housing, if never more than 50% of the cows are lying in a barn with sufficient lying space for all cows, some cows possibly do not perceive all lying spaces in the barn as suitable or available, or other sources of disturbance or competition may exist (Kok et al., 2023).Moreover, temporal events or stressors that affect behaviour can be detected through comparison of the current herd pattern to the pattern on previous days.Days with large deviations in the herd 24-h pattern may indicate disruptions or (un)conscious changes in management (as illustrated by the red, green and purple single day lines in Fig. 1), such as a veterinary visit, a broken milking robot or no feed delivered.Consequently, a signature 24-h pattern of a farm can be used to monitor management through comparison of the 'baseline' pattern and today's pattern (dynamic pattern).
Apart from enabling evaluation of management, 24-h herd patterns may reflect welfare aspects.Within a consistent herd pattern, environmental factors such as temperature also affect herd behaviour, causing deviations.Cows may collectively stand more during the day when experiencing heat stress, and possibly compensate for this at night.Such a shift in lying behaviour would show in the 24-h pattern, or when relevant periods of the day are compared (Herbut and Angrecka, 2018).Behavioural synchrony has been proposed as a positive welfare indicator (Keeling et al., 2021).Group behaviour, including synchrony of the monitored behaviour, can only be assessed using 24-h patterns.A daily time budget does not indicate how behavioural events (or periods) of individual cows coincide.

Individual patterns
Within a herd, individual cows may have individual 24-h patterns, where both inter-and intra-variability can be large (Fig. 2).Irrespective of when behaviours are performed, it can be relevant to assess the consistency of individual behaviour pattern across days.This analysis can be performed irrespective of herd pattern, using the sequence of 24-h pattern of cows on consecutive days.For example, the regularity of the 24-h pattern of individual cows was analysed using autocorrelations (van Dixhoorn et al., 2018) and Fourier analysis (Wagner et al., 2021).
A cow's individual 24-h pattern is, to some extent, enforced by herd management factors, e.g., fixed milking or feeding times, barn layout and comfort (Chapinal et al., 2013;Ito et al., 2014;Solano et al., 2016), and possibly a desire to behave in synchrony with herd mates (Stoye et al., 2012).Therefore also, the assessment of deviation of individual cow patterns from average herd pattern may be of value for health and welfare monitoring.For example, the ratio of daytime to nighttime activities may change due to lameness (van Hertem et al., 2013), possibly to avoid competition.An individual's behaviour deviating in duration, frequency or timing from its herd mates' behaviour may be quantified and could be informative of low social rank or disease.
Recent studies have shown behaviour patterns to be rather robust, and any deviance might indicate health or management issues, which exemplifies the importance of digging deeper into data rather than reporting daily averages or sums.Cows exhibiting a less robust pattern in eating and lying prior to calving were more prone to disease in the postpartum period (van Dixhoorn et al., 2018).The effect of disease on rumination time in cows has been described in many studies, most recently by Zhou et al. (2022), who showed that rumination duration in diseased cows decreased compared with healthy cows prior to clinical signs.Moreover, the diseased cows displayed an increase in the ratio of rumination time at daytime compared to nighttime, indicating a deviance in timing from their normal rhythm (Zhou et al., 2022).Both nighttime rumination time and the ratio between daytime and nighttime rumination time, as well as the difference between recorded and expected rumination time per 2-h, were important features for the prediction of healthy vs. diseased cows using classification models.As suggested by Rhodes et al. (2022), computing and visualizing the intensity of a 24-h pattern will provide information regarding the strength of periodicity of the individual that is not detectable directly from movement data.By applying the theory of lack of robustness being a sign of upcoming disease to the lying distribution in Figure 2, it becomes apparent that cow 120 might be in need of extra supervision.Such an observation would not have been obvious using only daily summaries.Indeed, a more detailed analysis of the patterns will add precision to Precision Livestock Farming.

Discussion
The objective of this research reflection was to highlight the purposes that the analysis of 24-h patterns may serve.We propose that behaviour data are analysed beyond daily summaries and herd averages, taking the timing of events and the individual animal into account.Only a few studies have investigated the individual patterns of each animal and compared them with herd patterns with the aim of detecting consistency, or lack thereof.Cows show consistency in a number of behaviours, which opens up to further analysis and new ways of identifying disease or obtaining animal characteristics for improved resilience and welfare of the cows.Thus, Stachowicz and Umstätter (2021) argued that rhythmicity of behaviour is an overlooked indicator of welfare issues.Løvendahl and Buitenhuis (2022) computed consistency across days of milking time patterns in an automatic milking system to reflect how uniformly the visits to the milking robot were distributed across days.Refinetti and Piccione (2005) used the regularity of a waveform to distinguish inter-and intra-variability in body temperature in rats, dogs, and horses to show the daily rhythm and consistency over days.Refinetti et al. (2007) presented Fourier analysis for numerical analysis of circadian rhythms in their review, an approach that was successfully used in cows to detect changes in rhythm associated with health and reproductive events (Wagner et al., 2021).A recent publication on mastitis detection reviewed approaches and methods that may also be used for 24-h pattern analysis (van der Voort et al., 2021).Furthermore, the consistency of cow milking order was explored using unsupervised machine learning techniques (McVey et al., 2020).
Analysis of 24-h patterns in dairy cows can benefit from methodologies and developments used in other species.Traditionally, dairy barns have been the most connected systems, yet recently other species have also applied advanced technology systems, increasing the possibility to study 24-hour patterns.In laying hens, for example, consistency of 24-h location and movement patterns of individual hens through the henhouse were assessed through three types of clustering analysis.Patterns were consistent across days and different between individuals (Rufener et al., 2018).In cows, individual cows were not more similar than different cows across days, when a clustering was applied on activity and area use in the barn per minute (Stachowicz et al., 2022).However, classification of different features of 24-h patterns may help discriminate between healthy and sick cows prior to clinical symptoms (Stachowicz et al., 2022;Zhou et al., 2022).
Analysis of behavioural patterns can be used for various purposes and may serve as indicators of positive or negative welfare, depending on the analysed behaviour.Herd patterns reflect herd level events which can be used to detect potential stressors, e.g.heat stress or disruptions in feeding or milking management, whereas degree of herd synchrony might link to positive welfare, although this remains to be validated (Kok et al., 2023).Individual patterns, in contrast, reveal more about individual events (calving, oestrus, disease).Pattern stability of individuals over time may be relevant to detect such events (Van Dixhoorn et al., 2018), whereas individual patterns of one day are often too variable to be of much use without context.In addition, using the cow as its own control across time combined with a comparison of what the herd or group does will provide a higher degree of precision when detecting individual events, in comparison to a focus on the individual cow only or comparing individual patterns between cows.Moreover, integration of features from different sensors in this process is likely to improve precision when detecting events.Once the features of behavioural patterns from one or multiple sensors have been established, artificial intelligence may help identifying the most relevant feature sets.
Access to higher granularity data for research purposes can be challenging, as most commercial software presents summaries and alerts that the farmers can readily use in their daily management.However, several sensor suppliers do store data with high granularity that can be accessed through agreements, either as in-kind contribution to research or at a cost.In addition, there are several research focused systems on the market where data is shared more freely.To advance this research area, we encourage companies to provide solutions for sharing data, and researchers to show a demand and emphasize the potential application for highly granular data.In addition to higher granularity data, specification of metadata, such as time, time zone, longitude, latitude and study period would be necessary to determine the natural light period and climate, which would enable further analysis and comparison.Ideally also, the timing of routine management such as milking, feeding and grazing should be documented.
In conclusion, we strongly believe that analysing 24-h patterns provides a large amount of extra information about the behaviour of herds and of the individual cow relative to her pen-mates, which in turn offers opportunity for more precise and timely detection of deviations.Combined, the knowledge obtained from 24-h patterns both at herd-level and cow-level will provide us with an extra dimension of quantification of cow behaviour to assess management and welfare.In other words, let us make more sense of the sensor data that we are already collecting.

Figure 1 .
Figure1.Average herd 24-h pattern of lying behaviour (thick orange line), and daily 24-h pattern of lying behaviour from 1 to 24 August 2019 (1 line per day) of a dairy farm with twice daily milking and pasture access during the day in between milkings.Average lying time ± SD across this period was 10.4 ± 0.65.