# Detection of cow hind-leg activity during milking by using a 3-dimensional accelerometer attached to the milking cluster

Camille Raoult, A.A. Margerit, S. Fricker, F.E. Blümel, P.E. Savary

► To cite this version:

Camille Raoult, A.A. Margerit, S. Fricker, F.E. Blümel, P.E. Savary. Detection of cow hind-leg activity during milking by using a 3-dimensional accelerometer attached to the milking cluster. JDS Communications, 2025, 2 (2), pp.55-60. 10.3168/jdsc.2020-0020. hal-05005224

HAL Id: hal-05005224

https://isara.hal.science/hal-05005224v1

Submitted on 25 Mar 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

# Detection of cow hind-leg activity during milking by using a 3-dimensional accelerometer attached to the milking cluster

C. M. C. Raoult,<fnref n="1" />*† A. A. Margerit,² S. Fricker,³,⁴ F. E. Blümel,⁴ and P. E. Savary<fnref n="1" />

## Graphical Abstract

<figure><img src="image_3.png" /></figure>

## Summary

Hind-leg activity during milking, as an indicator of welfare impairment, was recorded on 45 dairy cows during 2 milkings by using direct visual observations and a 3-dimensional (3D) accelerometer attached directly to the hook of each milking claw. Our study shows that the use of a 3D accelerometer attached to the milking cluster is a promising method to reliably estimate cow hind-leg movements. An automatic and objective detection of foot-lifting, stepping, and kicking behaviors allows analysis of the causes and optimization of the milking process to improve animal welfare, cow (udder) health, and milking performance, as well as reduction of such potentially dangerous behaviors.

## Highlights

* Hind-leg activity during milking in cows is a good welfare indicator

* Cow hind-leg movements are transmitted to the milking claw

* 3D accelerometers attached to the milking claws accurately record cow hind-leg movements

<figure><img src="image_4.png" /></figure>

<footnote n="1">¹Centre for Proper Housing of Ruminants and Pigs, Federal Food Safety and Veterinary Office, Agroscope Tänikon, 8356 Ettenhausen, Switzerland,
²Independent researcher, 77750 Saint-Cyr-sur-Morin, France, ³Department of Livestock Systems Engineering, Institute of Agricultural Engineering, University of Hohenheim, 70593 Stuttgart, Germany, ⁴Competitiveness and System Evaluation, Agroscope Tänikon, 8356 Ettenhausen, Switzerland. *Present address: Department of Animal Husbandry & Ecology, Institute of Agricultural and Nutritional Sciences, Martin Luther University, 06120 Halle (Saale), Germany. †Corresponding author: camille.raoult@landw.uni-halle.de. © 2021, The Authors. Published by Elsevier Inc. and Fass Inc. on behalf of the American Dairy Science Association®. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/). Received August 25, 2020. Accepted December 01, 2020.</footnote>
<figure><img src="image_5.png" /></figure>

# Detection of cow hind-leg activity during milking by using a 3-dimensional accelerometer attached to the milking cluster

C. M. C. Raoult,<fnref n="1" />*† A. A. Margerit,² S. Fricker,³,⁴ F. E. Blümel,⁴ and P. E. Savary<fnref n="1" />

**Abstract:** Hind-leg activity in dairy cows during milking is considered an indicator of a stressful situation or discomfort. Automatic detection of cow hind-leg activity during milking could be used to monitor deficiencies at the cow, milking machine, or human level. We assumed that the milking cluster follows cow hind-leg movements during milking. Therefore, the aim of our study was to estimate the ability of a 3-dimensional (3D) accelerometer attached to the claw's hook of the milking cluster to indirectly measure cow hind-leg activity during milking. The behavior of 45 dairy cows during 1 morning and 1 evening milking in a 2 × 3 auto tandem milking parlor was monitored by using direct visual observations and a 3D accelerometer attached directly to the hook of each milking claw. We recorded when hind-leg foot-lifting or stepping (undifferentiated) and kicking behaviors occurred. Detected activities were obtained after applying a standard deviation filter (over a sliding window of 1 s) on the x (left/right lateral) acceleration axis only. We set the detection threshold at 0.13 g (i.e., 1.27 m·s⁻²), based on the visual evaluation of 10 "reference" graphs (from 5 randomly chosen cows). Periods of activity were created for each observed or detected activity (and for consecutive activities that were less than 3 s apart) to take into account the milking cluster's rocking motion resulting from a single movement. Observed and detected periods of activity were considered matching when they occurred simultaneously (with a 2-s delay acceptance in the visual observations). In total, 472 periods of hind-leg activity were observed. The detection of hind-leg activity by using a 3D accelerometer attached to the milking cluster was found to have 69% sensitivity, 99% specificity, 75% positive predictive value, 98% negative predictive value, and an overall accuracy of 97%. On average, cows were observed being active 0.94 times per minute and being detected active 0.86 times per minute. The observed and detected periods of activity were found to be correlated (r = 0.657). Therefore, the use of a 3D accelerometer attached to the milking cluster seems promising for reliably estimating cow hind-leg activity during milking. Nevertheless, further investigations are necessary to clarify whether other factors can cause variations in milking cluster movements, regardless of cow hind-leg activity, and to generalize our method to better identify deficiencies in cow–machine–human interactions.

Daily milking is a common routine for dairy cows that involves a strong interaction between animal, human, and milking equipment. Cow behavioral changes during milking can serve to highlight “welfare problems relating to udder health [including teat condition], milking techniques [including milking machine configurations], skin lesions caused by ticks and quality of handling routines in the individual herd” (Rousing et al., 2004). Restlessness behavior during milking is considered an indicator of a stressful situation (Willis, 1983; Gygax et al., 2008), and an increase in kicks and steps might highlight cow discomfort (Penry, 2018). In particular, Penry (2018) proposed to integrate these behavioral changes into an investigation protocol, including milking time observations such as in the Lactation Technote 13 of Dairy Australia (2003), so that when kicks and steps reached a certain threshold, it would trigger investigations on causes. Stepping, flinching, foot-lifting, and kicking behaviors during milking occur for multiple reasons, such as deficiencies in the milking machine or husbandry conditions in the milking parlor (e.g., aversion to the human handler; Rushen et al., 1999; Rousing et al., 2004). In general, tech-

nical deficiencies of the milking machine, such as over-milking (Cerqueira et al., 2017), high system vacuum levels, vacuum drops at the teat end (Besier et al., 2016), or high vacuum level in the mouthpiece chamber of the liner (Newman et al., 1991; Penry et al., 2017), have a detrimental effect on the teat (congestion, ringing at the teat base, lesions) and udder tissue conditions, which can lead to pain as well as defensive reactions and restlessness in cows. Intrinsic cow factors, such as parity or udder health, can also have an influence. Multiparous cows seem to kick less (Cerqueira et al., 2017) and step more (Gygax et al., 2008; Cerqueira et al., 2017) than primiparous cows; however, Rousing et al. (2004) observed that high-yielding cows older than parity 4 stepped less than did younger cows. Cows with an SCC >200,000 cells/mL (Gygax et al., 2008; Cerqueira et al., 2017) or with teat lesions (Rousing et al., 2004) were also found to kick more during milking. To limit the occurrence of these behaviors, they should first be detected objectively and easily. Behavioral parameters are often monitored by means of video recordings or direct visual observations. However, these methods are time consuming and labor intensive,

<footnote n="1">¹Centre for Proper Housing of Ruminants and Pigs, Federal Food Safety and Veterinary Office, Agroscope Tänikon, 8356 Ettenhausen, Switzerland,
²Independent researcher, 77750 Saint-Cyr-sur-Morin, France, ³Department of Livestock Systems Engineering, Institute of Agricultural Engineering, University of Hohenheim, 70593 Stuttgart, Germany, ⁴Competitiveness and System Evaluation, Agroscope Tänikon, 8356 Ettenhausen, Switzerland. *Present address: Department of Animal Husbandry & Ecology, Institute of Agricultural and Nutritional Sciences, Martin Luther University, 06120 Halle (Saale), Germany. †Corresponding author: camille.raoult@landw.uni-halle.de. © 2021, The Authors. Published by Elsevier Inc. and Fass Inc. on behalf of the American Dairy Science Association®. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/). Received August 25, 2020. Accepted December 01, 2020.</footnote>
require trained observers (Winckler and Willen, 2001; Rushen et al., 2012), and cover only a short period of time. Automated data recording using, for example, a wireless system can thus be seen as a solution (Müller and Schrader, 2003). In particular, accelerometers have been found to record animal (locomotor) activities and postures (Moreau et al., 2009; de Passillé et al., 2010; Rushen and de Passillé, 2012) with reasonable accuracy compared with direct observations or videos (Martiskainen et al., 2009). Usually, wireless sensors are attached directly to the animals; for instance, to one hind-leg (Rushen and de Passillé, 2012), or mounted on a harness or collar (Moreau et al., 2009). However, to avoid attaching measurement technology directly to the animals and to reduce the number of sensors needed to measure each cow's hind-leg movements during milking independently of the herd size, in this study we used 3-dimensional (3D) accelerometers freely suspended on the milking cluster claw hooks. We assumed that activity of the hind-legs would be transmitted with sufficient accuracy to the milking cluster (i.e., the milking unit swaying with the hind-leg movements).

To test this hypothesis, we monitored 45 dairy cows (28 Brown Swiss and 17 Red Holstein × Swiss Fleckvieh; 8 cows <100 DIM, 19 cows 100–200 DIM, and 18 cows >200 DIM; 18 primiparous and 27 multiparous) during 1 morning (0430 h) and 1 evening (1630 h) milking in a 2 × 3 auto tandem milking parlor (GEA Farm Technologies GmbH, Bönen, Germany) in March 2014 at the Agroscope Research Station in Tänikon, Switzerland. The milking machine system vacuum was set at 38 kPa, the 2 × 2 (alternating) pulsation rate at 60 cycles/min, and the pulsator ratio at 60:40 (with the a-, b-, c-, and d-phases set to 140, 460, 70, and 330 ms, respectively). To avoid incomplete milkings, the automatic stripping system Finilactor (GEA Farm Technologies GmbH, Bönen, Germany) was used. This system, integrated in the milking arm, applies a slight pressure on the claw when the milk flow drops below the threshold value of 0.8 kg/min and until the cluster is automatically removed at a flow threshold of 0.3 kg/min. Milking was performed by the same person using consistent preparation procedures (fore-stripping, pre-dipping, and drying). The udder preparation time before attachment of the milking unit took approximately 1 min. After milking unit attachment, the cows were automatically stimulated with a pulsation of 200 pulses per second for 30 to 50 s, depending on the lactation stage (as standard procedure at the Research Station). During milking, we recorded the cows' foot-lifting or stepping (undifferentiated) and kicking behaviors (based on Kutzer et al., 2015) in both hind-legs by direct visual observations [sampling rate at 1 Hz; using an appropriate spreadsheet (Excel 2010, Microsoft Corp., Redmond, WA) on a touch pad time-synchronized with the accelerometers]. Visually observed foot-lifting or stepping were indifferently defined as a foot elevated less than 15 cm off the ground (i.e., with or without weight displacement; contrary to the definitions of Kutzer et al., 2015), whereas kicking in any direction corresponded to a hoof lifted at least 15 cm. The logic behind this simplified categorization was to allow comparison with accelerometer measurements, for which a weight displacement could not be assessed. These same behaviors were also recorded by using a 3D accelerometer (MSR145 data logger, 20 × 15 × 52 mm, ~0.016 kg; MSR Electronics GmbH, Seuzach, Switzerland) attached to the claw's hook of each of the 6 milking clusters (GEA Classic 300 milking cluster,

GEA Farm Technologies GmbH). We programmed and synchronized all the loggers identically and transferred the MSR data using the software MSR 5.24.02 (MSR Electronics GmbH). We recorded the acceleration on the x- (left/right lateral acceleration, perpendicular to the cow body axis), y- (forward/backward acceleration, parallel to the cow body axis), and z- (vertical acceleration) axes with an accuracy of ± 0.15 g, a resolution of ± 0.03 g, and a range of ±15 g (where 1 g = 9.81 m·s⁻²) and set the sampling rate at 50 Hz. The aim of this work was to test whether hind-leg activity during milking could be detected indirectly by using a 3D accelerometer attached to the claw's hook of the milking cluster.

Data processing and statistical analyses were performed in R version 3.6.1. (R Core Team, 2019). We imported the MSR data and direct visual observations into R, so that the milking place, cow number, time of day (morning or evening milking), start and stop of the milking, and observed activities coincided. We observed from 10 reference graphs (described later) that the activity of the hind-legs creates a left-right rocking motion of the milking cluster (i.e., on the x acceleration axis) with enough intensity to be detected by the accelerometer (see Figure 1). Data from the y acceleration axis provided a similar response curve to that of the x acceleration axis and did not improve the detection accuracy, whereas data from the z- acceleration axis led to detection of more activities than were visually observed. Therefore, to detect hind-leg activities, we used only the x acceleration axis values. Additionally, to remove small variations but preserve large acceleration variations, we applied a standard deviation filter over a sliding window of 1 s, meaning that we calculated the absolute value of the difference between the value measured and the rolling mean of the values measured during the previous second (at a sampling rate of 50 Hz, 1 s corresponds to 50 values). Furthermore, we wanted to avoid detection of cluster movements unrelated to hind-leg activities as measured with the y- and z-axes. The activity detection threshold was defined at 0.13 g (i.e., 1.27 m·s⁻²), based on the visual evaluations of 10 graphs from 1 morning and 1 evening milking of 5 randomly selected cows, for which we also had observed activities (referred to as “reference” graphs; for an example, see Figure 1). These cows were excluded from the remaining analyses, as were data from the morning milking of 1 additional cow because its direct visual observations were incomplete. Therefore, statistical analyses were performed on 79 milkings from 40 cows. The aim of this study was to determine whether observed hind-leg activities could be estimated by using a 3D accelerometer directly attached to the milking cluster rather than to differentiate kicks from steps. Thus, we considered kicks and steps undifferentiated. A period of activity was created for each activity visually observed, starting at the beginning of the observation and ending at the end of the observation and therefore varying in length (e.g., 1 s, 2 s, 3 s, 4 s or more). Consecutive activities that were less than 3 s apart were merged as a single period of activity (starting at the beginning of the first observation and ending at the end of the second or last observation). Periods of activity were created in the same way for the detected activities (acceleration peaks >0.13 g). We did so to account for the rocking motion of the milking cluster (the 3-s period being chosen based on visual observations), which will produce several acceleration peaks for a single foot movement, but also because cows often step repeatedly in short time intervals. Matching observed and detected periods of activity were considered when they occurred simultaneously,
with an acceptance of up to 2-s delay in the visual observations. As done by Röttgen et al. (2020), we calculated for each cow and milking the number of true positive (TP; when a period of activity was observed and detected), false positive (FP; when a period of activity was not observed but detected), false negative (FN; when a period of activity was observed but not detected), and true negative (TN; when a period of activity was neither observed nor detected) periods of activity to determine the following indices:

$$ \text{Sensitivity} = \frac{\text{TP}}{\text{TP+FN}} = \frac{\text{true test positive}}{\text{total observations of period of activity}}; $$

$$ \text{Specificity} = \frac{\text{TN}}{\text{TN+FP}} = \frac{\text{true test negative}}{\text{total observations of no period of activity}}; $$

$$ \text{Positive predictive value} = \frac{\text{TP}}{\text{TP+FP}} = \frac{\text{true test positive}}{\text{total detections of period of activity}}; $$

$$ \text{Negative predictive value} = \frac{\text{TN}}{\text{TN+FN}} = \frac{\text{true test negative}}{\text{total detections of no period of activity}}; $$

$$ \text{Prevalence} = \frac{\text{TP+FN}}{\text{TP+TN+FP+FN}} = \frac{\text{total observations of period of activity}}{\text{total observations and detections}}; $$

$$ \text{Accuracy} = \frac{\text{TP+TN}}{\text{TP+TN+FP+FN}} = \frac{\text{true test positive and negative}}{\text{total observations and detections}}; $$

To calculate the TN (i.e., periods of inactivity), we had to harmonize the duration of the different periods. As such, to avoid comparing short periods of activity (e.g., of 3 s) with longer periods of inactivity (e.g., of 30 s or more), we divided the inactivity period into smaller periods of 3 s, so that the longer the period of inactivity detected, the higher the number of TN. Sections of 3 s were chosen to coincide with the approximate duration of an activity, thus best reflecting the specificity of our detection method. We also defined the average number of periods of activity per cow per

<figure><img src="image_6.png" /><figcaption>**Figure 1.** Example of cow hind-leg activity during one milking reported based on the x-axis (left/right lateral acceleration) values of the 3-dimensional accelerometer after a standard deviation filter over a sliding window of 1 s was applied. Visual observations of the foot-lifting (or stepping) and kicking behaviors are in blue and the detections (when higher than the threshold) in green. The dotted black line symbolizes the threshold set at 0.13 g.</figcaption></figure>

milking per minute and performed a Pearson correlation analysis between the observed and detected periods of activity per cow per milking per minute.

In total, 472 periods of hind-leg activity were observed (Table 1) with a prevalence of 4.82% for having a period of activity. The automated detection of the cows' hind-leg activity, by using a 3D accelerometer attached to the milking cluster, was found to have a sensitivity of 68.86% (i.e., the percentage of observed activities that were detected), a specificity of 98.85%, including 107 activities that were detected but not observed, a positive predictive value (or precision) of 75.23%, a negative predictive value of 98.43%, and an accuracy of 97.41% (Table 1).

The milking lasted on average 6.14 min, during which the cows were observed being active 0.94 times per minute (including 0.23 kicks per minute) and being detected active 0.86 times per minute. The observed and automatically detected periods of activity were found to be correlated ($r = 0.657; P < 0.001$; Figure 2).

In our study, we found that hind-leg movements of cows during milking are transferred to the milking cluster, creating an acceleration measurable by the sensor (as it is graphically visible once the standard deviation filter was applied on the x acceleration axis; for an example, see the graphical abstract). Here, these movements could be detected with reasonable accuracy by using a 3D accelerometer attached to the claw's hook of the milking cluster (and

<table><caption>**Table 1.** Overview of the number of observed and detected periods of cow hind-leg activity and the derived indices</caption><thead><tr><th></th><th>Observed activity</th><th>No observed activity</th><th></th></tr></thead><tbody><tr><td>Detected activity</td><td>True positive<br>325</td><td>False positive<br>107</td><td>Positive predictive value<br>75.23%</td></tr><tr><td>No detected activity</td><td>False negative<br>147<br>Sensitivity<br>68.86%</td><td>True negative<br>9,221<br>Specificity<br>98.85%</td><td>Negative predictive value<br>98.43%<br>Accuracy<br>97.41%</td></tr></tbody></table>
<figure><img src="image_7.png" /><figcaption>**Figure 2.** Correlation between the number of observed and detected periods of activity per cow per minute. Black points and triangles represent the cows (each cow having a different number) during their morning and evening milking, respectively. The thin dark gray line symbolizes the Pearson correlation.</figcaption></figure>

a threshold set at 0.13 g; i.e., $1.27 \text{ m·s}^{-2}$). The results show that our automated detection method was promising in regards to its sensitivity, high specificity, positive predictive value (three-fourths of the periods of activity detected were true periods of activity), and high negative predictive value. The predictive values obtained here are particularly meaningful because of the low prevalence rate in the population tested. In fact, predictive values are influenced by prevalence as follows: as prevalence increases, the positive predictive value increases, and negative predictive value decreases (Parikh et al., 2008).

Different factors could explain the over- and under-detections of the hind-leg activity of cows during milking. Dynamic conditions occur in the milking machine (Besier et al., 2016), such as mechanical liner movements (i.e., pulsation) and pressure differences (i.e., vacuum fluctuations), which could set the cluster in motion and lead to over-detection. The effect of different pulsation settings and milk flow levels on cluster movements could be the focus of further investigations. However, the accelerometer was positioned on the claw's hook of the milking cluster, which (in an unpublished pilot study) was found to be the location with the lowest disturbing fluctuations produced by the milking tube. Other aspects that could affect the transmission of hind-leg movements to the cluster are the cow teat and udder conformations, which can be very different within a herd (Zwertvaegher et al., 2012).

In addition, we defined a fixed detection threshold for all cows tested, based on the visual observation of the data of 5 randomly

selected cows. The difficulty we faced was in defining a threshold that would detect all movements (regardless of their type—foot-lifting, stepping, or kicking) but would not be too low to avoid noise detection. However, the cows might have had different baseline noise activities (e.g., breath, heart rate, rumen activity) and temperament (e.g., more or less active, strength variation). This threshold was therefore not optimized for each individual cow.

Because we used a high sampling rate (i.e., 50 Hz) which is known to increase accuracy of detection, we looked at the acceleration (passed through a standard deviation filter) on the x- (left-right lateral) axis only and not, for example, the summed accelerations of the 3 axes (Rushen and de Passillé, 2012). In a previous study, Luu et al. (2013) found that measuring acceleration in the vertical axis only did not seem to markedly reduce the accuracy of the gaits estimates. Looking at the accelerations on the y- and z-axes (or summed acceleration) here would have added noise unrelated to the hind-leg movements.

In the current study, one observer made all the direct visual observations due to space restrictions in the milking parlor. Although we could argue that using video recordings would have been more reliable to measure hind-leg activities during milking, we believe that the observer was less likely to miss hind-leg activities because of having greater adaptability to the situation (e.g., the observer could move away from the milker).

We studied only 1 herd of 40 cows during 2 milkings. To further test our method (and threshold), we should thus prove its accu-
<table><caption>**Table 2.** Frequency of cows' hind-leg activity during milking by study and type of milking system</caption><thead><tr><th>Study</th><th>Milking system type<fnref n="1" /></th><th>Foot-lifting and stepping rate (min<sup>-1</sup>)</th><th>Kicking rate (min<sup>-1</sup>)</th><th>Activity rate (min<sup>-1</sup>)</th></tr></thead><tbody><tr><td rowspan="2">Hopster et al., 2002²</td><td>AMS</td><td>1.13³</td><td>No data</td><td>1.13</td></tr><tr><td>ATM</td><td>1.11³</td><td>No data</td><td>1.11</td></tr><tr><td rowspan="2">Wenzel et al., 2003</td><td>AMS</td><td>0.61³</td><td>0.14</td><td>0.75</td></tr><tr><td>ATM</td><td>0.08³</td><td>0.07</td><td>0.15</td></tr><tr><td rowspan="2">Hagen et al., 2004</td><td>AMS</td><td>1.01³</td><td>0.07</td><td>1.08</td></tr><tr><td>HM</td><td>2.22³</td><td>0.29</td><td>2.50</td></tr><tr><td>Pastell et al., 2006⁴,<fnref n="5" /></td><td>AMS</td><td>1.84</td><td></td><td>1.84</td></tr><tr><td rowspan="3">Gygax et al., 2008⁶</td><td>AMS 1</td><td>0.54</td><td>No data</td><td>0.54</td></tr><tr><td>AMS 2</td><td>0.81</td><td>No data</td><td>0.81</td></tr><tr><td>ATM</td><td>0.75</td><td>No data</td><td>0.75</td></tr><tr><td>Kutzer et al., 2015⁷</td><td>HM/ATM</td><td>0.20</td><td>0.30</td><td>0.50</td></tr><tr><td>Present study (direct visual observations)</td><td>ATM</td><td>0.71³</td><td>0.23</td><td>0.94</td></tr></tbody></table>

racy with data from other herds, milking system types, and claw types. Because of the lack of comparable data, we could not verify whether cow characteristics (e.g., the cow's milk flow, lactation stage, parity), the time point of the milking, or the milking machine (e.g., claws, sleeves) and its calibration (e.g., vacuum level, pulsation types) had an effect on the sensitivity and specificity of our automatic detection method. For example, Bayer (1969) reported that cows have a lower heart rate in the morning, which could suggest behavioral differences (Wenzel et al., 2003) in the evening milking when cows are less relaxed.

Finally, comparing the number of cow hind-leg activities occurring during milking between our study and previous works was difficult because different activities were recorded using different definitions and were performed in different milking systems (e.g., automatic milking system, auto tandem milking parlor, or herringbone milking parlor). However, the milking parlor type does not seem to play a major role in the occurrence of stepping and kicking during milking (Gómez et al., 2017), although milking duration in an automatic milking system is, on average, shorter than in other systems. In our study, we counted the number of periods of activity observed per minute (i.e., all foot-lifting, stepping, and kicking behaviors combined), whereas previous studies recorded either the frequency or number of occurrences per milking of single steps, kicks, foot-liftings, or steps and kicks (see the summary table; Table 2). We might therefore have found fewer periods of activity than previous studies found steps and kicks. The 0.94 periods of activity per minute, including few kicks (i.e., 0.23 kicks per minute), that we observed in an auto tandem milking parlor seem consistent with the available literature. The defined periods of activity (merging single consecutive activities that are less than 3 s apart) appear to be an accurate estimate.

Here, we highlight the potential of our method to estimate the number of periods of activity regardless of the cow activity (Figure 2). The use of a 3D accelerometer attached to the claw's hook of

the milking cluster seems promising for reliably, objectively, automatically, and indirectly estimating cow hind-leg activities during milking. However, the results of this study show the limitation of using a fixed threshold, which can lead to both over- and underestimation of movements, as shown in Figure 2. A cow- (or even milking-) individualized threshold would thus probably optimize general detection accuracy. Accurate detection of foot-lifting (or stepping) and kicking behaviors during milking is a prerequisite if using this method in an automated monitoring tool of the milking process, milking machine configuration, and cow (udder) health. Further investigations are needed to clarify whether other factors can cause milking cluster movement variations regardless of the cows' hind-leg activity, as well as to generalize and validate the method, in other herds, milking systems, and claw types.

## References

Bayer, A. 1969. Rhythmische Veränderungen der Herzfrequenz aufgestallter Milchkühe. Berl. Munch. Tierarztl. Wochenschr. 82:345–346.

Besier, J., O. Lind, and R. M. Bruckmaier. 2016. Dynamics of teat-end vacuum during machine milking: Types, causes and impacts on teat condition and udder health—A literature review. J. Appl. Anim. Res. 44:263–272. https://doi.org/10.1080/09712119.2015.1031780.

Cerqueira, J. O. L., J. P. P. Araújo, I. Blanco-Penedo, J. Cantalapiedra, J. T. Sørensen, and J. J. R. Niza-Ribeiro. 2017. Relationship between stepping and kicking behavior and milking management in dairy cattle herds. J. Vet. Behav. 19:72–77. https://doi.org/10.1016/j.jveb.2017.02.002.

Dairy Australia. 2003. Lactation Technote 13: Seek advice professional advice if problems persist. Accessed Dec 2, 2020. https://www.dairyaustralia.com.au/resource-repository/2020/07/09/lactation-technote-13-seek-advice.

de Passillé, A. M., M. B. Jensen, N. Chapinal, and J. Rushen. 2010. Technical note: Use of accelerometers to describe gait patterns in dairy calves. J. Dairy Sci. 93:3287–3293. https://doi.org/10.3168/jds.2009-2758.

Gómez, Y., M. Terranova, M. Zähner, E. Hillmann, and P. Savary. 2017. Effects of milking stall dimensions on behavior of dairy cows during milking in different milking parlor types. J. Dairy Sci. 100:1331–1339. https://doi.org/10.3168/jds.2016-11589.

Gygax, L., I. Neuffer, C. Kaufmann, R. Hauser, and B. Wechsler. 2008. Restlessness behaviour, heart rate and heart-rate variability of dairy cows milked in

<footnote n="1">¹AMS, automatic milking system; ATM, auto tandem milking parlor; HM, herringbone milking parlor.</footnote>

<footnote n="2">²Kicking was not recorded.</footnote>

<footnote n="3">³Foot-lifting and stepping were not distinguished.</footnote>

<footnote n="4">⁴Results of healthy cows only.</footnote>

<footnote n="5">⁵Frequency of the foot-lifting, stepping, and kicking combined and calculated with an assumed milking duration of 7.16 min (based on milking duration in Wenzel et al., 2003).</footnote>

<footnote n="6">⁶Although the occurrence of kicking was recorded, it was not available in the article.</footnote>

<footnote n="7">⁷Behavior of heifers only.</footnote>
two types of automatic milking systems and auto-tandem milking parlours. Appl. Anim. Behav. Sci. 109:167–179. https://doi.org/10.1016/j.applanim.2007.03.010.

Hagen, K., D. Lawyer, R. Palme, J. Troxler, and S. Waiblinger. 2004. Milking of Brown Swiss and Austrian Simmental cows in a herringbone parlour or an automatic milking unit. Appl. Anim. Behav. Sci. 88:209–225. https://doi.org/10.1016/j.applanim.2004.03.005.

Hopster, H., R. M. Bruckmaier, J. T. N. van der Werf, S. M. Korte, J. Macuhova, G. Korte-Bouws, and C. G. van Reenen. 2002. Stress responses during milking: Comparing conventional and automatic milking in primiparous dairy cows. J. Dairy Sci. 85:3206–3216. https://doi.org/10.3168/jds.S0022-0302(02)74409-3.

Kutzer, T., M. Steilen, L. Gygax, and B. Wechsler. 2015. Habituation of dairy heifers to milking routine—Effects on human avoidance distance, behavior, and cardiac activity during milking. J. Dairy Sci. 98:5241–5251. https://doi.org/10.3168/jds.2014-8773.

Luu, J., J. Foske Johnsen, A. M. de Passillé, and J. Rushen. 2013. Which measures of acceleration best estimate the duration of locomotor play by dairy calves? Appl. Anim. Behav. Sci. 148:21–27. https://doi.org/10.1016/j.applanim.2013.07.004.

Martiskainen, P., M. Järvinen, J.-P. Skön, J. Tiirikainen, M. Kolehmainen, and J. Mononen. 2009. Cow behaviour pattern recognition using a three-dimensional accelerometer and support vector machines. Appl. Anim. Behav. Sci. 119:32–38. https://doi.org/10.1016/j.applanim.2009.03.005.

Moreau, M., S. Siebert, A. Buerkert, and E. Schlecht. 2009. Use of a tri-axial accelerometer for automated recording and classification of goats' grazing behaviour. Appl. Anim. Behav. Sci. 119:158–170. https://doi.org/10.1016/j.applanim.2009.04.008.

Müller, R., and L. Schrader. 2003. A new method to measure behavioural activity levels in dairy cows. Appl. Anim. Behav. Sci. 83:247–258. https://doi.org/10.1016/S0168-1591(03)00141-2.

Newman, J. A., R. J. Grindal, and M. C. Butler. 1991. Influence of liner design on mouthpiece chamber vacuum during milking. J. Dairy Res. 58:21–27. https://doi.org/10.1017/S0022029900033471.

Parikh, R., A. Mathai, S. Parikh, G. Chandra Sekhar, and R. Thomas. 2008. Understanding and using sensitivity, specificity and predictive values. Indian J. Ophthalmol. 56:45–50. https://doi.org/10.4103/0301-4738.37595.

Pastell, M., A. M. Aisla, M. Hautala, V. Poikalainen, J. Praks, I. Veermäe, and J. Ahokas. 2006. Contactless measurement of cow behavior in a milking robot. Behav. Res. Methods 38:479–486. https://doi.org/10.3758/BF03192802.

Penry, J. F. 2018. Milking time observations and mastitis—Putting results into perspective. Conf. Proc. Soc. Dairy Cattle Veterinarians of the NZVA, Hamilton, New Zealand. VetLearn Foundation, Palmerston North, New Zealand.

Penry, J. F., J. Upton, G. A. Mein, M. D. Rasmussen, I. Ohnstad, P. D. Thompson, and D. J. Reinemann. 2017. Estimating teat canal cross-sectional area to determine the effects of teat-end and mouthpiece chamber vacuum on teat congestion. J. Dairy Sci. 100:821–827. https://doi.org/10.3168/jds.2016-11533.

R Core Team. 2019. R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria.

Röttgen, V., P. C. Schön, F. Becker, A. Tuchscherer, C. Wrenzycki, S. Düpjan, and B. Puppe. 2020. Automatic recording of individual oestrus vocalisation

in group-housed dairy cattle: Development of a cattle call monitor. Animal 14:198–205. https://doi.org/10.1017/S1751731119001733.

Rousing, T., M. Bonde, J. H. Badsberg, and J. T. Sørensen. 2004. Stepping and kicking behaviour during milking in relation to response in human–animal interaction test and clinical health in loose housed dairy cows. Livest. Prod. Sci. 88:1–8. https://doi.org/10.1016/j.livprodsci.2003.12.001.

Rushen, J., A. Boissy, E. M. C. Terlouw, and A. M. B. de Passillé. 1999. Opioid peptides and behavioral and physiological responses of dairy cows to social isolation in unfamiliar surroundings. J. Anim. Sci. 77:2918–2924. https://doi.org/10.2527/1999.77112918x.

Rushen, J., N. Chapinal, and A. M. de Passillé. 2012. Automated monitoring of behavioural-based animal welfare indicators. Anim. Welf. 21:339–350. https://doi.org/10.7120/09627286.21.3.339.

Rushen, J., and A. M. de Passillé. 2012. Automated measurement of acceleration can detect effects of age, dehorning and weaning on locomotor play of calves. Appl. Anim. Behav. Sci. 139:169–174. https://doi.org/10.1016/j.applanim.2012.04.011.

Wenzel, C., S. Schönreiter-Fischer, and J. Unshelm. 2003. Studies on step-kick behavior and stress of cows during milking in an automatic milking system. Livest. Prod. Sci. 83:237–246. https://doi.org/10.1016/S0301-6226(03)00109-X.

Willis, G. L. 1983. A possible relationship between the flinch, step and kick response and milk yield in lactating cows. Appl. Anim. Ethol. 10:287–290. https://doi.org/10.1016/0304-3762(83)90179-7.

Winckler, C., and S. Willen. 2001. The reliability and repeatability of a lame-ness scoring system for use as an indicator of welfare in dairy cattle. Acta Agric. Scand. A Anim. Sci. 51(S30):103–107. https://doi.org/10.1080/090647001316923162.

Zwertaegher, I., S. Van Weyenberg, S. Piepers, J. Baert, and S. De Vliegher. 2012. Variance components of teat dimensions in dairy cows and associated factors. J. Dairy Sci. 95:4978–4988. https://doi.org/10.3168/jds.2011-5296.

## Notes

C. M. C. Raoult https://orcid.org/0000-0001-5587-108X

A. A. Margerit https://orcid.org/0000-0002-8712-3833

P. E. Savary https://orcid.org/0000-0002-9252-7007

The authors are grateful to the Martin Luther University (Halle, Germany) for financial support to C. M. C. Raoult; the Swiss Machinery Association (SLV; Bern, Switzerland) for financial support to F. E. Blümel; and the Federal Food Safety and Veterinary Office (Bern, Switzerland) for financial support to P. E. Savary.

A patent (Nr. CH 711 450 B1) exists for the system(s), device(s), and method(s) published in this paper.

The authors thank Christoph Bühler and Stefan Mathis (Swiss Future Farm, BBZ Arenenberg, Tänikon, Switzerland) for their support in preparing and conducting the experiment; Agroscope (Tänikon, Switzerland) for IT support; and two anonymous reviewers for improving the manuscript quality.

The authors have no conflicts of interest to declare.