Next Article in Journal
miR-196a Promotes Proliferation of Mammary Epithelial Cells by Targeting CDKN1B
Next Article in Special Issue
The Global Epidemiology of Bovine Leukemia Virus: Current Trends and Future Implications
Previous Article in Journal
Genetically Related Avian Influenza H7N9 Viruses Exhibit Different Pathogenicity in Mice
Previous Article in Special Issue
Expression, Regulation, and Function of β-Defensins in the Bovine Mammary Glands: Current Knowledge and Future Perspectives
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Leveraging Accelerometer Data for Lameness Detection in Dairy Cows: A Longitudinal Study of Six Farms in Germany

by
Anastasia I. Lavrova
1,*,
Alexander Choucair
2,
Andrea Palmini
1,
Kathrin F. Stock
3,
Martin Kammer
4,
Friederike Querengässer
5,
Marcus G. Doherr
5,
Kerstin E. Müller
2,† and
Vitaly Belik
1,*,†
1
System Modeling Group, Institute of Veterinary Epidemiology and Biostatistics, School of Veterinary Medicine, Freie Universität, 14177 Berlin, Germany
2
Ruminant and Swine Clinic, School of Veterinary Medicine, Freie Universität Berlin, 14177 Berlin, Germany
3
Vereinigte Informationssysteme Tierhaltung e.V., Heinrich-Schröder-Weg 1, 27283 Verden (Aller), Germany
4
LKV Bayern e.V., Landsberger Straße 282, 80687 München, Germany
5
Institute of Veterinary Epidemiology and Biostatistics, School of Veterinary Medicine, Freie Universität, 14177 Berlin, Germany
*
Authors to whom correspondence should be addressed.
These authors contributed equally to this work.
Animals 2023, 13(23), 3681; https://doi.org/10.3390/ani13233681
Submission received: 20 September 2023 / Revised: 15 November 2023 / Accepted: 22 November 2023 / Published: 28 November 2023
(This article belongs to the Collection Cattle Diseases)

Abstract

:

Simple Summary

Lameness is a common problem among dairy cows, significantly impacting both their well-being and productivity. It not only hampers the mobility of cows but also exerts notable effects on behavioral aspects, like grooming and feed bunk visits. Typically, dairy cows are equipped with accelerometers primarily for estrus detection. Our goal was to formulate a model for detecting lameness using accelerometer data collected from six farms in Germany. Various statistical models were developed for lameness detection, including variables influenced by lameness, such as rumination, feeding and movement patterns, milk production, days in milk, and weight. The aim was to identify lameness in cows through a comprehensive analysis. We explored multiple models, considering different variables affected by lameness, and ultimately selected the most suitable model.

Abstract

Lameness in dairy cows poses a significant challenge to improving animal well-being and optimizing economic efficiency in the dairy industry. To address this, employing automated animal surveillance for early lameness detection and prevention through activity sensors proves to be a promising strategy. In this study, we analyzed activity (accelerometer) data and additional cow-individual and farm-related data from a longitudinal study involving 4860 Holstein dairy cows on six farms in Germany during 2015–2016. We designed and investigated various statistical models and chose a logistic regression model with mixed effects capable of detecting lameness with a sensitivity of 77%. Our results demonstrate the potential of automated animal surveillance and hold the promise of significantly improving lameness detection approaches in dairy livestock.

1. Introduction

Lameness, characterized as impaired locomotion, is a sign associated with numerous disorders of the locomotor tract, predominantly affecting the digits or the distal part of the limb [1,2]. The evaluation of movement impairment in lame cows involves visual mobility scoring, taking into account aspects such as the back line, stride length, duration of the supportive phase, and demonstration of head bobbing during walking [3]. Generally, the state of lameness is multifactorial in origin, influenced by risk factors such as the transition cow period, nutrition, parity, and milk yield [1,2,4].
Lameness not only hampers the mobility of cows but also significantly impacts behavioral patterns, such as grooming and resting behavior. Impaired mobility leads to reduced dry matter intake and fewer visits to the feed bunk [5]. In a recent review [4], a meta-analysis considering more than 100 papers was performed in order to identify the main risk factors associated with lameness occurrence; see also [6]. The key risk factors highlighted include claw overgrowth, the first 120 days in milk (DIM), and herd size. In addition, housing conditions, including cubicle dimensions, neck curb height, walking space design, and climatic and hygienic factors, impact claw health [2,7]. Currently, visual mobility scoring stands as the standard method for detecting lame cows [8,9]. Given that lameness reflects pain, early identification and treatment of lame cows are crucial for ensuring animal welfare. A recent review [9] explored different accelerometer-based systems, identifying variables such as the number and duration of lying bouts and gait characteristics as valuable for lameness detection.
Automatically recorded behavioral parameters, such as daily bout duration, the amount of activity impulses per hour (AI/h) or per day, and daily milk yields, exhibit the potential to identify pain and discomfort, serving as predictors of an unhealthy animal [8]. In addition to lameness, other diseases, like abomasal displacement, ketosis, mastitis, and metritis, can induce changes in activity and milk yield [10,11]. Moreover, animal-related factors such as DIM and parity may contribute to variations [12,13] in activity.
The accuracy of distinguishing between lame and nonlame cows is contingent on the type of device employed, whether it be a pedometer, accelerometer, or video-based system [8,9]. Despite this variability, sensor technology designed for recording activity patterns, particularly for estrus detection, is already widely implemented on dairy farms [14,15,16]. This widespread use facilitates the acquisition of ample data for subsequent processing and the development of statistical models for lameness detection and prediction.
There are plenty of recently developed mathematical methods for data analysis in the context of lameness detection and prediction, e.g., [17,18,19]. In general, a range of statistical models, including linear and logistic regression models, have been formulated, incorporating variables associated with lameness, such as rumination, feeding and movement patterns, milk production [20], days in milk, or weight [17,21,22]. These models aim to achieve high accuracy in detecting lameness in cows. More advanced models have employed image analysis techniques, particularly wavelet analysis [18,23,24], utilizing data obtained from specialized video-based systems. In addition to the factors mentioned, three additional indicators suitable for lameness detection—back posture, milk peak flow rate, and milk peak conductivity—have been identified [24]. Wavelet analysis of cow activity and somatic cell counts in milk has been proposed for the detection of both lameness and mastitis, showing potential for individual disease detection in dairy cows, though further analysis is needed [19]. Another approach [23] involves principal component analysis of pedometer and lactation time series to detect early stages of mastitis and lameness, though this method poses challenges in results interpretation.
Thus, there are quite a lot of studies devoted to the detection of lameness based on changes in cow behavior and milk yield. However, many of these studies have been conducted on experimental farms with relatively small sample sizes, often overlooking individual cow effects on a personal level [8,9,25]. Moreover, the variation in external conditions, such as seasonal changes, is seldom taken into account in these investigations.
In this study, we investigated an original dataset collected from six farms in Germany. The primary objectives of our investigation were (1) to find out the variations in activity and productivity indicators between lame and nonlame cows; (2) to assess the significance of external factors, specifically considering seasons; and (3) to develop lameness detection models and evaluate their quality in terms of sensitivity (SN), specificity (SP), and accuracy (ACC).

2. Materials and Methods

2.1. Animal Management and Housing

The dataset comprises information gathered from six dairy farms in Germany, involving a total of 4860 cows housed in a loose-housing system. Data collection occurred between May 2015 and October 2016. To enlist participant farms, contact lists provided by the accelerometer-distributing company Lemmer-Fullwood GmbH (Lohmar, North Rhine-Westphalia, Germany) were utilized. Farms were approached and invited to voluntarily join the study. Selection criteria required lactating cows to be equipped with accelerometers (Fullexpert® Differential Precision Pedometer, Lemmer-Fullwood GmbH, Lohar, North Rhine Westphalia, Germany) and stalled throughout lactation in free stall barns without access to pasture. The housing and management practices were assessed once, adhering to the Animal Needs Index 200 criteria [26].

2.2. Locomotion Assessment and Daily Milk Data

The locomotive behavior of the cows was evaluated using a 5-point numerical rating system (NRS) with increments of 1 [3], on a fortnightly basis whenever feasible. To conduct the assessment, cows from each pen were gathered at the end of a straight walking alley. An assistant separated each cow individually from the group, and if a cow showed reluctance to walk, gentle encouragement was provided. Observers were stationed approximately 20 m apart from the group, positioned on the right side of the walking alley in the direction of the cows’ movement. For the assessment, each approaching cow was halted and then walked by the observers. The scoring took place over distances ranging between 20 and 30 m to ensure accurate evaluation of the arch of the back, the gait, and the cow’s ability to bear weight while walking and standing, aligning with the criteria specified for correct locomotion [3].
The accelerometer, mounted on the cow’s leg, measures impulses exerted by vertical forces and its orientation along the x-, y-, and z-axis, allowing the classification of a cow’s activity as standing, lying, or walking [27]. The sensitivity of the device lies within a 5% deviation [28]. Throughout lactation, lactating cows were equipped with one device, at either the metatarsus or the metacarpus. In instances where a device was lost, the farmer replaced it. Data transmission occurred in the milking parlor, and data were sent to the farmer’s computer. The collected data were individually stored for each cow in the dairy management program FULLEXPERT® (Lemmer-Fullwood GmbH, Lohmar, North Rhine-Westphalia, Germany). Software then processed the raw data, providing mean activity impulses per hour (AI/h) and mean lying bout duration in minutes.
Daily milk yields were automatically recorded by the milking machines (Lemmer-Fullwood GmbH, Lohmar, North Rhine-Westphalia, Germany). To ensure comparability across all farms, precise milking times and intervals were taken into account when deriving daily yields. The Federal Milk Control Councils of Berlin-Brandenburg, Saxony, and Bavaria provided basic data for each cow, including sex, breed, date of birth, and performance data, such as calving date and parity. These details were obtained through the responsible computation centers (Rinderdatenverbund (RDV), Munich, Bavaria, Germany, and IT Solutions for Animal Production (vit), Verden, Lower Saxony, Germany).

2.3. Data Description

The obtained data included individual-cow factors, including mean daily activity impulses per hour (AI/h), average lying bout duration (in minutes), parity, lactation stage (DIM), locomotion score [3], and daily milk yield (in kg). Visual locomotion scoring was performed 29,481 times (as described in [3]) at intervals of 2 weeks on 12 occasions within 180 days out of a total of 511 days (from 31 May 2015 to 23 October 2016). In total, locomotion scoring was performed on 60 distinct days. Cows assigned Score 1 or 2 were categorized as nonlame (0), while those assigned Score 3, 4, or 5 were considered lame (1). Despite continuous activity measurement (with occasional gaps), the final processed dataset, following the principle of parsimony, included information for the 3 consecutive days preceding the day of locomotion scoring. This information comprised average daily activity impulses, daily averaged lying bout duration, and milk yield. Expanding the time frame to 7 consecutive days preceding the day of locomotion scoring did not yield significant changes in the results (not shown here).
The observations represent repeated measures across different, nonsubsequent time periods, involving a total of 2757 units (cows) after data cleaning. On average, each cow received a lameness score 8 times (median), with a maximum of 14 times and a minimum of once. After handling missing values, a total of 20,247 measurements were utilized for model development. Furthermore, values exceeding the upper 2% quantile for activity impulses, lying bout duration, and milk yield were excluded as they were deemed infeasible (e.g., daily milk yield exceeding 80 kg).

2.4. Statistical Modeling

To predict lameness, we will employ a logistic-regression-based approach. In this method, we dichotomize the locomotion score, considering scores below 3 as indicative of nonlame cows and scores equal to or higher than 3 as indicative of lameness. Given that animals were frequently scored at various time points, we will incorporate random effects for cow-individual factors, selecting farms as categorical variables. The logistic regression model is formulated as follows:
log π 1 π = x i β + u i j + ε ,
where β is a vector of regression coefficients (fixed effects) and x i is a matrix of major independent or explanatory time-dependent variables listed in Table 1; u i j are (nested) random (intercept) effects of farm unit j and unit (cow) i; and ε is an error vector (unobserved), which is assumed to be uncorrelated with the random effects vector. π = μ y is a conditional mean (i.e., the probability that the target variable y i j = 1 (lame) provided the existing x i values). Then, π / ( 1 π ) gives us the odds ratio that y i = 1 and log π / ( 1 π ) is log odds or logit.
The quality of fit for the model will be estimated using the formulas for accuracy ( A c c = ( T P + T N ) ( T P + T N + F P + F N ) = 60.2 % ), specificity ( S p = T N ( T N + T P ) = 82.3 % ), and sensitivity ( S n = T P ( T P + B N ) = 86.4 % ). Here, T P and T N are numbers of true-positive and true-negative results, respectively, while F P and T N are numbers of false-positive and false-negative results, respectively. The criteria for an appropriate model choice include model accuracy, R 2 value, and the Akaike information criterion (AIC). The data processing involves a self-written code in Python 3.7 [29], and the statistical model is implemented in R 4.0.3 [30].

3. Results

3.1. Data Processing

In Figure 1 and Figure 2, box plots illustrate the distribution of activity (measured by daily activity impulses), duration of a single lying bout (lying duration), and milk yield based on individual cow factors, such as parity and days in milk. Notably, differences in activity and productivity indicators (mean activity impulses, mean lying bout duration, and mean milk yield) are observed at a statistical level but not for individual measurements. Additionally, the data are not normally distributed (confirmed by the Shapiro–Wilk test on some of our data), and medians for lame and nonlame cows show slight differences. However, a substantial overlap in both interquartile intervals and outliers makes it challenging to distinguish between lame and nonlame animals.
The dataset indicates that lameness is a serious problem affecting 50 ± 2.2 % of animals, representing the average percentage of animals scored as lame. It is worth noting that animals could be scored multiple times on different days, as shown in Figure 3. The number of lame cows varies depending on the season and the farm. In Figure 3 (left), the counts of lame and nonlame cows from six dairy farms, determined by visual locomotion scoring [3], are presented based on the scoring week. The lower number of scorings towards the end of the study period was due to a delayed start of the observations and a postponed end of the study on a single farm. Furthermore, the duration of lameness episodes was investigated, categorizing cows into three different status groups based on repeated lameness scorings: persistently lame (score 3 and higher at all observations), persistently nonlame (scores 1 and 2 at all observations), and mixed group (scored interchangeably as lame and nonlame). A histogram depicting the distribution of these three groups across different farms is presented in Figure 3 (left). The analysis reveals that the largest group comprises animals with a mixed lameness status.

3.2. Model Description

Our goal was to predict the lameness status based on the available data (characteristic variables). Specifically, we explored the feasibility of categorizing DIM, milk yield, and lactation stage into discrete classes to create robust models. Additionally, mean activity impulses per hour, mean lying (bout) duration, and averaged milk yield variables were computed, averaged over 3 days preceding the day of scoring. Finally, a season variable was introduced, taking into account possible seasonal dependence. The timing for seasons was defined as follows: Spring (1 March–31 May), Summer (1 June–31 August), Fall (1 September–30 November), and Winter (1 December–28/29 February). We considered a range of significance levels (from p-value < 0.001 to 0.05 ). A detailed description is provided in Table 2.
In the following, we present a model that was developed and chosen from a range of alternative regression models (see Supplementary Materials) aiming to detect the lameness status based on the available data. We chose a logistic regression with mixed effects and different independent variables. The following independent variables were considered (see Table 1): mean activity impulses, mean lying bout duration, mean daily milk yield, DIM, parity, season, and their interactions.
We explored various options for random effects (refer to Supplementary Materials: models IV and V) and ultimately selected a random intercept dependent on individual cows. Additionally, interactions were taken into consideration in the model (see Table 2).

3.3. Model Predictions

To examine the ability of the implemented model to predict the lame/nonlame status, we divided the sample into training and validation datasets. We used the scoring by veterinarians available from our study according to [3] as a gold standard in the following calculations. To preserve the original characteristics of the data, the training dataset was extracted from the original data to include 80% of observations from each cow. Consequently, the training dataset comprises approximately 80% of the total observations. Once the model was trained on the training dataset, its predictive performance was assessed on the validation dataset, which contains the remaining 20% of the total observations. As mentioned earlier, the validation dataset consists of 20% of observations from each cow, making up approximately 20% of the original dataset. This approach was implemented to ensure that at least one observation from the same cow in the same farm is present in both the training and validation datasets, preserving the structure of the random effects component of the model.
The accuracy of prediction for the validation dataset, assessed as the number of correctly predicted values over the total number of predictions, was 0.81 (CI: 0.79–0.82). The precision ( P r = T P / ( T P + F N ) ) of the model, indicating how well the model performs when a prediction is positive and, therefore, how many positive predictions are true, was 0.80. The recall ( R e c = T P / ( T P + F N + F P ) ) of the model, measuring how well the model predicts positive classes, was 0.78, calculated as the ratio of correct positive predictions to all positive classes. The weighted average for precision and recall, taking into account both false positives and false negatives, is the F1 ( F 1 = P r · R e c / ( P r + R e c ) ) score, which has a value of 0.82 for our predictions. Regarding sensitivity and specificity, characterizing the true-positive rate (similar to recall) and true-negative rate, and hence the proportion of truly classified positive and negative classes, the sensitivity and specificity for the validation dataset are 0.82 and 0.79, respectively.
For the training dataset, the AIC of the model is given as 13,625 and thus is much lower than the AIC of all other considered models (see Supplementary Materials).
With the help of the R package ggeffects [31], we were able to visualize the probability of lameness (Figure 4) predicted by the model. This visualization provides insights into the dependence of lameness probability on the independent variables and their interactions. These predictors were chosen on the basis of the calculated odds ratio values and p-values (see Table 2). For example, a high parity (variable “lact” in Table 1 and Table 2) class results in an almost 100% increase in lameness probability with an odds ratio (OR) of 1.890, CI ( 1.690 , 2.100 ) , and a p-value of <10 16 . On the other hand, the DIM variable appears not to significantly influence the curve slope of the dependence of lameness probability on the parity class, with an OR of 1.000, CI ( 0.996 , 1.003 ) , and a slightly significant p-value of 0.089 . However, the interaction term of both parity and DIM is slightly increased ( OR = 1.002 , CI ( 0.998 , 1.004 ) , and p-value = 0.066). It seems that parity is the most crucial factor for lameness, and this dependence may stem from considering parity as a proxy for age (see [32]). Regarding activity indicators, it appears that the activity impulses (per hour) averaged over 3 days preceding lameness scoring ( OR = 1.001 , CI ( 0.995 , 1.002 ) , p-value = 0.065) are slightly more important for lameness prediction than the average lying bout duration measured in minutes ( OR = 0.990 , CI ( 0.990 , 1.002 ) , p-value = 0.069). However, the interpretation of OR for continuous variables (activity impulses and lying duration) is dependent on units of measurement and requires caution. According to the calculated p-values in Table 2, the season factor is an important variable affecting lameness (especially in the interaction with lactation, e.g., for the interaction p a r i t y S p r i n g OR = 1.140 , CI ( 1.050 , 1.250 ) with a significant p-value of 0.003 . However, as it can be seen from Figure 4, for the summer season, the spread in values is quite dramatic, and the probability to be lame varies approximately from 35 % to 70 % with large p-values ( p > 0.1).

4. Discussion

We constructed a range of univariate models (see Supplementary Materials) for lameness detection using various variables (activity, milk yield, and cow-individual factors). Finally, we selected the model with the highest accuracy.

4.1. Interaction between Lameness Risk Factors and Seasons

The probability of lameness significantly decreases with the increase in daily milk yield, dropping from approximately 50% for low milk yield (5 kg) to 25 % for high milk yield (50 kg). This decrease might be explained by the correlation between lameness-causing illness and decreased milk yield. However, the seasonal interaction presents a different pattern, particularly in summer. In contrast with other seasons, lameness becomes more probable with increasing milk yield in the summer months. Cows in summer might suffer from heat stress, leading to delayed lameness following periods of heat stress [33]. Although the probability of lameness given by the model shows a broad variance, and the summer season factor is not statistically significant (Table 2) due to the limited number of observations in summer (Figure 3), it suggests a potential association. For other seasons, there is a slightly stronger decrease in lameness probability with higher milk yields in winter compared with spring and fall. Lower lameness probability is observed for increasing DIM. The increase in parity leads to curve saturation, with the probability of being lame approaching almost 100%. Similar dynamics are observed for the dependence of lameness probability on activity impulses and lying bout duration (not shown). The prediction of lameness becomes less reliable for extreme values of activity impulses (very low and very high) since the confidence interval for the “mean trend” widens. This may be due to various lameness risk factors, especially in summer, related to extreme temperatures [34]. However, in the present dataset, we have a small amount of data points (namely, 344) from summer, when most extreme temperature fluctuations occur. Therefore, the influence of summer could not be reliably assessed, as reflected in the high uncertainty in the odds ratio for this factor. This will be a subject of further investigations.
It is important to note that our analysis operates on the dataset as a whole, assuming stationarity on average. This approximation is motivated by data availability and the primary goal of the study: to reveal primary indicators of lameness, taking into account data from different cows and farms but without detailed time series analysis. Events well localized in time can affect instant lameness, but the longitudinal exploration of time series is beyond the scope of the present study. Future research should aim at analyzing the discovered indicators at a higher temporal resolution suitable for the analysis of nonstationary time series.

4.2. Quality of Fit of the Model

Our results demonstrate the potential of automated animal surveillance and promise to significantly improve lameness detection approaches in dairy livestock. With the daily activity data for cows from our study readily available, there is potential to extend the application of the developed model for lameness detection beyond the 3 or 7 days preceding scoring dates considered in this study.
In the implemented models, we neglected possible autocorrelations [33,34] or even cross-correlations of variables present on individual or farm levels. This is justified in Supplementary Materials, where we observed no significant improvement in the model’s quality when considering the activity on each of the few days preceding a lameness screening event instead of time-averaged activity indicators. Regarding the choice of variable types, such as nominal and ordinal, the analysis in Supplementary Materials suggests no substantial difference as well. It is worth mentioning that further behavioral characteristics, such as grooming [5] or even animal social behavior [35,36], might be utilized to assess lameness conditions. In this study, we divided cows into two groups—lame and nonlame—focusing on the most important risk factors for the detection and prediction of lameness. However, considering recent studies [37], it would be useful to perform statistical analysis and modeling by dividing animals into three groups: persistently nonlame, persistently lame, and those that may be lame or healthy interchangeably.
The future research goals will involve verifying the validity of the model, incorporating additional data, and extending the approach with promising machine learning techniques. These may include deep artificial neural networks [38,39,40], random forests, and boosted regression trees [41], especially as more and better time-resolved data become available.
In our study, the established scoring scheme after [3] was utilized as a gold standard for lameness assessment. While we acknowledge its limitations [8], an investigation of its validity is beyond the scope of the current study and should be analyzed separately.

5. Conclusions

Based on the analysis of widely available accelerometer activity data, alongside productivity indicators (milk yield) and cow-individual metadata, we constructed a statistical model (logistic regression with mixed effects) capable of detecting lameness in dairy cows with ≈80% sensitivity. The primary practical relevance, in our opinion, lies in the systematization of the main risk variables, encouraging farmers and veterinarians to closely monitor changes in these factors to prevent the development of lameness. Our findings also lay the groundwork for the design of computer-assisted decision support systems for automated surveillance and intervention management in the dairy industry.

Supplementary Materials

The following supporting information can be downloaded at https://www.mdpi.com/article/10.3390/ani13233681/s1: Table S1. Calculated coefficients for linear regression model; Table S2. Calculated coefficients for logistic regression model I; Table S3. Calculated coefficients for logistic regression model III; Table S4. Calculated coefficients for logistic regression model with mixed effects; Table S5. Calculated coefficients for logistic regression model V.

Author Contributions

Conceptualization K.E.M., K.F.S., M.G.D. and V.B.; data curation, A.I.L., A.C., K.F.S., F.Q. and V.B.; formal analysis, A.I.L., A.P., M.K., M.G.D., K.E.M. and V.B.; investigation, A.C.; methodology, A.I.L., A.P., K.F.S., M.K., M.G.D., K.E.M. and V.B.; project administration, A.I.L., M.G.D., K.E.M., M.G.D. and V.B.; visualization, A.I.L., A.P. and V.B.; writing, A.I.L., A.P., M.G.D. and V.B.; funding acquisition, K.F.S., K.E.M., M.G.D. and V.B.; resources, K.F.S., K.E.M. and M.G.D.; supervision, M.G.D., K.E.M. and V.B.; validation, A.I.L., K.E.M., K.F.S., M.K. and V.B.; writing—review and editing, A.I.L., M.K., M.G.D., K.E.M. and V.B.; software programming, A.I.L., A.P., M.K. and V.B. All authors have read and agreed to the published version of the manuscript.

Funding

This study was funded by the BMEL (The project was supported by funds of the Federal Ministry of Food and Agriculture (BMEL) based on a decision of the Parliament of the Federal Republic of Germany via the Federal Office for Agriculture and Food (BLE) under the innovation support programme. The publication of this article was funded by Freie Universität Berlin.

Institutional Review Board Statement

Locomotion scoring was observational and noninvasive and occurred under a normal production condition on a farm during a veterinarian visit, and thus, no ethics commission statement was required.

Informed Consent Statement

Informed consent was obtained from all farms involved in the study.

Data Availability Statement

The raw data can be obtained upon a reasonable request from the consortium participating in KlauenFitnet 1.0 and 2.0.

Conflicts of Interest

The authors declare no conflict of interest. The funding agencies had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results. LKV Bayern e.V. had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

References

  1. Archer, S.; Bell, N.; Huxley, J. Lameness in UK dairy cows: A review of the current status. Practice 2010, 32, 492–504. [Google Scholar] [CrossRef]
  2. Olechnowicz, J.; Jaskowski, J.M. Behaviour of lame cows: A review. Vet. Med. 2011, 56, 581–588. [Google Scholar] [CrossRef]
  3. Sprecher DE, A.; Hostetler, D.E.; Kaneene, J.B. A lameness scoring system that uses posture and gait to predict dairy cattle reproductive performance. Theriogenology 1997, 47, 1179–1187. [Google Scholar] [CrossRef] [PubMed]
  4. Oehm, A.W.; Knubben-Schweizer, G.; Rieger, A.; Stoll, A.; Hartnack, S. A systematic review and meta-analyses of risk factors associated with lameness in dairy cows. Bmc Vet. Res. 2019, 15, 1–14. [Google Scholar] [CrossRef] [PubMed]
  5. Mandel, R.; Harazy, H.; Gygax, L.; Nicol, C.J.; Ben-David, A.; Whay, H.R.; Klement, E. Detection of lameness in dairy cows using a grooming device. J. Dairy Sci. 2018, 101, 1511–1517. [Google Scholar] [CrossRef] [PubMed]
  6. Thomsen, P.T.; Shearer, J.K.; Houe, H. Prevalence of lameness in dairy cows. Vet. J. 2023, 295, 105975. [Google Scholar] [CrossRef] [PubMed]
  7. Rilanto, T.; Reimus, K.; Orro, T.; Emanuelson, U.; Viltrop, A.; Mõtus, K. Culling reasons and risk factors in estonian dairy cows. BMC Vet. Res. 2020, 16, 1–16. [Google Scholar] [CrossRef]
  8. Schlageter-Tello, A.; Bokkers, E.A.M.; Koerkamp, P.W.G.G.; Van Hertem, T.; Viazzi, S.; Romanini, C.E.B.; Halachmi, I.; Bahr, C.; Berckmans, D.; Lokhorst, K. Manual and automatic locomotion scoring systems in dairy cows: A review. Prev. Vet. Med. 2014, 116, 12–25. [Google Scholar] [CrossRef]
  9. O’Leary, N.W.; Byrne, D.T.; O’Connor, A.H.; Shalloo, L. Invited review: Cattle lameness detection with accelerometers. J. Dairy Sci. 2020, 103, 3895–3911. [Google Scholar] [CrossRef]
  10. Edwards, J.L.; Tozer, P.R. Using activity and milk yield as predictors of fresh cow disorders. J. Dairy Dcience 2004, 87, 524–531. [Google Scholar] [CrossRef]
  11. Liboreiro, D.N.; Machado, K.S.; Silva, P.R.B.; Maturana, M.M.; Nishimura, T.K.; Brand, A.P.; Endres, I.; Chebel, R.C. Characterization of peripartum rumination and activity of cows diagnosed with metabolic and uterine diseases. J. Dairy Sci. 2015, 98, 6812–6827. [Google Scholar] [CrossRef] [PubMed]
  12. olano, L.; Barkema, H.; Pajor, E.; Mason, S.; LeBlanc, S.; Nash, C.; Haley, D.; Pellerin, D.; Rushen, J.; de Passillé, A.; et al. Associations between lying behavior and lameness in canadian holstein-friesian cows housed in freestall barns. J. Dairy Sci. 2016, 99, 2086–2101. [Google Scholar]
  13. Westin, R.; Vaughan, A.; de Passillé, A.M.; Devries, T.J.; Pajor, E.A.; Pellerin, D.; Siegford, J.M.; Vasseur, E.; Rushen, J. Lying times of lactating cows on dairy farms with automatic milking systems and the relation to lameness, leg lesions, and body condition score. J. Dairy Sci. 2016, 99, 551–561. [Google Scholar] [CrossRef] [PubMed]
  14. Reith, S.; Hoy, S. Behavioral signs of estrus and the potential of fully automated systems for detection of estrus in dairy cattle. Animal 2018, 12, 398–407. [Google Scholar] [CrossRef] [PubMed]
  15. Tippenhauer, C.M.; Plenio, J.L.; Madureira, A.M.L.; Cerri, R.L.A.; Heuwieser, W.; Borchardt, S. Factors associated with estrous expression and subsequent fertility in lactating dairy cows using automated activity monitoring. J. Dairy Sci. 2021, 104, 6267–6282. [Google Scholar] [CrossRef] [PubMed]
  16. Tippenhauer, C.; Plenio, J.L.; Madureira, A.; Cerri, R.; Heuwieser, W.; Borchardt, S. Timing of artificial insemination using fresh or frozen semen after automated activity monitoring of estrus in lactating dairy cows. J. Dairy Sci. 2021, 104, 3585–3595. [Google Scholar] [CrossRef] [PubMed]
  17. Alawneh, J.I.; Laven, R.A.; Stevenson, M.A. Interval between detection of lameness by locomotion scoring and treatment for lameness: A survival analysis. Vet. J. 2012, 193, 622–625. [Google Scholar] [CrossRef]
  18. Jiang, B.; Song, H.; He, D. Lameness detection of dairy cows based on a double normal background statistical model. Comput. Electron. Agric. 2019, 158, 140–149. [Google Scholar] [CrossRef]
  19. Miekley, B.; Traulsen, I.; Krieter, J. Detection of mastitis and lameness in dairy cows using wavelet analysis. Livestig. Sci. 2012, 148, 227–236. [Google Scholar] [CrossRef]
  20. Warnick, L.; Janssen, D.; Guard, C.; Gröhn, Y. The effect of lameness on milk production in dairy cows. J. Dairy Sci. 2001, 84, 1988–1997. [Google Scholar] [CrossRef]
  21. Miguel-Pacheco, G.G.; Kaler, J.; Remnant, J.; Cheyne, L.; Abbott, C.; French, A.P.; Pridmore, T.P.; Huxley, J.N. Behavioural changes in dairy cows with lameness in an automatic milking system. Appl. Anim. Behav. Sci. 2014, 150, 1–8. [Google Scholar] [CrossRef]
  22. Van Hertem, T.; Maltz, E.; Antler, A.; Romanini, C.; Viazzi, S.; Bahr, C.; Schlageter-Tello, A.; Lokhorst, C.; Berckmans, D.; Halachmi, I. Lameness detection based on multivariate continuous sensing of milk yield, rumination, and neck activity. J. Dairy Sci. 2013, 96, 4286–4298. [Google Scholar] [CrossRef] [PubMed]
  23. Miekley, B.; Traulsen, I.; Krieter, J. Principal component analysis for the early detection of mastitis and lameness in dairy cows. J. Dairy Res. 2013, 80, 335–343. [Google Scholar] [CrossRef] [PubMed]
  24. Van Hertem, T.; Bahr, C.; Tello, A.S.; Viazzi, S.; Steensels, M.; Romanini, C.; Lokhorst, C.; Maltz, E.; Halachmi, I.; Berckmans, D. Lameness detection in dairy cattle: Single predictor v. multivariate analysis of image-based posture processing and behaviour and performance sensing. Animal 2016, 10, 1525–1532. [Google Scholar] [CrossRef] [PubMed]
  25. Rutten, C.J.; Velthuis, A.; Steeneveld, W.; Hogeveen, H. Invited review: Sensors to support health management on dairy farms. J. Dairy Sci. 2013, 96, 1928–1952. [Google Scholar] [CrossRef]
  26. Sundrum, A.; Anderssen, R.; Postler, G. Animal Needs Index 200/1994—A Manual for the Assessment of Housing Systems; Köllen Druck und Verlag GmbH: Aachen, Germany, 1994. [Google Scholar]
  27. Robert, B.; White, B.J.; Renter, D.G.; Larson, R.L. Evaluation of three-dimensional accelerometers to monitor and classify behavior patterns in cattle. Comput. Electron. Agric. 2009, 67, 80–84. [Google Scholar] [CrossRef]
  28. Szura, G.; Schäfers, S.; von Soosten, D.; Meyer, U.; Klüß, J.; Breves, G.; Dänicke, S.; Rehage, J.; Ruda, L. Gain and loss of subcutaneous and abdominal adipose tissue depot mass of german holstein dairy cows with different body conditions during the transition period. J. Dairy Sci. 2020, 103, 12015–12032. [Google Scholar] [CrossRef]
  29. Van Rossum, G.; Drake, F.L. Python 3 Reference Manual; CreateSpace: Valley, CA, USA, 2009. [Google Scholar]
  30. R Core Team. R: A Language and Environment for Statistical Computing; R Foundation for Statistical Computing: Vienna, Austria, 2020. [Google Scholar]
  31. Lüdecke, D. ggeffects: Tidy data frames of marginal effects from regression models. J. Open Source Softw. 2018, 3, 772. [Google Scholar] [CrossRef]
  32. Randall, L.; Green, M.; Green, L.E.; Chagunda, M.; Mason, C.; Archer, S.; Huxley, J. The contribution of previous lameness events and body condition score to the occurrence of lameness in dairy herds: A study of 2 herds. J. Dairy Sci. 2018, 101, 1311–1324. [Google Scholar] [CrossRef]
  33. Heinicke, J.; Ibscher, S.; Belik, V.; Amon, T. Effects of the Accumulation of Heat Load Duration on the Activity Behaviour of Lactating Dairy Cows. In Proceedings of the New Engineering Concepts for Valued Agriculture. European Conference of Agricultural Engineering EurAgEng 2018, Wageningen, The Netherlands, 8–12 July 2018; pp. 741–748. [Google Scholar]
  34. Heinicke, J.; Ibscher, S.; Belik, V.; Amon, T. Cow individual activity response to the accumulation of heat load duration. J. Therm. Biol. 2019, 82, 23–32. [Google Scholar] [CrossRef]
  35. Will, M.K.; Büttner, K.; Kaufholz, T.; Müller-Graf, C.; Selhorst, T.; Krieter, J. Accuracy of a real-time location system in static positions under practical conditions: Prospects to track group-housed sows. Comput. Electron. Agric. 2017, 142, 473–484. [Google Scholar] [CrossRef]
  36. Rocha, L.E.; Terenius, O.; Veissier, I.; Meunier, B.; Nielsen, P.P. Persistence of sociality in group dynamics of dairy cattle. Appl. Anim. Behav. Sci. 2020, 223, 104921. [Google Scholar] [CrossRef]
  37. Eriksson, H.K.; Daros, R.R.; von Keyserlingk, M.A.; Weary, D.M. Effects of case definition and assessment frequency on lameness incidence estimates. J. Dairy Sci. 2020, 103, 638–648. [Google Scholar] [CrossRef] [PubMed]
  38. Andresen, N.; Wöllhaf, M.; Hohlbaum, K.; Lewejohann, L.; Hellwich, O.; Thöne-Reineke, C.; Belik, V. Towards a fully automated surveillance of well-being status in laboratory mice using deep learning: Starting with facial expression analysis. PLoS ONE 2020, 15, e0228059. [Google Scholar] [CrossRef]
  39. Jarchi, D.; Kaler, J.; Sanei, S. Lameness detection in cows using hierarchical deep learning and synchrosqueezed wavelet transform. IEEE Sens. J. 2021, 21, 9349–9358. [Google Scholar] [CrossRef]
  40. Broomé, S.; Gleerup, K.B.; Andersen, P.H.; Kjellstrom, H. Dynamics are important for the recognition of equine pain in video. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 12667–12676. [Google Scholar]
  41. Postnikov, E.B.; Esmedljaeva, D.A.; Lavrova, A.I. A catboost machine learning for prognosis of pathogen’s drug resistance in pulmonary tuberculosis. In Proceedings of the 2020 IEEE 2nd Global Conference on Life Sciences and Technologies (LifeTech), Kyoto, Japan, 10–12 March 2020; pp. 86–87. [Google Scholar]
Figure 1. Daily average number of activity impulses per hour (left), average lying bout duration (min, middle), and daily milk yield in kg (right)—all three indicators averaged over 3 days before locomotion scoring for lame (locomotion score 3 ) and nonlame (locomotion score < 3 ) cows, categorized by cow parity. Red and blue colors represent nonlame (0) and lame (1) cows, respectively.
Figure 1. Daily average number of activity impulses per hour (left), average lying bout duration (min, middle), and daily milk yield in kg (right)—all three indicators averaged over 3 days before locomotion scoring for lame (locomotion score 3 ) and nonlame (locomotion score < 3 ) cows, categorized by cow parity. Red and blue colors represent nonlame (0) and lame (1) cows, respectively.
Animals 13 03681 g001
Figure 2. Averaged daily number of activity impulses per hour (left), lying bout duration (middle), and milk yield (right) over 3 days preceding locomotion scoring. Data presented for cows with different lameness statuses (lame: locomotion score 3 ; nonlame: locomotion score < 3 ), plotted against days in milk (DIM).
Figure 2. Averaged daily number of activity impulses per hour (left), lying bout duration (middle), and milk yield (right) over 3 days preceding locomotion scoring. Data presented for cows with different lameness statuses (lame: locomotion score 3 ; nonlame: locomotion score < 3 ), plotted against days in milk (DIM).
Animals 13 03681 g002
Figure 3. Numbers of lame and nonlame cows per observation and over time. (left) The cases of lameness scoring per week represented by a histogram. Nonlame (0) and lame (1) statuses are shown by color (red and blue, respectively). (right) Distribution of cows categorized as persistently lame, persistently nonlame, and mixed, based on locomotion scoring results from six farms. Cows with alternating lame/nonlame states were classified as mixed. The colors green, red, and blue correspond to mixed, persistently lame, and persistently nonlame cows, respectively.
Figure 3. Numbers of lame and nonlame cows per observation and over time. (left) The cases of lameness scoring per week represented by a histogram. Nonlame (0) and lame (1) statuses are shown by color (red and blue, respectively). (right) Distribution of cows categorized as persistently lame, persistently nonlame, and mixed, based on locomotion scoring results from six farms. Cows with alternating lame/nonlame states were classified as mixed. The colors green, red, and blue correspond to mixed, persistently lame, and persistently nonlame cows, respectively.
Animals 13 03681 g003
Figure 4. Probability of lameness in relation to the yearly seasons (A) and probability of lameness in relation to both the yearly seasons and the parity class (lact) (B).
Figure 4. Probability of lameness in relation to the yearly seasons (A) and probability of lameness in relation to both the yearly seasons and the parity class (lact) (B).
Animals 13 03681 g004
Table 1. Variables used in the statistical model (1).
Table 1. Variables used in the statistical model (1).
VariableMeaning
mean_impulsesFixed effect referring to the individual cow’s activity (number of impulses) averaged over 3 days preceding the locomotion scoring
mean_lyiFixed effect referring to the individual cow’s activity (lying duration)averaged over 3 days preceding the locomotion scoring
mean_yieldFixed effect referring to the individual cow’s developments of daily milk yield averaged over 3 days preceding the locomotion scoring
lactFixed effect of lactation number (parity) considered as a continuous variable
DIMFixed effects of the stage of lactation (days in milk) considered as a continuous variable
seasonFixed effect of season which can take values: Spring, Summer, Fall, and Winter
c o w i Random effect (random intercept) of the i-th animal ( i = [ 1 2757 ] )
f a r m j Farm as random effect j = [ 1 6 ]
ε Random residual
Table 2. Results for the logistic regression model with random effects (on the train dataset), using lameness status as the dependent variable. Predictor variables are explained in Table 1 corresponding to the model (1).
Table 2. Results for the logistic regression model with random effects (on the train dataset), using lameness status as the dependent variable. Predictor variables are explained in Table 1 corresponding to the model (1).
Fixed EffectsEstimateStd. ErrorOdds RatiosOR CIOR CIp-Value
LowerUpper
Intercept−1.1447.223 ×   10 1 0.3200.0801.3100.113
mean_impulses−2.011 ×   10 3 1.090 ×   10 3 1.0010.9951.0020.065.
mean_lyi−5.070 ×   10 3 2.790 ×   10 3 0.9900.9901.0020.069.
lact6.350 ×   10 1 5.570 ×   10 2 1.8901.6902.100<2 ×   10 16 ***
DIM−1.480 ×   10 3 8.670 ×   10 4 1.0000.9961.0030.089.
mean_yield1.150 ×   10 3 3.620 ×   10 3 1.0010.9901.0100.751
season_Spring−6.330 ×   10 1 3.070 ×   10 1 0.5300.2900.9700.039*
season_Summer−9.560 ×   10 1 1.6800.3800.0101.0290.569
season_Fall−1.2700.3503.930 ×   10 1 0.1300.6100.001**
mean_impulses:season_Spring2.640 ×   10 4 1.570 ×   10 3 1.0010.9971.0030.867
mean_impulses:season_Summer−2.670 ×   10 3 4.940 ×   10 3 0.9930.9841.0030.589.
mean_impulses:season_Fall5.210 ×   10 3 1.830 ×   10 3 1.0020.9991.0010.004**
mean_lyi:DIM1.840 ×   10 5 8.958 ×   10 6 1.0011.0021.0100.070.
mean_lyi:season_Spring1.700 ×   10 3 2.590 ×   10 3 1.0021.0021.0100.513
mean_lyi:season_Summer7.440 ×   10 3 1.360 ×   10 2 1.0100.9801.0300.584
mean_lyi:season_Fall6.040 ×   10 3 3.180 ×   10 3 1.0101.0021.0100.057.
lact:DIM−8.330 ×   10 4 2.110 ×   10 4 1.0020.9981.0040.066.
lact:season_Spring1.340 ×   10 1 4.520 ×   10 2 1.1401.0501.2500.003**
lact:season_Summer−5.760 ×   10 2 1.700 ×   10 1 0.9400.6801.3200.735
lact:season_Fall−1.080 ×   10 2 5.300 ×   10 2 0.9900.8901.1000.839
mean_yield:season_Spring2.720 ×   10 3 4.790 ×   10 3 1.0020.9901.0100.569
mean_yield:season_Summer4.420 ×   10 2 2.760 ×   10 2 1.0500.9901.1000.109
mean_yield:season_Fall7.630 ×   10 3 6.690 ×   10 3 1.0100.9991.0200.254
Random effects
GroupsNamesVarianceStd. Error
cow:farmIntercept2.321.52
farmIntercept2.581.61
Significance codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Lavrova, A.I.; Choucair, A.; Palmini, A.; Stock, K.F.; Kammer, M.; Querengässer, F.; Doherr, M.G.; Müller, K.E.; Belik, V. Leveraging Accelerometer Data for Lameness Detection in Dairy Cows: A Longitudinal Study of Six Farms in Germany. Animals 2023, 13, 3681. https://doi.org/10.3390/ani13233681

AMA Style

Lavrova AI, Choucair A, Palmini A, Stock KF, Kammer M, Querengässer F, Doherr MG, Müller KE, Belik V. Leveraging Accelerometer Data for Lameness Detection in Dairy Cows: A Longitudinal Study of Six Farms in Germany. Animals. 2023; 13(23):3681. https://doi.org/10.3390/ani13233681

Chicago/Turabian Style

Lavrova, Anastasia I., Alexander Choucair, Andrea Palmini, Kathrin F. Stock, Martin Kammer, Friederike Querengässer, Marcus G. Doherr, Kerstin E. Müller, and Vitaly Belik. 2023. "Leveraging Accelerometer Data for Lameness Detection in Dairy Cows: A Longitudinal Study of Six Farms in Germany" Animals 13, no. 23: 3681. https://doi.org/10.3390/ani13233681

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop