Implications
Daily lying behaviour is an important contributor to the understanding of the welfare of dairy cows, and with the increasing focus on duration of lying new devices have been developed as tools for the automatic measuring of lying behaviour. The current study showed that the AfiTagII (Afimilk, Kibbutz Afikim, Israel) device measures duration of lying behaviour with high accuracy in a loose-house system both with slatted floor and on deep bedding. However, the strap of the device caused skin lesions on 60 of 155 cows during a 1-year period.
Introduction
Lying behaviour is a high priority in dairy cows, and both the production and the welfare of a cow can be compromised if lying behaviour is thwarted (Munksgaard et al., Reference Munksgaard, Jensen, Pedersen, Hansen and Matthews2005; Westin et al., Reference Westin, Vaughan, de Passille, DeVries, Pajor, Pellerin, Siegford, Vasseur and Rushen2016). The lying behaviour of dairy cows may be affected by a variety of factors, including housing conditions (Ceballos et al., Reference Ceballos, Sanderson, Rushen and Weary2004; Norring et al., Reference Norring, Manninen, de Passille, Rushen, Munksgaard and Saloniemi2008), health status, stage of lactation and parity (Bewley et al., Reference Bewley, Boyce, Hockin, Munksgaard, Eicher, Einstein and Schutz2010). Furthermore, changes in lying behaviour and activity may be an indication of lameness or changes in the state of the cow, that is, when the cow is in oestrous and around calving (Thorup et al., Reference Thorup, Munksgaard, Robert, Erhard, Thomsen and Friggens2015). However, making direct observations or video recordings of lying behaviour is time-consuming, and it is difficult to follow and observe cows in a loose-house system. Therefore, validation of a device that has the potential to record lying behaviour and activity reliably and automatically is highly relevant. So far, the AfiTagII device has only been validated in calves (Swartz et al., Reference Swartz, McGilliard and Petersson-Wolfe2016), thus a validation of the device is needed for dairy cows as well. A previous study with the AfiMilk Plus Tag system, which is an older version of the device validated here, on cows housed in tie-stalls, showed a high correlation between number of steps, frequency of lying bouts and lying time between the automatically recorded behaviour and video recordings (Felton et al., Reference Felton, Colazo, Ponce-Barajas, Bench and Ambrose2012). Other devices used for recording of lying behaviour like the HOBO Data Logger (HOBO Pendant G Acceleration Data Logger Onset Computer Corp., Pocasset, MA, USA) (Borchers et al., Reference Borchers, Chang, Tsai, Wadsworth and Bewley2016), the IceQube device (IceRobotics, Edinburgh, UK) (Kok et al., Reference Kok, van Knegsel, van Middelaar, Hogeveen, Kemp and de Boer2015) and the Onset Pendant G data logger (Onset Computer Corporation, Bourne, MA, USA) (Ledgerwood et al., Reference Ledgerwood, Winckler and Tucker2010) have been validated, but only for lactating Holstein cows in tie-stalls or free-stalls without deep bedding. However, the design of the environment where the cows rest (Ceballos et al., Reference Ceballos, Sanderson, Rushen and Weary2004; Norring et al., Reference Norring, Manninen, de Passille, Rushen, Munksgaard and Saloniemi2008), as well as the type of bedding material used (Campler et al., Reference Campler, Munksgaard, Jensen, Weary and von Keyserlingk2014), can affect lying behaviour since the bedding material may affect the angle of the leg when the cow is standing and lying. This may therefore affect the reliability of the output from an accelerometer-based sensor. Furthermore, the accuracy of the sensor output may depend on breed, since breeds as the Danish Holstein (DH) and Danish Jersey (DJ) vary in size, which might affect how the device is positioned at the cow’s leg. The aim of the current study was to validate the AfiTagII device on dairy cows. The duration of lying time and the frequency of lying bouts for cows in a loose-house system were recorded by the AfiTagII by direct observations and by another validated device (IceQube). The results of the three methods were compared. Data were collected from two differently sized breeds of cows on two types of bedding.
Material and methods
Housing and animals
The experiment was carried out at the Danish Cattle Research Centre (DCRC), which can house approximately 120 DH and 60 DJ cows divided into three sections with 60 cows in each. Lactating cows were kept in a loose-house system with a slatted floor and cubicles with mattresses (Comfi Cushion, with permeable rubber, Egtved, Denmark). The facility was equipped with a free cow traffic automatic milking system (DeLaval, Tumba, Sweden) with an automatic milking unit for each section. Dry cows were kept in pens with deep bedding in the lying area and with slatted floors in front of the feeders. The DJ and DH cows were housed together in the dry cow pen. All cows had access to water and partial mixed ration ad libitum, and additional concentrate was provided during milking in the robot for the lactating cows.
The AfiTagII device
The AfiTagII system is an electronic monitoring device designed to measure the number of steps, lying time, standing time and the frequency of lying bouts. The device uses a three-dimensional accelerometer (x-, y- and z-axes) to detect the posture of the cow (lying, standing/walking) and leg movements (steps). The AfiTagII device was attached with a strap to either the left or the right hind leg at least 3 weeks before the beginning of the direct observations to ensure that the cows were adapted to the device. The tightness of the strap around the hind leg allowed the device to move up, down and around the metatarsus, but it was not so loose that the device would touch the metatarsus-phalangeal joint of the cow. The cow number was linked to a specific tag number for identification.
Experimental design
Comparing output from AfiTagII with direct observations
In total, 20 cows (10 DH and 10 DJ) from two sections of the barn with slatted floor were observed. In addition, 20 cows (10 DH and 10 DJ) were observed in the deep bedding area of the barn. Observations from both bedding types included primiparous and multiparous cows (Table 1). Each cow was observed for a 2-h period by direct observation between 0900 and 1500 h. Direct observations of the lying behaviour were performed as scan sampling of lying behaviour in a 1-min interval. The observer was recording the lying behaviour of five cows at the same time, scoring if the cow was lying or not lying at each 1-min interval during a 2-h period. Each cow was marked with a coloured strap on the top of the neck collar to ease cow identification for the observer. Two observers recorded lying behaviour in the slatted floor area from a platform in the middle of the barn where both the section of DH and the section of DJ were visible. The observers altered breeds for each observation day (DH-DJ-DH or DJ-DH-DJ). Observations on cows from the deep bedding area were performed by two observers, one at a time, standing outside the pen at a location with the entire deep bedding area visible. The behaviour was recorded as lying or not lying, and lying was defined as the following: the cow is resting the whole body on the ground, but the head and neck can be above the ground. To be able to compare the direct observations with the data interval of the AfiTagII data output, the direct observations with the 1-min interval of the lying behaviour were aggregated for every 15-min interval in alignment with the timestamp on the AfiTagII data output.
The number of cows observed on slatted floor and on deep bedding included in the validation of the AfiTagII device, and the number of lactating cows wearing both the IceQube and the AfiTagII device

IceQube=three-dimensional (3D) accelerometer device for measurements of lying time, lying bouts and steps; AfiTagII=3D accelerometer device for measurements of lying time, lying bouts and steps.
Comparing output from AfiTagII with output from another device
A previously validated device (IceQube) was attached to the hind leg opposite to the AfiTagII device on 21 lactating cows from the slatted floor area. The duration of the data collection was between 7 and 42 days for each cow (N=21), resulting in a total of 718 days.
Skin lesions
During the evaluation study, we observed some cows developing skin lesions at the position where the AfiTagII device was attached. To assess the extent of skin lesions, all incidents of skin lesions were recorded and related to the total number of cows wearing the device during a full year from January 2015 to January 2016, in total 155 cows. Varying degrees of skin lesions from hair loss to wounds were observed, and when a skin lesion was noticed, the device was moved to the opposite hind leg to avoid further damage. If the cow was monitored with both devices when a skin lesion was noticed, the devices were removed and data recording was terminated for this cow.
Data handling
A new lying bout is recorded whenever the cow has been lying down for 1 min, and this bout is included in the lying bout frequency of the corresponding data interval. If the lying bout is shorter than 3 min, then the duration of this bout will be added to the duration of the lying time in the following data interval. Lying time is collected up to a maximum of 765 min and then the counter is reset to 0. The counter limit for lying bouts is 255 bouts (program design by Afimilk, personal communication). The AfiTagII data output is transmitted in 15-min intervals and is cumulative and was therefore summarized to match the observation period (2-h or 24-h period). The data are afterwards automatically transferred every hour to a PC with AfiActII system software by long distance transmission. Data were then transferred to Microsoft Excel for further analysis.
After data transmission, the data were filtered and cleaned by following procedures. Data were collected from 15-min intervals; however, occasionally the registration interval would be shorter or longer. Data were sorted by timestamp, and identical lines were deleted. Errors in the defined counter limits were corrected, and data were excluded when the lying time intervals were either too long or too short compared to the sum of lying time of the pre- and post-interval. A total of 1.1% of the raw data were excluded. For the algorithm calculating daily lying time and daily lying bouts, data from a 24-h period were included due to the criterion 1440±30 min, since registration intervals longer than the 15 min spanning midnight hampered the ability to register how much the cow had been lying before and after midnight. Data that did not fulfil this criterion for a 24-h period were excluded, resulting in exclusion of 5.8% of the recorded days.
Statistical analysis
A MIXED procedure was performed using SAS 9.3 (Littell et al., Reference Littell, Milliken, Stroup, Wolfinger and Schabenberger2006) with breed, parity and bedding material as fixed factors to investigate whether the estimates of lying time by the AfiTagII device were dependent on these variables. The cow was the experimental unit, and each data point included and presented in the figures each represents 15 min of observation. Repeated measures within each cow were included in the model as a random effect, and the covariance structure compound symmetry was used. The degrees of freedom were calculated by the containment method. Correlations in total duration of lying time between AfiTagII recordings and direct observations for each breed and type of bedding material were explored through the PROC CORR Spearman procedure in SAS, and regression analyses were performed through the PROC MIXED procedure in SAS to investigate whether the slope differed from 1 and whether the intercept differed from 0. The same procedures were used when investigating correlation and regression coefficients between data recorded by the AfiTagII device and data output from the IceQube device. The recordings of the lying bouts from direct observations were not normally distributed, and the frequency of the lying bouts for the 2-h observation interval ranged from 0 to 5. Therefore, no mixed model or regression analysis was applied for lying bouts compared with the directly observed number of lying bouts. Instead, the median, Q1, Q3 and the positive predictive value (PPV) were calculated both for cows on the slatted floor and on deep bedding.
Results and discussion
Validation of estimates of lying time
The numerical minimum and maximum values of the daily lying time from direct observations were in agreement with the estimates by the AfiTagII device for both types of bedding (Table 2). Breed, parity and bedding material had no effect on the duration of the lying time during the 2-h observation period (P>0.25). Since the study was not designed to measure the effect of breed and parity on the daily lying behaviour, these results are not expected to maintain external validity in relation to the daily lying time (24-h period). Similar correlations (r=0.98) and regression coefficients (slope=1.00, P<0.001; intercept=0.48, P>0.40) were found between direct observations and the AfiTagII device for each breed and bedding material. Therefore, data for both breeds and bedding materials are presented together in Figure 1. Calculations across the entire data set indicate a strong relation between the directly observed duration of lying time and the duration estimated by the AfiTagII (Figure 1).
The linear relationship between direct observations and recordings by the AfiTagII device for lying time (min) of cows measured every 15 min for a total observation period of 2 h (solid line) compared with the optimal relation presented as the dotted line (slope=1, intercept=0). AfiTagII=three-dimensional (3D) accelerometer device for measurements of lying time, lying bouts and steps.

The mean, minimum and maximum values of the lying time (min/2 h) and the median, Q1 and Q3 of the lying bouts (frequency/2 h) of the cows recorded by the AfiTagII device and by direct observations for both housing systems (slatted floor, deep bedding)

The positive predictive value (PPV) was calculated for lying bouts (frequency/2 h).
PPV=true lying bouts/total lying bouts; AfiTagII=three-dimensional accelerometer device for measurements of lying time, lying bouts and steps.
The high correlation found in the current study is in agreement with validations of an earlier version of the device (AfiAct Pedometer Plus; AfiMilk). The AfiAct has been validated both for cows housed in tie-stalls (Felton et al., Reference Felton, Colazo, Ponce-Barajas, Bench and Ambrose2012) and for cows kept in a loose-house system on two different types of bedding (sawdust-covered rubber-filled mattresses and sawdust-covered dual chamber water beds) (Borchers et al., Reference Borchers, Chang, Tsai, Wadsworth and Bewley2016). In the current study, the mean, minimum and maximum values concerning the lying time corresponded nicely between the AfiTagII and the IceQube device (Table 3), and for lying time a high correlation was found between the output from the AfiTagII device and the output from the IceQube device (r=0.94). The slope between the two devices was close to 1 (slope=0.91, P<0.001) with an intercept different from 0 (intercept=45.1, P<0.001) (Figure 2). The accuracy of the estimates of lying time from the AfiTagII device is in the same range as data collected from other existing electronic devices measuring lying behaviour, such as the HOBO Pendant G, the IceQube device and the AfiAct Pedometer Plus. These devices have been validated to correlate positively with either video recordings or visual observations for sampling intervals up to 15 min (Ledgerwood et al., Reference Ledgerwood, Winckler and Tucker2010; Mattachini et al., Reference Mattachini, Riva, Bisaglia, Pompe and Provolo2013; Borchers et al., Reference Borchers, Chang, Tsai, Wadsworth and Bewley2016).
The linear relationship for the daily lying time (24-h period) of cows between the IceQube data output and the AfiTagII data output (min) (solid line) compared with the optimal relation presented as the dotted line (slope=1, intercept=0). AfiTagII= three-dimensional (3D) accelerometer device for measurements of lying time, lying bouts and steps; IceQube=3D accelerometer device for measurements of lying time, lying bouts and steps.

The mean, minimum and maximum values of lying time (min/day) and lying bouts (number/day) of cows as the number of observations (Obs.) recorded by the AfiTagII and the IceQube device

AfiTagII=three-dimensional (3D) accelerometer device for measurements of lying time, lying bouts and steps; IceQube=3D accelerometer device for measurements of lying time, lying bouts and steps.
Validation of estimates of lying bouts
Among the group of lactating cows on the slatted floor, the total number of lying bouts estimated by the AfiTagII resulted in a PPV of 0.96 when these estimates were compared to the direct observations of lying bouts for the lactating cows kept on slatted floor (Table 2). The discrepancy arose from the direct observation of one more bout than estimated by the AfiTagII for one cow. The AfiTagII device registered no false lying bouts from cows on the slatted floor. The estimates of lying bouts for the group of dry cows on deep bedding resulted in a PPV of 0.85 with a deviation of four bouts among three cows. For two of the cows, the AfiTagII device recorded one and two false bouts, respectively, and for one cow the AfiTagII missed one bout (Table 2). Leg movements of the cows may account for the false recordings on the deep bedding, which indicates that the bedding material affected the sensor output. The lactating cows were housed on a slatted floor, while the dry cows were housed on deep bedding, and therefore stage of lactation was confounded with bedding material. However, dry cows are often kept on deep bedding, while this is rare for lactating cows. Therefore, we included both bedding materials and stages of lactation. There was a high correlation between the frequency of lying bouts estimated by AfiTagII compared with the data output of the IceQube device (r=0.94), also showing a high accordance between the mean, minimum and maximum values (Table 3). The slope of the linear relation between the estimates of lying bouts for the two devices was relatively close to 1 (slope=0.88, P<0.001), but the intercept differed from 0 (intercept=1.28, P<0.001). The IceQube device has previously been validated to have a PPV of 1.0 by a two-sensor approach (Kok et al., Reference Kok, van Knegsel, van Middelaar, Hogeveen, Kemp and de Boer2015).
Skin lesions
Of the 155 cows monitored with the AfiTagII device over the period of 1 year, there were 60 incidents of skin lesions at the metatarsus (position of attachment). These findings indicate that the AfiTagII device needs improvement to avoid the risk of developing skin lesions at the metatarsus of the cow.
Conclusion
The AfiTagII device accurately estimates the duration of lying and number of lying bouts. For lying bouts, there was a greater discrepancy in the estimated number of lying bouts for dry cows on deep bedding than for lactating cows on a slatted floor when the AfiTagII device was compared with direct observations. However, the accuracy of the duration of lying time was not affected by breed or bedding material. In addition, some cows monitored with the AfiTagII developed skin lesions, thus, improvements of the device are warranted.
Acknowledgements
The authors thank the staff at the DCRC. The project was financed by the Danish Milk Levy Foundation and Aarhus University, Graduate School of Science and Technology.
Declaration of interest
There was no conflict of interest with the companies that have produced the devices used in this study.
Ethics committee
The study followed the Danish legislations according to housing of dairy cows and included only non-invasive procedures.
Software and data repository resources
None of the data were deposited in an official repository.




