Prediction of health disorders in dairy cows monitored with collar based on Binary logistic analysis

ABSTRACT The objective of this study was to analyze data on physical activity and rumination time monitored via collars at the farm coupled with milk yield recorded by the rotary milking system to predict cows based on several disorders using the binary Logistic regression conducted with R software. Data for metritis (n=60), mastitis (n=98), lameness (n=35), and digestive disorders (n=52) were collected from 1,618 healthy cows used to construct the prediction model. To verify the feasibility and adaptability of the proposed method, we analyzed data of cows in the same herd (herd 1) not used to construct the model, and cows in another herd (herd 2) with data recorded by the same type of automated system, and led to detection of 75.0%, 64.2%, 74.2%, and 76.9% animals in herd 1 correctly predicted to suffer from metritis, mastitis, lameness, and digestive disorders, respectively. For cows in herd 2, 66.6%, 58.8%, 80.7%, and 71.4% were correctly predicted for metritis, mastitis, lameness, and digestive disorders, respectively. Compared with traditional clinical diagnoses by farm personnel, the algorithm developed allowed for earlier prediction of cows with a disorder.


INTRODUCTION
Automatic monitoring has been applied across many intensive dairy farm systems worldwide, where large amounts of data on rumination time, physical activity, and feeding behavior, among others, have been collected.These data are often coupled with milk yield-related variables monitored by automated milking systems.Some common disorders of dairy cows in intensive farms, such as mastitis, metritis, subclinical ketosis, lameness, et al., are detrimental to cow well-being and farm profitability because they cause losses in milk production (Edwards andTozer, 2004, Stangaferro et al., 2016a), increase the risk of culling and death (King et al., 2018, Seifiet et al., 2011), increase treatment costs (Stangaferro 2016b), and impair reproductive performance (Ribeiro, 2013, Vercouteren et al., 2015).Health disorders can greatly affect the welfare of dairy cows, for the affected cows often experience severe pains (Stojkov, 2015).However, due to the farmers' awareness of early prediction for health disorders and the measures of detection, most subclinical diseases go undiagnosed, making treatment difficult and prolonging any negative effects on herd health and productivity.Thus, data preceding diagnoses would be inherently more useful for earlier diagnoses and intervention if they can predict risk or detect disease more efficiently than the observation of clinical signs.Many studies conducted in several countries have reported that commercial dairy farms have adopted precision dairy technologies to monitor the prevalence and risk factors involved with health disorders (King et al., 2018, Overton et al., 2017, Ruegg, 2017, Sjöström et al., 2018).Furthermore, some potential indicators to identify cows with several common health problems have been discussed (Rutten et al., 2013) including milk and milk yield-related factors, and physical activity and rumination time.Daily milk production and physical activity data followed obvious patterns before 21 days and up to 7 days after diagnosis of several health disorders, such as mastitis, metritis, subclinical ketosis, et al. (Gröhn et al., 1998).Rumination time has been shown to decline with the onset of many health disorders such as mastitis (Fogsgaard et al., 2015, Soriani et al., 2012), metritis and pneumonia, metabolic disorders (Stangaferro et al., 2016a, 2016b, 2016c), subclinical ketosis (SCK), and retained placenta (Liboreiro et al., 2015).With the increasing demand for health and welfare monitoring in modern dairy farming, observations of physiologic and behavioral changes should be considered thoroughly when monitoring for health disorders.
The main approach for predicting and/or detecting disorders of cows in intensive dairy farms in Northeast China still relies on traditional approaches, i.e., the manual observation by herd veterinarians and farm staff.Most of these farms have adopted precision dairy technologies mainly to identify cow estrusrelated events, while most functions of these technologies are not utilized at all.To our best knowledge, there has been no attempt to use data of physical activity and rumination time recorded by precision dairy technologies to monitor health in these intensive dairy farms in Northeast China, neither the early warning of dairy cows' health disorders by integrating these big data generated everyday by the automated monitoring system.
Our general hypothesis was that naturally occurring health disorders of cows in two herds monitored via collar and milked by rotary milking system were associated with physical activity, rumination time and milk yield.To address this hypothesis, the objective was to construct a prediction model using binary logistic regression of metritis, mastitis, lameness (digital dermatitis, interdigital dermatitis, sole ulcers, and abscesses), and digestive disorders (ruminal indigestion, forestomach retardation, and ruminal flatulence) data as categorical variables to determine which kind of disorder a cow was most likely suffering from.The prediction model was tested and verified at 2 commercial farms.

MATERIALS AND METHODS
This research was part of a large study aimed at early prediction and detection of health disorders of cows in commercial herds milked with rotary milking system and worn collar monitoring rumination in the intensive dairy farms in Northeast China.Holstein cows with the days in milk (DIM) in the whole lactation were included.
The original data were collected from two commercial farms near each other in the Heilongjiang province in Northeast China from January 2020 to March 2021.The two herds had a total of 3,678 Holstein cows, with herd 1 containing a total of 2,674 cows and herd 2 a total of 1,004 cows.Heilongjiang province is at longitude 121.11 and 135.05, latitude 43.26 and 53.33, with cold temperate zone and temperate continental monsoon climate, and the annual average temperature between -5 °C to 5 °C.These two farms are the practice base of Heilongjiang Bayi Agricultural University.Each evaluated group was housed in uniform pens with identical characteristics: enclosed barns on concrete solid floor with sawdust with space for 50 to 136 cows by providing the same cubicles, feeding and water area in each pen, feed bunk and access to an exercise yard for 1 h/d except in winter.Barns were naturally ventilated and with spraying used for control of heat stress in summer with an interval every 20 m.Cows were fed a total mixed ration (TMR) twice daily (0500 h and 1300 h) with ad libitum access to fresh water, milked three times daily (0500h, 1300h and 2100h).Before calving, cows had ad libitum access to a prepartum TMR containing a dietary forage-to-concentrate ratio of 78:22 on a dry matter (DM) basis.After calving, the TMR had a 60:40 forage-to-concentrate ratio on a DM basis.Overall, management routines and feeding practices were similar between the analyzed herds.
From 1 DIM to the end of lactation, primiparous and multiparous cows were fed the same TMR.Except when a warning event was given by the automated monitoring system adopted by the farms, cows were checked daily for signs of disease or injury by the farm staff, as well as reproductive events and survival, and health assessments were routinely performed during the transition period.All cases of health problems, diagnoses and treatments were recorded by the farm manager and the herd veterinarian according to standard operating procedures of the farm.During data editing, the following criteria were used to remove records from the final data set: parameters monitored by the precision dairy technologies without data; cows with missing data 21 days before time of diagnosis in a group; and cows that were moved between herds more than twice within a lactation.Milk yield, physical activity and rumination time of healthy and sick cows were analyzed.These variables would begin to deviate from normal at 3 days to 7 days or even more before diagnosis, and the response could vary based on the type of disorder.The null hypothesis was that such variables would not deviate before diagnosis and thus, not aid in detection.To test the hypothesis of herd 1, we first used binary logistic analysis to develop a model using individual cow data with health disorders collected 7 days (d-7) or 3 days (d-3) before diagnosis to 1 day before (d-1) diagnosis.
Veterinarians at the two farms diagnosed disorders based on a set of standard diagnostic procedures.Cases of metritis were identified by foul-smelling vulvar discharge and a rectal temperature ≥39.5°C in cows at 1d, 3d, 5d, 7d, 10d, 14d, 21d after calving, examined by the veterinarians of the farms.An examination of the udder and milk for clinical signs of mastitis (i.e., hard quarter, heat or swelling, clots in milk, flakes, clots, or lumps, or clear/yellow milk) was performed every 3 d after calving until d +21, then checked every 7 d throughout the whole lactation, here, due to no milk harvest for the cows at the transition period, hence, animals in this period were not involved in the analysis.Cases of lameness including digital dermatitis, interdigital dermatitis, sole ulcers, and abscesses, were diagnosed when mechanical or infectious lesions were detected by veterinarians or during routine half-month hoof trimming and treated with corrective hoof trims.For digestive disorders, scant manure, and lack of appetite with ruminal and intestinal stasis, including ruminal indigestion, forestomach retardation, and ruminal flatulence.A healthy cow was one that did not have an occurrence of any disorder studied during the experimental period, and we did not consider the cows that were sick more than once during lactation.For the assessment of herd 1, a total of 1,618 healthy cows and cows with metritis (n=60), mastitis (n=98), lameness (n=35) and digestive disorders (n=52) were analyzed by the proposed prediction model.For the assessment of herd 2, a total of 819 healthy cows with metritis (n=30), mastitis (n=68), lameness (n=52) and digestive disorders (n=53) were enrolled.
Data on physical activity recorded with the HR-Tag monitoring system (SCR Engineers Ltd., Netanya, Israel) and rumination time recorded with the neck collar (Nedap Livestock Management, Groenlo, Netherlands) were averaged and stored at 2-h intervals up to 24 h.Total rumination minutes per day were used for statistical analysis unless otherwise stated.The Arq. Bras.Med.Vet.Zootec., v.75, n.3, p.467-475, 2023 automatic monitoring system records daily activity from a pedometer attached to a leg band on the hind leg of the cow.Activity was recorded as a unitless measure of upward vertical head and neck movements such as walking and mounting while excluding downward vertical and horizontal movements such as feeding and recorded every 2 h.Rumination time of each dairy cow was also recorded every 2 h.Cows at each farm were milked three times a day (0500 h, 1300 h and 2100 h) via rotary milking system (FreeFlow, SCR Engineers Ltd., Netanya, Israel) with 64 or 72 individuals.All data were transferred automatically during each milking to the herd management software (DataFlow, SCR Engineers Ltd.) and daily milk yield was calculated as the sum of all milk collected per cow per day.
Cows were first grouped into various health disorder categories, with the day of diagnosis and treatment of each disorder considered as d 0, and the data for every variable from d-7 to d-1 was considered in the model: total activity, milk yield and rumination time per day.These were used for statistical analysis unless otherwise stated.
Cows were included in an illness category only if they were affected with a particular disorder.Cows in the "healthy" category did not suffer from any disorders during the experiment.
In this study, we adopted the widely applied binary logistic regression for prediction and detection of onset of dairy cows' disorders (Gianola et al., 2011).Prior to analyses, all data were screened for normality, and the predictor variable of each health disorder and the corresponding health group was conducted significance test, when there was significant difference between the health group and control group, the predicting model was constructed to recognize the cows with health disorders from all the analyzed cows by binary logistic carried out with the program written by software R 4.1.2.
We assessed the performance of each prediction model by their sensitivity, specificity, accuracy, precision, F1-score, and area under the receiver operating characteristic (ROC) curve (AUC) value (95% confidence interval) was defined as follows: True positives (the number of cows with actual health disorder, predicted as with disorder), false negatives (the number of cows with actual health disorder, predicted as healthy), true negatives (the number of healthy cows, predicted as healthy), and false positives (the number of healthy cows, predicted as with health disorder) were denoted as TP, FN, TN, and FP, respectively.

RESULTS AND DISCUSSION
The Chi-square test and t-test function in R software were adopted to perform significant tests for categorical outcomes and continuous variables between each health disorder group and the corresponding healthy group.The time from 7 days before diagnosis to the day of diagnosis is recorded as d-7, d-6, d-5, d-4, d-3, d-2, d-1, and d0, respectively.The t-test showed that activity, rumination time, and milk production in more than four days of these 7 days was significantly (P<0.001)lower or higher than that of d0.To avoid overfitting caused by too many variables, new features related to milk yield, activity and rumination time were constructed as the independent variable of the regression model.
Lameness was a chronic disorder, rumination time and milk yield did not present clear variance, while activity was definitely below the control group on d-4 to d0.
Milk yield on d-7 to d-1 was not significantly less or more than that on d0, hence variable related to milk yield was not involved in the prediction model.Activity on d-7, d-6 and d-5 increased to average of 552 ±102 (unitless), and was positively related to lameness, which was denoted as a4 3 , and activity on d-4 and d-3 negatively correlated with this disorder and the average milk yield of these two days denoted as a4 2 , likewise, the average milk yield on d-2 denoted as a4 -2 and a4 -1 on d-1.The average of rumination time on d-3, d-2 was also negatively correlated to lameness and average of these two days denoted as r4 2 , denoted as r4 -1 on d-1.Likewise, the data of the corresponding health cows was denoted as the ones of disorders.These six variables were taken as independents to construct the logistic prediction model for lameness as follows Where, standard deviations of intercept, m4 -2 , a4 - 1 , r4 -3 , r4 -2 , r4-1 were 0.131, 0.027, 0.140, 0.005, 0.0004, 0.034, 0.0001, and 0.056, respectively.
Performance for four prediction models was summarized in Table 1.Specificity of four models were more than 95%, with the highest of 99.19 for cows with metritis.While the specificity was relatively lower, indicating that more than 25% of cows with disorders were not successfully predicted.Researchers have previously examined associations between changes in rumination, activity, and milk yield data with health disorders (Andrés et al., 2018, Fogsgaard et al., 2015, Hertem et al., 2013, King et al., 2017, 2018, Schirmann et al., 2016, Tsai et al., 2021) and detection of clinical disease, with a focus on post-partum subclinical ketosis (Rodriguez et al., 2018, Raboisson et al., 2014), lameness and hoof lesions (Kamphuis et al., 2013, Weigele et al., 2018), mastitis (Stangaferro et al., 2016b, Zhang et al., 2020), metritis, hyperketonemia and hypocalcemia (Ricardo 2020, Stangaferro et al., 2016c, Tsai et al., 2021).Kamphuis et al. (2013) proposed applying additive logistic regression to data derived from sensors monitoring behavioral and physiological characteristics of dairy cows for lameness detection.Seven variables of milk yield, liveweight and activity were treated as significant factors without considering rumination time.Stangaferro et al. 2016aStangaferro et al. , 2016bStangaferro et al. , 2016c) used rumination and activity monitoring for identification of dairy cows with health disorders including metabolic and digestive disorders, metritis, mastitis caused by E. coli, with sick cows chosen from d-21 to 80 d in milk.In the present study, however, all health disorders recorded for cows at any time during the whole lactation were considered.King et al. (2017) explored longitudinal changes in behavior and production data before diagnosis of health disorders in cows milked with an automated system.In that study, data of only 57 dairy cows with SCK, metritis, lameness, displaced abomasum, and pneumonia were analyzed, and the baseline time up to d-14, daily rumination time, body weight, milk temperature, activity were focused on while no prediction was mentioned.

Arq
A decrease in daily walking activity and rumination time, along with a decrease in milk yield, might be used as an early warning to identify potential disorders in dairy cattle.Several studies have created and validated such prediction models (Kandeel et al., 2019, Wisnieski et al., 2019, Xu et al., 2019, 2020).As early as 2004, Edwards and Tozer (2004) proposed that cows with metabolic, and general digestive disorders, could potentially be identified 5 to 6 d earlier than clinical diagnoses based on changes in daily walking.Early identification of cows at risk of developing those disorders could allow for timely intervention, potentially decreasing the negative effects of this disease.As mentioned above, there is much evidence indicating that health disorders in dairy cattle can be identified and predicted through observation of milk yield, physical activity, and changes in rumination time.In contrast, there is a severe paucity of data on the use of behavior, rumination time and productivity data for early detection of health issues in intensive dairy farms in Northeast China.The fact that these farms have widely adopted the use of automated systems underscores the potential benefit of using the data as a predictive tool.Although the present results offer a promising outlook, translating the results into practice based on the current sensor-based variables that only encompassed simple proportional differences also highlighted that prediction success was somewhat modest for implementation in larger intensified dairy farms.By developing variables that better describe changes in sensor data patterns from a greater number of factors affecting health, we believe that future research may improve detection performance with the aid of artificial intelligence.This also would extend to prediction of health disorders in calves that are being monitored by automatic systems.

CONCLUSIONS
In modern intensive dairy farms, developing valid, reliable, and practical automated disease detection systems has always been a central issue in veterinary practice.Automated rumination and activity monitoring was effective for identifying cows afflicted with several health disorders.Overall, according to these results, milk yield, physical activity and rumination time can be used early or automated identification of several disorders.Thus, using these factors to develop software for detecting disorders may be of critical importance for improving animal welfare and increasing the economic benefits at the farm.Future research should focus on applying artificial intelligence to develop algorithms to diagnose disorders in lactating cows and calves more accurately and precisely.SORIANI, N.; TREVISI, E.; CALAMARI, L. Relationships between rumination time, metabolic conditions, and health status in dairy cows during the transition period.J. Anim. Sci., v.90, p.4544-4554, 2012 Comput. Electr. Agric., v.178, p.105754, 2020.