Accelerometer systems as tools for health and welfare assessment in cattle and pigs – A review

Welfare assessment has traditionally been performed by direct observation by humans, providing information at only selected points in time. Recently, this assessment method has been questioned, as 'Precision Livestock Farming' technologies may be able to deliver more valid, reliable and feasible real-time data at the individual level and serve as early monitoring systems for animal welfare. The aim of this paper is to describe how accelerometers can be used for welfare assessment based on the principles of the Welfare Quality assessment protocol. Algorithm development is based mainly on the detection of behavioural traits. So far, high accuracies have been found for movement and resting behaviours in cows and pigs, while algorithm development for feeding and drinking behaviours in pigs lag behind progress in cows where valid algorithms are already available. Welfare studies have used accelerometer technology to address the effects on behaviour of diet, daily cycle, enrichment, housing, social mixing, oestrus, lameness and disease. Additional aspects to consider before a decision is made upon its use in research and in practical applications include battery life and sensor location. While accelerometer systems for cows are already being used by farmers, application in pigs has mainly remained at the research level.


Introduction
Research interest in automatic systems providing continuous assessment of health and welfare in farm animals has been growing. Sensor technologies have been implemented to monitor biosignals that describe relevant behavioural indicators associated with changes in animals' wellbeing. In particular, the gathering of individual data by means of accelerometer solutions such as animal-based monitoring systems has been gaining attention. The number of publications on the application of accelerometer systems in cows has grown in the last 10 years from six in 2010 to 46 in 2019 in a total of 216 publications (search carried out in Scopus using keywords 'accelerometer* AND cattle*'). In pigs, publications found with keywords 'accelerometer* AND pig*' are very diverse and include pig models in respiratory, cardiology and pipeline research. We found one publication in 2010 and 4 in 2019 (13 in total) when limiting search results to those investigating behavioural responses.
Health is a basic prerequisite for welfare (Broom, 2006), and for many years good health and high production levels have been the central topics in the discussion of welfare in farm animals (von Keyserlingk and Weary, 2017). For the past few years, however, the public has been demanding higher standards of welfare and reliable methods to measure or assess mental and physiological wellbeing of animals. In response, worldwide, and particularly in Europe, major efforts have been undertaken in developing standardised methods for assessing animal welfare at the individual and farm level (Main et al., 2003;Spoolder et al., 2003). In 1965, the UK government published a 'Report of the Technical Committee to Enquire into the Welfare of Animals Kept Under Intensive Abbreviations: Acc, accuracy; AUC, area under the curve; CCC, concordance correlation coefficient; Pr, precision; PP, posterior probability; r, correlation coefficient; R 2 , linear regression; Se, sensitivity; Sp, specificity.
Livestock Husbandry Systems' and stated that animals should have the freedom to 'stand up, lie down, turn around, groom themselves and stretch their limbs' (Brambell, 1965). In 1992, the Five Freedoms assessment was created by the Farm Animal Welfare Council (FAWC, 1992). The Five Freedoms are: (1) freedom from thirst and hunger, (2) freedom from discomfort, (3) freedom from pain, injury and disease, (4) freedom to express normal behaviour and (5) freedom from fear and distress.

Welfare Quality® (WQ) assessment protocol
Since 2009, the Welfare Quality® (WQ) assessment protocol (Welfare Quality, 2009a, 2009b has become the most accepted on-farm method to assess welfare according to the standards of the Five Freedoms by applying animal-, management-and resource-based measures. It has been adopted for several species and focuses mainly on four principles considered essential for animal welfare: good feeding, good housing, good health and appropriate behaviour. 'Good feeding' describes the absence of prolonged hunger or thirst. 'Good housing' integrates three criteria: comfort around resting, thermal comfort and ease of movement. 'Good health' is defined by absence of disease and injuries (e.g., skin lesions or lameness) and the absence of pain induced by management procedures (Welfare Quality, 2009a, 2009b. The last principle, 'appropriate behaviour' includes the expression of social and other behaviours, a good human-animal relationship and a positive emotional state (Welfare Quality, 2009a, 2009b. These principles are characterised by welfare criteria (see Table 1). For each welfare criterion a score can be calculated by assessing different, predefined measures on a specific number of animals. These measures are determined either by visual inspection of the animals or by interviewing the manager of an animal unit. The criterion scores can be combined to calculate principle scores on the basis of which the animal unit can be assigned to a welfare category. The gathered information can be used to highlight issues requiring an animal unit manager's attention and to inform consumers about the welfare status of animal-based products or welfare quality aspects of the supply chain.
Welfare measures are expected to be of continuous character, reproducible, objective and to deliver reliable results (Main et al., 2003). However, the Welfare Quality assessment protocol requires direct observation by humans as subjective systems, so has evident limitations in reliability (Czycholl et al., 2016;Pfeifer et al., 2019) and provides information only at selected points in time on a predefined sample size of animals. The measured values present only a snapshot of the welfare status of selected animals on a farm but cannot serve as base data for continuous monitoring of health and welfare (Wemelsfelder and Mullan, 2014). Therefore, early detection of diseases also falls within a range that cannot be achieved by traditional methods. Another aspect that should be considered is that, with increasing herd size, the ability to identify individual animals with welfare problems decreases. The Welfare Quality Consortium (Welfare Quality, 2009a) reports assessment times of 4.4 h in herds of 25 dairy cows and of 7.7 h for 200 animals.
Precision livestock farming (PLF) is an umbrella term for technologies that apply process engineering to livestock farming (Wathes, 2009). Those technologies may be able to offer practical solutions that fulfil all the required aspects mentioned above and, moreover, provide an affordable and feasible solution without disturbing the daily workflow. PLF systems offer the potential to permanently and automatically monitor animals at the group or individual level in real time. Permanent (online) monitoring allows early detection of welfare-threatening conditions and supports the farmer in decision-making. The caretaker has the possibility to record whole biographies of animals while reserving time for individuals that need more observation. Several PLF technologies, including audio and video technology, automated feeders, water flow sensing and RFID (radio-frequency identification) technology (Matthews et al., 2016) have been tested in the course of scientific studies and have found their way to the market. A promising approach to monitor health and welfare is the application of acceleration sensors attached to the animal. Accelerometers are also popular due to their small size and affordable prices (Delagarde and Lamberton, 2015) and because they deliver information at the individual animal level. Other advantages are the flexibility to measure a wide range of parameters and the ability to place the sensors on different parts of the animal for better performance in the intended purpose (Rahman et al., 2017). For welfare assessment, accelerometer technology has mostly used specific behavioural patterns considered as indicators of the status of animal health, welfare ) and affective states (Fraser et al., 1997) as feature variables. These indicators differ from those applied in the Welfare Quality assessment protocol. Therefore, welfare assessment with accelerometer systems implies the redefinition, adaptation or replacement of traditional measures by others that are significant for a specific welfare criterion. The intention of this review is to 1) discuss the validity of specific behavioural patterns measured by accelerometers that are associated with principles and criteria from the Welfare Quality assessment protocol, 2) review studies that have already used accelerometer systems to assess welfare, 3) highlight aspects that should be considered before the application of accelerometer systems, and 4) discuss ideas for the future application of accelerometers in welfare assessment.

Accelerometer-based recognition of behavioural patterns
An accelerometer is an electromechanical device measuring accelerating forces. Acceleration is a vector quantity defining velocity change. Movement creates a voltage by stressing small crystals housed within the accelerometer. The sensor interprets the size of the voltage to determine velocity and orientation of the movement. In a tri-axial accelerometer, three acceleration sensors are arranged orthogonally and three-dimensional (x-, y-and z-axis) information is accumulated. It measures the earth's gravitational pull by determining the angle at which the device is tilted in addition to measuring acceleration forces (Benjamin and Yik, 2019). Commercially available accelerometer placed on a sow's ear is shown in Fig. 1. Accelerometers placed on the hind leg and left ear of a cow are shown in Fig. 2. Measured data can either be saved in the (limited) memory storage of the device and downloaded at the end of the observation period (Shiomi et al., 2008) or can be sent immediately to an external storage device via an established Wi-Fi connection, enabling real-time monitoring (as reviewed by Brown et al. (2013)). Accelerometers and their corresponding systems generate data that can be processed by pre-created algorithms to interpret movements as specific behaviour patterns. Berckmans (2013) describes that the algorithm development process involves different types of variables that must be defined beforehand.

Algorithm development
Real-time field data ('biosignals') -in our case acceleration dataare collected at a high frequency and continuously on the animal. The target variable relates directly to the final objective of the algorithm. This target variable could be, for example, the lameness status of an animal with yes/no as a response. A gold standard is a state-of-the-art scientific measurement or method that quantifies the target variable in a reliable way. In the case of lameness as target variable, the gold standard might be a clinical examination conducted by an experienced veterinarian. The feature variable is another variable that can serve as indicator for the target variable but is calculated from the field measurements on the animal. Frequency of stepping behaviour, for example, might be considered as an indicator for lameness, and thus as a feature variable. For automated detection and calculation of the feature variable, the labelling process is crucial. In Berckmans' (2013) words, labelling includes 'manual, detailed analysis of the feature variable from the measured field data to be used as a reference point for algorithm development'. In the case of lameness, the labelling process might mean visual investigation of video material with precise labelling of stepping behaviour. On the basis of these data the first part of the algorithm, calculating the values of the feature variable, can be developed. This process can be significantly accelerated and improved by applying new machine learning techniques (e.g. Artificial Neural Networks, Linear Discriminant Analysis, Random Forest, Classification and Regression Trees (Cockburn, 2020)). In a second step, these values are compared with the results of the gold standard (e.g., results of clinical examinations) so that finally the algorithm should be able to detect the target variable (lameness) automatically.

Validation of the algorithm
Validity describes whether the algorithm is really detecting what it is supposed to. Therefore, reliable results cannot be obtained without a validity check. For validation, the algorithm is tested on new data that were not used for its development (Berckmans, 2013). Depending on the research approach and the feature variable in question, many different performance metrics can be found in the relevant literature, which makes comparison of study outcomes difficult. Algorithm performance can be quantified by calculating sensitivity and specificity. Referring to algorithm performance, the term sensitivity (or recall) represents the effectiveness of the algorithm to identify animals with a certain health condition: the proportion of true positives identified by the algorithm as positive. Specificity in algorithm development describes the effectiveness of the algorithm to identify animals without a certain health condition and represents the proportion of true negatives identified as negative by the algorithm. Both of these terms describe accuracyhow well the observed or automatically detected value agrees with the true value (modified after Petrie and Watson (2013)). Sensitivity and specificity values range from 0 to 100 %, with 100 % indicating perfect agreement. Closely linked to these terms are the positive and negative predictive values, which are indicated as percentages. The positive predictive value or precision indicates the probability that animals classified positive for a certain health condition really have the condition of interest. The negative predictive value reports the probability that animals detected negative for a certain health condition indeed do not have this condition (modified after Trevethan (2017)). The F1 score represents the weighted mean of precision and recall and gives a better measure of incorrectly classified cases than accuracy. It can range from 0 to 1. A high F1 score means that the numbers of false positives and false negatives are low.
The area under the ROC (receiver operating characteristic) curve (AUROC) is a performance metric for discrimination. It describes the ability of a diagnostic test, or in the case of algorithm development, of an algorithm, to distinguish between animals with and without disease or between different behaviours (modified after Petrie and Watson (2013)). For an ROC curve, the false positive rate is plotted against the true positive rate (Powers, 2011). An algorithm that is perfect at Fig. 1. Accelerometer placed on a sow's ear. J.M. Chapa et al. discriminating between animals with or without a disease or between animals showing a specific behaviour and not showing that behaviour has an AUROC of 1, and an algorithm that performs no better than chance has an AUROC of 0.5 (modified after Petrie and Watson (2013)). In the following sections we will discuss publications that have been using acceleration data to assess behavioural traits that are closely linked to certain aspects of welfare. For each section, we will, as a first step, refer to validation studies before we focus on research that has assessed welfare criteria or closely related behaviours.

Feeding and drinking behaviours as feature variables for welfare assessment
Feeding behaviour is described as one of the most important indicators of the health and wellbeing of animals . It can be influenced by environmental factors (Averós et al., 2010) such as feed composition (Bakare et al., 2015), ambient temperature (Feddes et al., 1989), the type of feeder (Brumm et al., 2000;Gonyou and Lou, 2000), the number of feeders (Hansen et al., 1982), housing situation (group housing or single housing (De Haer and Merks, 1992)) and group size (Nielsen et al., 1995;Huzzey et al., 2006;Grant and Albright, 2001). Social constraints such as degree of competition (Georgsson and Svendsen, 2002) and social rank  can also modify feeding behaviour. Internal factors changing feeding patterns include age, genetics, gender and disease (Whittemore, 1998), lameness (Barker et al., 2018), proximity to calving date  and reproductive status (Friend, 1973). Drinking is highly associated with feeding behaviour (Bigelow and Houpt, 1988); therefore, similar factors can cause changes in water intake.  Table 2 shows studies on the validation of accelerometer systems for feeding and drinking behaviours in cattle. The three most studied behaviours so far are rumination, feeding time and grazing time.
Rumination behaviours were predominantly studied with accelerometers integrated into ear-tags and collars. Studies that tested the performance of an existing data interpretation model against visual observation found generally good results for the sensor-based detection of rumination (Table 2). For example, Reiter et al. (2018) tested the rumination time recorded by the SMARTBOW® system (Smartbow GmbH, Weibern, Austria), an ear-attached accelerometer, and found high correlations between sensors and visual observations (r > 0.99). Similar results had previously been reported by Borchers et al. (2016) using the same accelerometer system, and by Bikker et al. (2014) with a different accelerometer system (SensOor Agis Automatisering BV, Harmelen, the Netherlands). However, the SensOor was also tested by Borchers et al. (2016), and this study found a weaker correlation (r = 0.69). Another frequently used placement of accelerometers to identify rumination is on the collar. Martiskainen et al. (2009) were able to predict rumination behaviours (Se = 75 %, Pr = 86 % Acc = 92 %). In a more recent study, Grinter et al. (2019) validated a collar-attached accelerometer and commercially available system (MooMonitor+, Dairymaster, Co. Kerry, Ireland). They found high correlations for rumination time (r = 0.99) between the system and visual observations. Sensors attached to the halter were also used to assess rumination. Watanabe et al. (2008) recognised rumination with >90 % correct discrimination using different combinations of acceleration variables. Recently, a combination of a noseband pressure sensor and an accelerometer (RumiWatch, ITIN + HOCH GmbH, Liestal, Switzerland) achieved 91 % accuracy in detecting rumination time in grazing cattle (Poulopoulou et al., 2019). We found one paper where the placement of the accelerometer was in the reticulum to measure time between reticuloruminal contractions. The authors obtained an overall accuracy of 86 % to identify rumination periods, which were verified with rumination collars (Hamilton et al., 2019).
To detect feeding behaviours, we found studies on accelerometers attached to a collar or to the ear, jaw or leg. With a collar-attached accelerometer, Martiskainen et al. (2009) reported a Se = 75 %, Pr = 81 % and Acc = 96 % for cows feeding from a feed bunk. Vázquez Diosdado et al. (2015) used a simple decision-tree algorithm to predict feeding behaviours (on a feed bunk) and reached a sensitivity of 98 % and a precision of 93 %. Leg-attached accelerometer combined with a proximity sensor (Track A Cow, ENGS, Rosh Pina, Israel) for detecting feeding behaviour or time around the feeding bunk, resulted in a good correlation with video recordings and time spent near feeding stations (r = 0.93, CCC = 0.79) and a correlation of feeding time between video recordings and ear accelerometer of r = 0.88, CCC = 0.82 (Borchers et al., 2016). Rayas-Amor et al. (2017) used an accelerometer attached to the jaw to predict grazing time (on pasture; R 2 = 96 %). A rather weak correlation (r = 0.17) for drinking time was found by Poulopoulou et al. (2019). Wolfger et al. (2017) used an accelerometer system with localisation capabilities able to triangulate the location of cows in real time with an estimated deviation of 1.22 m. They concluded that the system has the potential to calculate the time animals spend at the feed bunk or drinking areas. In a study from Wang et al. (2018) the authors stated that feeding behaviours are difficult to assess by leg accelerometer only, but combining with location data would improve the performance by 20 %. Besides drinking behaviours, most studies found algorithm performance for feeding and related behaviours to be high, so that accelerometer technology can be considered as a useful tool for welfare assessment.

Practical application.
Feeding parameters have been proven to be useful to investigate several target variables. In cows, feeding and ruminating behaviours indicated by a collar accelerometer were used as Table 2 Overview of validation studies for feeding and drinking related behaviours in cows using accelerometer systems. 'Measure of validity' indicates best results within the respective study. indicators for lameness. Non-lame cows compared with cows suffering from lameness showed decreases in daily feeding time (p = 0.004), daily feeding frequency (p = 0.002) and increases in daily feeding rate (p = 0.02), but rumination behaviours were unaffected (no significance) (Thorup et al., 2016). Similarly, Barker et al. (2018) combined location and acceleration data to measure feeding behaviour, and found that lame cows showed less daily feeding time than non-lame cows (p = 0.005). Environment had also effects on feeding behaviours. For example, the effects of a grooming brush on calves after weaning increased the time of eating and ruminating as measured by an ear-attached accelerometer compared to calves without the grooming brush (Velasquez-Munoz et al., 2019). Activity levels have also been used to estimate rumination and feeding time in grazing cows. Using a collar accelerometer, Ueda et al. (2011) categorised activity levels from 0 (inactive) to 11 (highly active). When cows were classified from level 1 to level 7, 94 % of the time corresponded to eating behaviours, and when cows were classified with activity levels from 0 to 0.5 corresponded to ruminating or resting. Grazing time was classified by an accelerometer placed at the neck (Se = 74 %; Sp = 82 %) and this, in combination with bite frequency data, was used to create a grass intake model (Oudshoorn et al., 2013).
Some studies investigated the effects of health disorders, e.g., mastitis, on feeding behaviours. A drop in rumination and feeding time determined by an ear-attached accelerometer was associated with elevated somatic cell count (>700,000 cells/mL) in milk (Jaeger et al., 2019). In another study, a neck-mounted accelerometer combined rumination and physical activity data to create a health score system (HIS) for metabolic and digestive disorders. The sensitivities achieved by the HIS were 98 % for displaced abomasum, 91 % for ketosis, 89 % for indigestion and 93 % when all health disorders were combined (Stangaferro et al., 2016a), 58 % for clinical mastitis (Stangaferro et al., 2016b), and 55 % for cows with metritis (Stangaferro et al., 2016c). Including all disorders in this study, the HIS achieved an overall sensitivity of 59 %, specificity of 98 %, precision of 58 %, and accuracy of 96 %. Table 3, to date only few researchers have tried to develop an algorithm for feeding behaviour based on acceleration data in pigs. Cornou and Lundbye-Christensen (2008) were able to correctly distinguish 79 % of feeding from non-feeding behaviour (Sp = 96 %). Two years later (2010), the authors reported a percentage of posterior probability of 92 %. Escalante et al. (2013) achieved an AUC performance at an observation level of 0.87 (Acc = 91 %). These results indicate good to excellent classification performance and therefore the algorithms could be used under practical conditions as well. All aforementioned authors were using neck-collar-attached accelerometers for data collection, whereas Thompson et al. (2019) placed two accelerometers, one on the front and one on the rear end of sows and reported an F1 score of 0.60. To our knowledge, algorithm development and validation for the detection of drinking behaviour on the basis of acceleration data has not so far been scientifically addressed in pigs.

Practical application.
As algorithm development is in the early stages for pigs, approaches to monitor feeding under different welfare conditions by means of acceleration systems are also scarce. One of those rare studies has been provided by Fleming et al. (2018). At the same time, they were among the first researchers to use accelerometers in pigs smaller than sows. The authors investigated the effects of a sialic acid diet and circadian rhythm (day vs. night) on the behaviour of 24 artificially reared piglets on the basis of acceleration data collected by devices fixed to a neck collar. Specific software (Actiware 6.0.7, Philips Respironics, Murryville, PA, USA) was applied to determine a threshold value based on activity to be able to assess in a second step whether the pig was asleep or awake. This method was proven valid by comparing proportions of automatically detected data with those of manually labelled behaviours (p = 0.07). Results of diet and circadian rhythm comparison revealed that there was no significant effect of diet or interaction between diet and day time for total activity or percentage time asleep. However, total activity counts were higher during the day and more time asleep was observed during the night.

Movement and resting behaviours as feature variables for welfare assessment
Activity and resting patterns such as time spent standing or lying can be used as measures of health and welfare (Rushen et al., 2008;Norring et al., 2010) in cattle and pigs. They can be influenced by many different factors such as, for example, space provision (Hindhede et al., 1996), housing design (Tucker et al., 2004), quality of resting areas (Ito et al., 2009), stocking density (Fregonesi et al., 2007), reproduction status (López-Gatius et al., 2005), pain (Flower and Weary, 2009) and disease (Millman, 2007 Table 4. Parameters related to movement and resting are lying, standing and walking. Common placements for accelerometers to measure these behaviours are leg, collar and ear. For assessment of lying behaviour, accelerometers have been mostly attached to the leg. Nielsen et al. (2018) used the CowScout Leg (GEA Farm Technologies, Bönen, Germany) and the IceTag (IceRobotics Ltd., Edinburgh, Scotland) and found a 0.99 correlation of lying time with visual observation for each system. Ledgerwood et al. (2010) stated that accelerometers can predict (R 2 ≥ 99 %) lying behaviour when the data recording intervals were ≤30 s. Furthermore, Borchers et al. (2016) tested four different commercially available accelerometers fixed to the legs of cows to detect lying behaviour and found good to excellent correlations between the systems and visual observations (AfiAct Pedometer Plus, Afi-milk, Kibbutz Afikim, Israel, r > 0.99, CCC > 0.99; CowAlert IceQube, IceRobotic Ltd., Edinburgh, Scotland, r > 0.99, Table 3 Overview of validation studies for feeding and drinking related behaviours in pigs. 'Measure of validity' indicates best results within the respective study. All studies were conducted on sows: a gestating; b close to parturition/lactating; 1 individual housing; 2 group housing.   (2009) used a support vector machine algorithm and could predict lying behaviour with a sensitivity of 80 % and a precision of 83 %, but failed (Se = 0% Pr = 0%) to classify the lying-down process. Vázquez Diosdado et al. (2015) used a simple decision-tree algorithm to classify lying behaviour with a sensitivity of 77 % and precision of 98 %). They could also successfully show that accelerometer data allow discrimination between inactivity while lying and standing. With an ear-attached accelerometer, Bikker et al. (2014) classified inactivity while lying and standing and found a correlation with video recordings of 98 %. All studies found for identification of walking behaviour in cows used accelerometers attached to the leg or a collar. Using an accelerometer mounted on a collar, Martiskainen et al. (2009) were able to predict walking with a sensitivity of 79 %, precision of 89 % and accuracy of 99 % and lame walking (Se = 65 %, Pr = 66 % and Acc = 98 %). However, accelerometers attached to the legs were more successful in detecting a wide variety of movement behaviours, including step count, gait types, walking asymmetry and normal walking behaviour Chapinal et al., 2011). Wang et al. (2018) reported an accuracy of 99 % in walking and standing-up behaviours with a leg-mounted accelerometer. Martiskainen et al. (2009) could predict standing behaviour with a sensitivity of 80 %, precision of 65 % and accuracy of 87 % and could classify standing-up events (Se = 71 %, Pr = 29 % and Acc = 100 %). Vázquez Diosdado et al. (2015) were able to detect the transition between lying and standing behaviours with an average sensitivity of 97 % and an average precision of 88 % with accelerometers attached to a collar.

Practical application.
High accuracies in the majority of feature variables for movement and resting behaviours as measured by accelerometers have motivated researchers to use these systems to investigate factors or effects that may influence these feature variables.
As mentioned above, observational studies found an increase in lying time in cows suffering from lameness. Researchers studying standing or lying times measured by accelerometer systems found similar results. Chapinal et al. (2010) found time spent lying was longer in lame cows, which had also longer lying times at night (Nechanitzky et al., 2016). Solano et al. (2016) found fewer lying bouts but of longer time in lame cows; cows that lay down more than 14 h a day had 3.7-fold higher odds of being lame.
Another practical approach for accelerometer use is pain assessment. For example, Newby et al. (2013) investigated the effect of ketoprofen on lying behaviour after surgery. Although they did not find effects of analgesia on lying behaviour, the technique of surgery (standing right flank vs. paramedian) suggested that cows that underwent the paramedian approach experienced more pain as they showed less lying. Beef calves showed similar behaviour, as the accelerometer readings showed a significant longer time standing after castration (White et al., 2008). The effect of environment, such as single or pair-housed calves, had an effect on lying time: pair-housed calves showed a decrease in lying time as characterised by leg accelerometers (Overvest et al., 2018).
Heat stress detection tools can be valuable for any farm, as heat load can negatively impact milk production. Characteristic movements such as heavy breathing were used by Bar et al. (2019) as a feature variable for heat load in dairy cattle. In this study they found that a vaginal temperature above 39.0 C increased the probability of heavy breathing as measured by a collar accelerometer. Activity levels (lying time and number of steps) as feature variables from a leg accelerometer were also affected by an increase in heat load duration and intensity (Heinicke et al., 2019).

Validation.
Reliable results and high accuracies have also been achieved for detecting lying behaviour with accelerometers in pigs (see Table 5).
In pigs, lateral recumbency is considered a state of total relaxation and inactivity, while sternal recumbency is found as a body posture in which sows are often awake, noticing and interacting with their environment (Nicolaisen et al., 2019). A majority of studies report percentages of correctly classified lateral lying exceeding 90 % and F1 scores ranging from 0.90 to 0.98. The best results were achieved when using two accelerometers: one mounted on the front and one on the hind end of the back of a sow (F1 score for lying on the left side: 0.98, F1 score for lying on the right side: 0.97, as reported by Thompson et al. (2019)). For sternal lying, model evaluation results are in general a little bit lower than for lying on the side. High accuracy (95 %) was obtained for lying sternally and passive (where the sow is sleeping or resting) by Cornou et al. (2011). In this study, the sow was equipped with one single sensor mounted on a neck collar. However, when only one accelerometer is mounted as a tag to the ear of an animalwhich is the most practicable technique to collect acceleration data in pigsalgorithm performance is lower. For resting in lateral position, Oczak et al. (2016) found a sensitivity of 83 % and a specificity of 70 %. For resting in sternal position, sensitivity was 51 % and specificity 82 %.
Sitting is considered to represent motivational conflict (Jarvis et al., 2004) but also increases with certain health conditions such as lameness. To our knowledge, only three studies have so far reported results of algorithm development for 'sitting' in pigs. Ringgenberg et al. (2010) found a sensitivity of 50 % and a specificity of 100 % with two accelerometers: one on the hind leg and one on the back. Thompson et al. (2016) mounted one sensor to the hind end of the back of a sow and reported an F1 score of 0.54 for sitting. A more reliable approach was proposed by almost the same research team in 2019 (Thompson et al.). In addition to the accelerometer attached to the hind end of the sow, they mounted another one to the front. By doing this, they were able to raise the F1 to 0.98 and, therefore, to provide a solid basis for reliability assessment.
Automated detection by accelerometers of standing and walking behaviour in pigs has been described in only a few studies so far. Walking was detected using an accelerometer mounted on a neck collar with a posterior probability of 82 % (in group-housed sows), a sensitivity of 82 % (Sp = 86 %, Pr = 50 % in group-housed sows) and an AUC performance of 0.77 (Acc = 85 % in group-housed sows), by ; Cornou and Lundbye-Christensen (2010) and Escalante et al. (2013), respectively. Using two sensors, one on the front and one on the hind end of the back of sows in farrowing pens, Thompson et al. (2019) obtained an F1 score of 0.84. Applying one sensor to the hind leg and one to the back of sows, Ringgenberg et al. (2010) were able to detect 'standing' with a sensitivity and a specificity of almost 100 %, whereas Thompson et al. (2019) achieved the highest F1 scores (0.77) with one device on the front and one on the hind end of the back. Bertin and Ramonet (2015) reported a sensitivity of 99 % and a specificity of almost 100 % for posture changes. For this study, the (single) accelerometer was mounted to the hind leg of the animal. Nest-building activity, including exploratory behaviour, pawing, manipulation of the pen and manipulation of the rack, was detected based on ear-tag data by Oczak et al. (2015) with an accuracy of 86 % (Se = 87 %, Sp = 85 %). Cornou et al. (2011) used a neck collar for data collection and defined the combination of feeding, rooting and nest-building behaviour as 'high active behaviour', and achieved an accuracy of 91 % for this parameter. Algorithms for rooting or exploratory behaviour as single parameters have also been scientifically validated:  reported a posterior probability of 78 % and Cornou and Lundbye-Christensen (2010) a validity described as a sensitivity of 56 %, specificity of 95 % and precision of 22 %. Escalante et al. (2013) indicated an AUC Table 5 Overview of validation studies for movement and resting-related behaviours in pigs. 'Measure of validity' indicates best results within the respective study. All studies were conducted on sows: a gestating; b close to parturition/lactating; c non-gestating; 1 individual housing; 2 group housing. performance at the observation level of 0.80. Stepping behaviour was investigated by Ringgenberg et al. (2010): attaching one sensor on the hind leg and another on the back of a sow resulted in a sensitivity of 95 %. Ringgenberg et al. (2012) used previously validated algorithms (Ringgenberg et al., 2010) to study the long-term impact of social mixing in gestation and of a straw-enriched pen in lactation on components of sow behaviour. Acceleration data revealed that both social mixing and straw enrichment had an effect on behavioural traits. Sows in the social stress treatment group were found to spend more time lying ventrally than did control sows. In late lactation, sows in straw-enriched pens also tended to spend less time lying ventrally and sitting and more time lying laterally than did sows in standard farrowing crates. Conte et al. (2014) used accelerometers recording acceleration on the x-axis in combination with force plates and kinematic methods to assess lameness in sows. Stepping behaviour recorded by two accelerometers on the hind legs was identified as indicative of lameness. Lame sows showed an increase in stepping behaviour. In another study, Conte et al. (2015) focused on the effectiveness of the non-steroidal anti-inflammatory drug meloxicam in lame sows. They used accelerometers mounted on the left hind leg. Injection of meloxicam decreased stepping frequency and tended to increase standing time in lame sows after feeding. As a conclusion, stepping frequency can be seen as a promising indicator of lameness-related pain. Gregoire et al. (2013) were able to show on the basis of acceleration data that lame sows spent less time standing over a 24-h period than did non-lame sows. Traulsen et al. (2016) used acceleration and position loggers in ear-tags (SMARTBOW, Smartbow GmbH, Weibern, Austria) in group-housed sows to assess lameness by measuring different activity indices. They came to the conclusion that positioning data were useful to detect reduced activity in lame sows while acceleration data were not. However, Scheel et al. (2017) applied the same sensors to a set of 14 group-housed sows of which seven were diagnosed as lame and were able to develop a method using wavelet transformation of acceleration data that detected six lame sows on at least one of the two final days of the sampling period of 14 days (Acc = 93 %). Zande et al. (2019) equipped 232 weaners with accelerometers and inoculated them with PRRS virus at eight weeks of age. Acceleration data were collected prior to the challenge and after the infection. Video observations were used to train a machine-learning model to recognise activity and chewing behaviour. Levels of activity, chewing and hyperactivity decreased and the Root Mean Square Error (RMSE) indicating deviations from the regression line increased after the challenge. These results agree with previously reported clinical signs of PRRS, including lethargy and loss of appetite (Nordgreen et al., 2018). In addition, they were able to confirm the results of a study by Putz et al. (2018), showing that the RMSE of feeding and activity during the peak challenge period is predictive of survival, thus characterising more resilient pigs and promoting selection of these individuals.

Peripartal behaviour, birth prediction and reproductive management with accelerometers
2.4.3.1. Cattle. In cows, calving prediction can be a valuable tool for farmers to identify animals that need assistance in time. This may reduce, e.g. the risk of dystocia and pain related to this process (Mainau and Manteca, 2011). Therefore, calving prediction can be regarded as important feature for welfare assessment. Calving prediction has been performed by using rumination time as measured by ear accelerometer, a leg accelerometer (lying time and lying bouts) and in combination with variables from a vaginal sensor (temperature). Combined data from these three sensors resulted in a sensitivity of 77 % and a specificity of 77 % (Ouellet et al., 2016). A sensitivity of 89 % and specificity of 93 % were achieved when data from a noseband sensor (ruminating time, ruminating chews, boluses and other activities) were combined with data from a 3D accelerometer to detect the onset of calving (Fadul et al., 2017). Frequency and duration of rising movements of the tail were measured with an accelerometer attached to the upper part of the tail. These variables were used to create a threshold that triggered a birth alarm once surpassed (Krieger et al., 2017). Activity and lying time, as well as rumination from an ear-attached accelerometer, were variables used to create a calving prediction algorithm that achieved an accuracy of 74 % one hour before calving .
Oestrus detection is important for the reproductive success of every farm and some sensor-based systems for automated oestrus detection have been developed. A study from Schweinzer et al. (2019) used movement patterns generated from an ear-attached accelerometer as feature variable. These movement patterns were converted to oestrus alerts by the system and then compared with their gold standard (pregnancy after oestrus and artificial insemination), achieving 97 % sensitivity and 98 % precision. Activity levels of grazing dairy cattle were recorded with a collar accelerometer and used to detect heat events. A high increase in these activity levels measured by accelerometer was associated with recorded heat events and derived 82-100 % accuracy in detecting heat events (Shahriar et al., 2016). A leg accelerometer was used to investigate the effects of oestrus on behavioural patterns in heifers. Baseline behaviours were recorded one week before oestrus and compared with behaviours on the day of oestrus. An increase in the number of steps was found during oestrus (Silper et al., 2015b), as well as an increase in standing behaviours (mean standing bout duration, duration of the longest standing bout and total daily standing time). Lying bouts were longer one day after oestrus but not on the day of oestrus (Silper et al., 2015a). In another study, rumination levels from a collar accelerometer were used by Talukder et al. (2015) to create oestrus alerts in grazing cows. Although rumination levels did not have the best results in generating true oestrus alerts (AUC = 0.54), a combination of rumination levels and activity levels improved the result (AUC = 0.75), but the best result was obtained using activity levels only (AUC = 0.82).

Pigs.
As a consequence of the public discussion on the ban of farrowing crates, special emphasis has been placed in the past decades on the welfare of pre-parturient and lactating sows. Confined sows are restricted in movement in general, and particularly in the performance of the highly motivated behaviour of nest building and in interactions with their offspring (Cronin et al., 1994;Andersen et al., 2005). A system that is able to reliably predict farrowing would give the farmer the possibility of preparing the farrowing pen for the new-born piglets and crate the sow after the nest-building phase without increasing the risk of piglet crushing .
In general, nest-building behaviour is highly motivated, and restriction can lead to changes in other behavioural traits (Hansen et al., 2017) as well as higher risk to the animals (Damm et al., 2003;Jarvis et al., 2001). Nest building can be observed throughout the final 24 h before birth of the first piglet and is most intense in the 12 to 6 h before farrowing (Algers and Uvnäs-Moberg, 2007). An increase in activity in the course of nest building behaviour is characteristic for the approaching farrowing (Oliviero et al., 2008;Jensen, 1993). For detecting the onset of nest-building and farrowing, there have been approaches to monitor different levels of activity rather than single behaviours, resulting in better algorithm performance. For example, Cornou and Lundbye-Christensen (2012) defined a new class of 'total active behaviour' by merging the behaviours 'feeding', 'rooting', 'nest-building activities', 'standing', 'sitting' and 'lying sternally where the sow is active' (see Table 5). Results of algorithm validation revealed a sensitivity of 100 % and a specificity of 95 % for this class. Cornou et al. (2011) detected an increase in active behaviours (feeding, rooting, standing, sitting, lying sternally, but not sleeping or resting) as well as number of changes of activity type and a decrease in lying laterally 20-16 h before the onset of farrowing. Those behavioural changes were more pronounced when sows were offered straw. Besides behavioural traits in the course of parturition, the authors could also prove three periods of high activity corresponding to feeding times. Cornou and Kristensen (2014) used the same posture classification method as applied in a study of 2011 (Cornou et al.) to investigate differences in sows' activity before, during and after farrowing and between groups with and without straw. According to sensor data, there was an increase in active behaviour (the sum of behaviours corresponding to feeding, rooting and nest-building behaviours, standing, sitting or lying sternally where the sow is active) around 17 h before the onset of farrowing in both groups. The intensity of activity during the pre-partum high-activity phase tended to be more pronounced in the group with straw provision. Based on their algorithms on 'active' (standing/ walking), 'resting in lateral position' and 'resting in sternal position' behaviours, Oczak et al. (2016) investigated the effects of confinement and pen type on behaviour. Comparison of labelling and classification results showed that the accuracy of posture classification was not sufficient to detect the effect of pen type on the behaviour of the animals. The effect of crating on time spent resting in a lateral or a sternal position, however, was correctly recognised by the automated method.
Cornou and Lundbye-Christensen (2012) were able to predict farrowing on average 15 h before onset on the basis of total active behaviours. Thompson et al. (2019) observed a mean time between the threshold for nest building and the onset of farrowing of 11.1 ± 4.6 h based on increased postural transitions. Oczak et al. (2015) used alarms given during increased postural transitions indicating nest building to predict farrowing. Based on accelerometers mounted on the ears of sows, this method was able to generate at least five alarms (at 2-h intervals) in seven out of nine sows. In a more recent study, alarms indicating the approach of farrowing were generated for most sows with a median of 2 h 3 min before the onset of farrowing . Traulsen et al. (2018) reported that alarms indicating the increase of activity were given within 48 h for 100 % of sows (n = 20), and for 85 % within 12 h before the onset of farrowing. Pastell et al. (2016) used acceleration data in combination with CUSUM (cumulative sum control) charts and detected a rise in activity by sows housed in crates and pens on average 13 ± 4.8 h before farrowing, with a sensitivity of 97 % and a specificity of 100 %.One of the first attempts to monitor oestrus on the basis of acceleration systems has been reported in a pilot study by Cornou and Heiskanen (2007). The authors equipped five group-housed sows with neck collars carrying one analogue accelerometer (ADXL320, Analog Devices, Norwood, MA 02062, USA) measuring the acceleration in two dimensions, and one digital accelerometer (LIS3L02DS, STMicroelectronics N.V., Amsterdam, Netherlands) measuring the acceleration in three dimensions. This approach allowed detection of the onset of oestrus (3.5-5 h before first detection of standing reflex) in two of the three sows (highest Sp = 70 %) that came into oestrus.

Practical considerations
Accelerometer-based monitoring systems must fulfil a list of requirements. Sensor devices need to be lightweight, cheap, resistant to dust, dirt, and ammonium gases and be robust enough to withstand mechanical stress due to collisions with the metal bars of husbandry systems (Marchioro et al., 2011;Kjeldsen et al., 2016). Additionally, they must have a long battery life. The precision of behaviour classification is required to be high and data transfer must not be hindered by a large amount of metal (e.g., Cornou and Heiskanen (2007) and Scheel et al. (2017) report transmission failures). Furthermore, real-time monitoring is a desirable feature for accelerometer systems as it may signal behavioural and physiological changes early and thus enable early treatment (Bewley et al., 2010). If there is, e.g., a Wi-Fi connection that ensures storage of acceleration data on an external storage device, battery life is the only technically limiting factor for unlimited data collection. A higher sampling frequency results in decreased battery life and therefore the need to change the battery more often, which means that the accelerometer has to be demounted and remounted. Attaching the device to the animal may not cause too much discomfort in calm and stoic animals that are used to direct human contact, but for others the procedure might entail avoidable pain and stress, which is not in compliance with welfare law (European Convention, 1976) and is therefore not acceptableeven less when it is carried out with the aim of assessing welfare. Furthermore, it is reasonable to raise the question of whether an accelerometer itself impacts the behaviour of an animal. To our knowledge, there have been no studies on this aspect to date.
Lower sampling frequency, however, may lead to losses in regard to behaviour detection (Süli et al., 2017). Higher frequencies do not represent a problem for studies that last for only a short period of time, but a compromise between acceptable battery lifetime and reliable behaviour detection has to be made for long-term monitoring under practical farm conditions. Using General Alert® (Pig Champ Pro Europa S.L., Spain), Süli et al. (2017) reported a battery life of 15 days with a sampling frequency of 15 min. Studies have applied sampling rates ranging from 1 (Escalante et al., 2013) to 20 Hz (Pastell et al., 2016) and up to 400 Hz . Another method to improve battery life is to apply a standby mode that is deactivated only when the interrupt pin of the accelerometer is activated and, moreover, by adapting this waking-up frequency to the activity performed by the animal (Marchioro et al., 2011). Pre-processing accelerometer data plays an important role in the classification of behaviours, as demonstrated by Riaboff et al. (2019). They tested different ways of processing accelerometer data and found the best results when combining high frequencies, window size of 20 s or 30 s and 90 % sample overlap and applying a decision tree that had a low computational load and had been proven to classify behaviours accurately (Robert et al., 2009).
There are currently several accelerometer systems commercially available for dairy cattle, e.g., CowAlert IceQube (IceRobotics Ltd., Edinburgh, Scotland), Smartbow (Smartbow GmbH, Weibern, Austria), SensOor (SensOor Agis Automatisering BV, Harmelen, the Netherlands) and MooMonitor+ (MooMonitor+, Dairymaster, Co. Kerry, Ireland). These systems use changes in parameters such as activity levels, rumination time, lying time and walking to create alerts once a deviation from the predefined threshold is detected. Common alerts on commercially available systems include heat detection, health, calving and lameness. To date, there is no commercial accelerometer system available on the market for monitoring behaviour in pigs. Multi-process Kalman filters that are often applied for behaviour classification are power-hungry, and are thus unsuitable for practical implementation. However, Marchioro et al. (2011) presented a resource-constrained approach to implement a model for electronic devices that classified sows' activities (high active, medium active, lying sternally, lying laterally) with an accuracy close to 90 %, therefore making the first step towards a marketable hardware module.
Research on accelerometer systems in pig farming has focused on sows; on the one hand because the economic value of younger pigs produced for meat is low and the cost-benefit calculation would not hold, and on the other because the size and weight of an accelerometer including hardware and battery (e.g., a SMARTBOW ear-tag weighs 35 g, Smartbow GmbH, Weibern, Austria) restrict the use on small pigs. For researchers working on several iterative substudies to evaluate the feasibility of different sensors, including ear-mounted accelerometers, in farrowing sows, Kjeldsen et al. (2016) designed a wireless, lightweight flexible sensor infrastructure platform. The authors affirmed it to be easily reconfigurable and deployable to fulfil the changing requirements of different studies and robust enough to endure the harsh farrowing pen environment. Furthermore, battery life of the tags was proven to be sufficient to provide uninterrupted data collection for three weeks.
The mounting of non-ear-tag-based accelerometers on pigs usually requires the fixation of the animal and auxiliary equipment such as collars, bandages and tapes (Bertin and Ramonet, 2015;Pastell et al., 2009;Cornou and Lundbye-Christensen, 2008;Thompson et al., 2019), which are not supposed to stay on the animal for more than a few days or weeks (Bertin and Ramonet, 2015;Cornou and Lundbye-Christensen, 2008); therefore, long-term investigations are limited in time. Moreover, in group housing, Hämäläinen et al. (2011) observed that neck collars were chewed and damaged by other sows or had to be repositioned.  also reported that accelerometers had to be repositioned due to loosened neck collars. In contrast, tags can easily be mounted in ear holes in cows and pigs. An ear-tag accelerometer can also be combined with national identification and can stay attached to the animal's ear until it leaves the farm. However, some aspects must be considered before the ear is chosen as the application site. The orientation and location of the accelerometer are very important. When an accelerometer is mounted rigidly on the chosen body part of the animal, the orientation of specific axes can be determined. This is not possible when the accelerometer is attached to the ear and may rotate. Oczak et al. (2015Oczak et al. ( , 2016 addressed this problem by applying a jerk filter and suggested, along with Shoaib et al. (2013), to use a gyroscope measuring angular velocity in order to determine orientation. Another disadvantage of mounting the accelerometer on the ear is that it is a very flexible body part that experiences acceleration not only when the animal moves, but also when only the ear moves, e.g., when the animal flaps the ear or when, in particular in pigs, group-mates nibble at the ear or the tag itself. Although to date not scientifically proven, it is plausible to think that too much interest on the part of other animals in the tag may also result in ear-tags being lost, making retagging necessary. At the same time the question is raisednot only for the ear as attachment site, but also for other locationsof whether the accelerometer itself impacts the animal's behaviour.
Precision of behaviour detection is highly dependent on the type of behaviour and tag location, as reviewed by Brown et al. (2013). In cows, collar sensors mounted at the neck identified most of the behaviours reviewed in previous chapters, whereas ear, jaw and leg sensors performed better on single behaviours. Ear and jaw sensors showed better results for feeding-related behaviours, while leg sensors showed better results than collars on walking-and resting-related behaviours. Benaissa et al. (2017) compared the results of leg-and collar-mounted accelerometers and found better results for lying behaviour from leg-mounted accelerometers (Se = 98 %, Pr = 99 %) than from an accelerometer mounted on the collar but found better results for feeding behaviours for collar-mounted versus leg accelerometers (Se = 96 %, Pr = 92 % versus Se = 86 %, Pr = 81 % respectively). The more accelerometers at different locations are used, the better the recognition (Thompson et al., 2019;Watanabe et al., 2008). Some behaviours are more prone to poor classification accuracy arising from single point measurement than others. In pigs, these behaviours include sitting, sternal lying and standing (Thompson et al., 2019). In particular, sitting is often confused with other behaviours, especially sternal lying (Ringgenberg et al., 2010). This is probably part of the reason why only a few authors report algorithm performance for sitting. As an indicator of motivational conflict (Jarvis et al., 2004), it would be very interesting from an ethological and welfare point of view to be able to detect this behaviour reliably. Lame sows show more frequently sitting and lying behaviour than do healthy ones (Díaz and Boyle, 2014). Also, the behaviour of pigs housed with less space allowance due to higher stocking density may be characterised by a higher frequency of sitting posture (Scollo et al., 2014). The proportion of time spent sitting has been reported to be higher in pre-farrowing gilts housed in crates than in gilts housed in pens with straw (Jarvis et al., 2001).
The nature of the behaviour determines which of the three acceleration axes is the most helpful for detection. For example, sidewise movements are very limited during lateral lying, so better recognition is provided by the horizontal sidewise y-axis, while rooting behaviour in pigs is characterised by upwards and downwards movements that are indicated by acceleration changes on the vertical x-axis (Cornou and Lundbye-Christensen, 2010). Problems in distinction between behaviours can occur when they are performed at the same time, resulting in low performance of the algorithm. Cornou and Lundbye-Christensen (2010) found that walking and rooting tended to be confused with each other but were mostly recognised when the specific axis corresponding to the direction of the sow's movement during behaviour performance (horizontal sidewise vs. vertical) was investigated. That is one of the reasons why low accuracies have often been found for rooting behaviour. Hopefully, future studies will improve performance, as this behaviour, as part of exploratory behaviour, is highly valuable for welfare assessment.
Other general aspects concerning algorithm performance also need further consideration. As shown in Tables 2,3,4 and 5, most researchers have so far been collecting data on only one farm, using rather small numbers of animals for algorithm development and testing. This leads to the question of whether the algorithm produces reliable results on other farms and animals. Furthermore, algorithm development in pigs has been focusing on sows (see Tables 3 and 5), so that algorithm performance might be lower in smaller conspecifics. It is also important to be aware that the indicator chosen to monitor the feature variable or the target variable in question may not be the best there is. Referring to the target variable, it is also very important to consider that the gold standard often has a much lower sampling frequency than the real-time solution that researchers are aiming for (Berckmans, 2013). In the case of lameness, for example, a clinical examination by an expert cannot be carried out as often as the accelerometer measures velocity. There may also be differences in the performance of different accelerometer devices as well as in data processing techniques and preferred performance metrics. Furthermore, it has to be taken into account that the performance of an algorithm can never be better than that of the observer who is initially labelling behaviours (or welfare conditions) for development of that algorithm.

Health and welfare assessment with accelerometers
Some of the welfare principles and criteria indicated in the Welfare Quality® (WQ) assessment protocol (Welfare Quality, 2009a, 2009b can already be covered well by accelerometer technology (see Table 6). Monitoring feeding behaviour continuously appears to be a more reliable way to evaluate "Good feeding" than the visual assessment of body condition by humans as body condition itself does not reflect current feed availability and intake and an increase or decrease in BCS might take days or weeks to be noticeable. For other principles and criteria only a few specific behavioural indicators have been studied so far. Thus, further research is needed to establish appropriate methods to fill the missing gaps. Here as well, the imbalance between research progress in cattle and pigs becomes obvious.
As described in the previous sections, welfare studies on pigs by applying accelerometer technology have worked on different behaviourchanging factors, including diet, cycle, enrichment, housing, social mixing, oestrus, lameness, diseases and farrowing prediction. Better monitoring of behaviour around farrowing can potentially improve welfare and reduce piglet mortality (Cornou and Kristensen, 2014). Therefore, further research in this field and the implementation of a real-time solution that can be used by farmers could be beneficial. In cows, behavioural and welfare research has relied on accelerometer output to study the effects of environment or treatment on behaviours, e. g., the effects of climatic conditions on lying behaviour (Tullo et al., 2019) and the presence of a mechanical brush on eating behaviours (Velasquez-Munoz et al., 2019). Another interesting scope of accelerometer technology application may be the assessment of positive welfare as an expression of the principle "Appropriate behaviour". In particular, playing behaviour includes behavioural traits (e.g., hopping, head tossing and shaking objects; (Newberry et al., 1988)) comprising very specific movement patterns that may provide reliable accuracies in algorithm performance. In pigs these movement patterns might be detected particularly when the accelerometer is placed on the ear, as many of these behaviours are characterised by different types of head movement. In calves, whole-body movements such as running, turning and bucking/kicking are indicative of play behaviour and can be recognised by a hind-leg-attached accelerometer (Größbacher et al., 2020). With regard to diseases, sensor technologies have enormous potential to support the user in their early detection. Perhaps to hide signs of vulnerability, behavioural indicators of sickness in farm animals are often initially subtle (Miller et al., 2019) and therefore more difficult to detect by simple observation (Millman, 2007). PLF technologies are able to detect those subtle changes and pre-pathological indicators days or weeks before they become apparent to humans (Munsterhjelm et al., 2015;Martínez-Avilés et al., 2015). Furthermore, early detection of behavioural changes can not only support disease prevention but also hint at management and husbandry drawbacks that might lead to serious welfare concerns. Good examples of injuries that can cause alterations in behaviour are shoulder sores in sows and tail injuries in growing pigs. Increased occurrence of shoulder wounds can be caused, inter alia, by prolonged (lying) contact with an unyielding floor (Bonde et al., 2004;Zurbrigg, 2006). They can trigger pain (Dahl-Pedersen et al., 2013) and subsequently also modify lying behaviour. Larsen et al. (2015) showed that sows with shoulder sores spent less time lying, tended to perform more postural changes, spent more time standing still, and showed increased shoulder rubbing and reduced nursing frequency compared to healthy individuals. It must be considered that changes in behaviour may reflect that there has been an increase or decrease in health and/or welfare, although the reason for the change may not be obvious. Most behavioural indicators are not specific for one particular welfare condition or sickness, which emphasises one of the main weaknesses of accelerometer application in welfare research. Under practical conditions, conclusions about the cause of a behavioural change may be difficult to draw on the basis of acceleration data only, no matter how high the accuracy of the detection of a particular behaviour. Monitoring more than one behavioural parameter at the same time, setting up a system that compares and recognises simultaneous changes in different behaviours and adding sensors with different functions to the device may provide a solution and therefore enhance the potential of accelerometer technology. Additional features may include, for example, the assessment of body temperature, localisation (Wolfger et al., 2017) and identification at feeders and drinkers to monitor feed and water intake (Andersen et al., 2014). Furthermore, the combination of many different PLF technologies with all their respective advantages greatly improves possibilities, although possible interference should be taken into account. Considering all these aspects may bring researchers closer to a system that is able to evaluate welfare on the basis of the four principles of the Welfare Quality assessment protocol objectively, continuously and individually.

Conclusions
-Specific behaviours can serve as indicators for health and welfare.
Accelerometer systems can measure feature variables associated with these indicators and serve as early warning systems for diseases. -In cattle, accuracies of >95 % have been found for feeding behaviours and >99 % for movement and resting behaviours. Sensitivities of >80 % have been achieved in pigs (sows) for lying in ventral and lateral position, walking, standing, posture changes, nest-building and stepping behaviours. Reliable results (F1 score: 0.96) have also been found for sitting. -Whereas there are many commercial products available for cows, there is so far no commercial accelerometer system available for pigs. -High sampling frequency and application of several tags in optimal location and orientation should be considered for research purposes, while commercial production should aim for a compromise between accurate detection of behaviours, long battery life and practicable attachment. -Welfare research in cattle and pigs by applying accelerometer technology has focused on different behaviour-changing factors, including diet, daily cycle, enrichment, temperature, housing system, stocking density, social mixing, housing system and lameness. Systems have also been applied to monitor diseases, oestrus and calving/ farrowing. -Future studies should focus on improving detection performance of behaviours with low accuracies, e.g., drinking behaviours, and combine accelerometers with other promising technologies such as temperature loggers, RFID, location trackers or proximity sensors.