1. Introduction
Hypocalcemia, also known as parturient paresis or milk fever, typically occurs in cattle during calving at the start of lactation. This disease is characterized by muscle weakness, paralysis, recumbency, and impaired function of the central nervous system [
1]. If the animal is not treated accordingly, it may lead to muscle damage or even death [
2,
3]. To confirm the clinical diagnosis based on physical examination, the serum or plasma calcium concentration is frequently analyzed. The total calcium concentration (tCa) in the serum is typically measured photometrically; the ionized calcium (iCa) can be measured on site using an ion-selective electrode as a point-of-care test. Earlier studies suggested that the proportion of iCa is 50% of tCa [
4], but this proportion is decreased around parturition [
5].
Over the years, extensive research has been carried out on the pathogenesis and treatment of periparturient hypocalcemia. Depending on the literature, the prevalence of clinical hypocalcemia lies between 5% [
6] and up to 10% especially on high-producing farms [
7,
8]. There are several factors that influence the occurrence of hypocalcemia; one factor is high milk yield [
9]. A cow that produces around 45 kg of milk per day on average needs an additional 56 g/d of Ca [
10]. A non-lactating cow requires approximately 21 g of calcium per day to maintain normal body functions [
10]. Furthermore, with increasing lactation number, the risk of hypocalcemia increases substantially [
9]. The study from [
6] showed a significant decrease in serum calcium concentrations as the number of lactations increased from 1st to 4th lactation. According to DeGaris and Lean [
8], this reflects the effects of age and results in a 9% increased risk of hypocalcemia per lactation. Generally, dairy breeds are more susceptible than beef breeds [
8]. Another factor for an increased risk of hypocalcemia is over-conditioned cows (body condition score > 3.5) [
9]. In addition, various other factors, such as the length of the dry period, may additionally influence hypocalcemia risk [
11].
The digestive physiology of ruminants has been extensively researched in recent decades, as forestomach motility can be used as an overall indicator of cattle health [
12]. Reticuloruminal motility (RRCR) refers to the complete sequence of coordinated contractions in the reticulum and rumen, consisting of the A (primary) and B (secondary) cycles [
13,
14]. The A cycle represents the biphasic reticular contraction followed by ruminal contractions that mix and move digesta between the reticulum and rumen, while the B cycle involves additional ruminal contractions responsible mainly for eructation (gas expulsion). During rumination, extrareticular contractions occur, complementing these rhythmic cycles [
13,
14]. In general, forestomach motility, as with all muscle activity, depends on serum calcium concentration. Low calcium concentrations, which are common after parturition, have negative effects on the rumen motility and rumination time [
15]. The frequency and amplitude of RRCR increase transiently during feeding and decrease during rumination and lying [
14]. A rumination cycle lasts about one minute [
13]. After swallowing the bolus, it takes a few seconds before a new rumination cycle begins [
13]. On average, healthy dairy cows spend around seven hours a day ruminating [
2], and four and a half hours (2.4–8.5 h) eating [
16]. Cattle that have constant access to feed spend more time ruminating and less time eating [
16].
In general, forestomach motility, as with all muscle activity, depends on serum calcium concentration [
15]. Low calcium concentrations, which are common after parturition, have negative effects on the rumen motility and rumination time [
15]. There are commercially available devices (In-Cow and On-Cow sensors) that can monitor the rumination time of individual animals. One device for measuring reticuloruminal motility is a reticuloruminal bolus, which constantly measures motility and temperature inside the reticulorumen.
First, this study aimed to measure rumen motility and temperature by reticuloruminal bolus before, during, and after parturition and to associate the measurements with the peripartal serum concentration of total and ionized calcium. Second, the study aimed to assess the feasibility of prepartum rumen measurements to predict the hypocalcemia risk at parturition on the individual cow level. This approach addresses the current limitation that existing cow-level prediction methods based on laboratory biomarkers (total serum calcium, magnesium, phosphorus, non-esterified fatty acids, β-hydroxybutyrate, alkaline phosphatase) tend to offer only low to moderate predictive accuracy [
17,
18,
19].
The following hypotheses were proposed:
The reticuloruminal contraction and reticoluruminal temperature patterns before calving are associated with the periparturient calcium concentration.
Pre-calving reticuloruminal motility and temperature measurement is feasible to predict the risk of periparturient hypocalcemia at the individual cow level.
The deep learning model, which uses reticuloruminal sensor data as features, can reliably predict the hypocalcemia risk for the data of this study without having been trained on them.
2. Materials and Methods
The study was conducted at the Agricultural Research and Education Center (AREC) Raumberg-Gumpenstein (Irdning-Donnersbachtal, Austria) between November 2022 and March 2024. During this study period, 89 calvings of 69 cattle were recorded (22 calvings of first calf heifers, 47 calvings of first to third lactation, and 20 of fourth to tenth lactation cows). The average age of the cows at calving was 4.4 ± 2.3 years, the youngest heifer was 1.9 and the oldest cow was 11.5 years old. The breed distribution was 20 Fleckvieh (Simmental), 39 Holstein-Friesian, and 10 New Zealand Holstein-Friesian cows. All cows were housed in a free stall barn with separate feeding troughs and an automated milking system. The barn is equipped with a curtain system, ventilation, and sprinklers to allow temperature adjustment. Until 14 days before the expected calving date, the cows were fed twice daily with a dry cow diet consisting of a partially mixed ration. After that point, the cows were given a lactation diet ad libitum.
The farm administers a vitamin D3 injection to all cows entering their third lactation before calving, which prevents any clinical cases of milk fever. However, during the study, this routine preventive measure was discontinued.
The cows were fed an additional amount of 1 kg/d of a commercial concentrate (Kuhkorn PLUS Energie
1, Garant Tiernahrung GmbH, Pöchlarn, Austria) during the last 14 days before expected calving. Diet composition and chemical analyses for the standard lactation and dry cow diet on a DM basis are presented in
Table 1.
After showing signs of approaching birth (less feed intake, swelling of the udder, vaginal discharge, softening of the pelvic ligaments), the animals were moved to a calving pen with straw bedding. Depending on their health status after parturition, the cows were returned to the free stall after a few days.
For continuous data collection (data was recorded at 10 min intervals), the cattle were fitted with a reticulorumen sensor (classic bolus; smaXtec animal care GmbH, 8010 Graz, Austria) 60 days before the calculated calving date. The sensor weight is 210 g, the dimensions are 105 × 35 mm, and it is made of ruminal fluid-resistant plastic. The bolus that was used in the present study is commercially available and used on numerous farms for different purposes (e.g., heat detection, calving detection, early detection of diseases). The manufacturing company uses proprietary algorithms to calculate cow-specific time series data. For this study, the data on locomotion activity (LA), rumination time (RT), reticuloruminal motility (RRCR), and reticular temperature (RETT) were recorded between the time of 60 days antepartum until 60 days after calving.
The cows were physically examined at dry off (60 days before the calculated calving date), and the heifers approximately sixty days before the expected calving date. The physical examination recorded general behavior, respiration frequency, heart rate, color of the mucous membrane, internal body temperature, skin temperature, rumen motility, appetite, defecation, and urination [
20]. All animals were repeatedly examined three (−21 d), two (−14 d), and one (−7 d) weeks before the expected calving, three to six hours before (−0 d), during (0 d), and one to four hours after the calving (+0 d). Further examinations were performed on day one (+1 d), three (+3 d), seven (+7 d), and fourteen (+14 d) postpartum (study setup is shown in
Table 2). The physical examination was performed to ensure that all animals in the study were clinically healthy.
Blood samples were obtained from each animal during the physical examinations. Blood was collected via coccygeal venipuncture into Vacuette serum blood tubes (Greiner Bio-One GmbH, 4550 Kremsmünster, Austria). After sampling, the blood was left to stand at room temperature for approximately 20 min and then centrifuged (3000× g for 20 min). After centrifugation, the serum was transferred to Eppendorf Safe-Lock tubes and stored at −21 °C.
Since the animals did not always give birth on the expected day, the actual day of the blood sampling before parturition was recalculated according to the day of calving. Data from animals (n = 13) that gave birth to twins (n = 4), inadvertently received vitamin D3 prophylaxis (n = 6) or suffering from disease (respiratory diseases; n = 3) had been excluded from the analysis.
Immediately after centrifugation, the ionized calcium (iCa) was measured with the ion meter LAQUAtwin Ca-11C® (HORIBA Advanced Techno, Kyoto, Japan) in the serum. Serum was used for analysis of calcium (tCa), phosphorus, alkaline phosphatase, magnesium, and potassium at the laboratory for clinical diagnosis, Laboklin (4020 Linz, Austria).
The categorization of the hypocalcemia groups was based on tCa and iCa samples taken on day +0. The cows were subdivided into healthy, subclinical hypocalcemic (SCH), and low-calcium (LC). Cows were retrospectively categorized based on serum tCa and recategorized based on serum iCa concentrations as healthy (tCa > 2.20 mmol/L; iCa > 1.05 mmol/L), subclinical hypocalcemic (SCH; 2.2 mmol/L > tCa > 1.80 mmol/L; 1.05 mmol/L > iCa > 0.80 mmol/L), or low-calcium (tCa < 1.80 mmol/L; iCa < 0.80 mmol/L) [
6,
9,
19]. These thresholds were adapted from previously published biochemical definitions of calcium status [
6,
9,
21], which are within the range of cutoff values commonly reported in the literature. The work by Neves et al. [
19] was cited to illustrate the variability of classification approaches used in recent studies.
For the statistical analysis, the software programs R 3.0.2 (R Development Core Team, Vienna, Austria, 2013) as well as Python 3.11.11 with Pandas 2.2.3 and Plotly 6.2.0 were used. The dataset was imported, cleaned for missing or erroneous values, and converted into a data frame containing the variables: time, temperature without drinking cycles, forestomach motility, rumination time, tCa, and iCa. The arithmetic means of the sensor-based parameters (rumination activity, (delta) ruminal temperature, reticuloruminal contraction rate, delta average duration of rumen cycle net rate) were calculated for 12 h intervals from day −21 to +7. Data visualization was performed using the ggplot2 package in R 3.0.2 (R Development Core Team, Vienna, Austria, 2013). Histograms and Q–Q plots were used to assess normal distribution. Box plots were drawn of the three groups for comparison. To check the variance homogeneity, Levene’s test (leveneTest, car package) was performed on these parameters. For the analysis of variance of the three groups, the ANOVA test (aov) was used. The Bonferroni post hoc test (t.test, p.adjust.method = “bonferroni”) was used to calculate the days for which the mean values were significantly (
p < 0.05) different between the groups. Repeated measures were analyzed iteratively across time points. The fixed effect in the model was Ca status (healthy, subclinical, low-calcium), while time was treated as a repeated factor. No random effects were included, as each time point was analyzed independently to assess temporal trends. For diagnostic evaluation, only cows with negative time values and without subclinical cases were included. The ROC (receiver operating characteristic) curve (cutpointr package [
22]) is a graphical method for determining the performance of a diagnostic test and helps to find the optimal cut off point for differentiating between diseased and non-diseased animals. Youden’s J statistic, which is calculated as the maximum value of (sensitivity + specificity − 1), was used to differentiate between healthy and low-calcium cows. Odds ratios were calculated from contingency tables derived from the ROC classifications.
To assess the potential of more advanced analytics beyond simple thresholding of rumination time, which may miss subtle or nonlinear indicators of disease, a deep learning (DL) model provided by smaXtec was evaluated. This model is part of the TruAdvice ™ early detection system [
23], which is currently used on commercial farms for early detection of milk fever risk in dairy cows.
The DL model is a binary classifier that predicts the risk of clinical hypocalcemia for individual cows. The underlying architecture is based on InceptionTime, a deep learning model originally developed for time series classification tasks [
24]. InceptionTime uses a series of convolutional neural networks (CNNs) to identify and learn complex patterns over time within and across multiple features. While CNNs are often used in image analysis, they can also learn complex temporal patterns in longitudinal sensor data, such as those collected from reticuloruminal sensors.
The model was trained on data collected from diverse farms worldwide, representing a wide variety of breeds, environments, and management styles. Importantly, none of the data from this current study was used in the model’s training, validation, or testing phases, making our results a true external validation of the model’s generalizability. The model uses five features: four time-series features derived from the reticuloruminal bolus sensor, and one static feature indicating animal parity. The time-series features include:
RETT (Reticular Temperature)
RCNR (Rumen Cycle Net Rate, i.e., duration of A or A + B rumen cycle in seconds [
14])
RCD (Reticular contraction duration, i.e., length of biphasic or triphasic reticular contraction in seconds)
RCDV (Percentage of successful RCD calculations)
Each feature is resampled to 10 min intervals, resulting in 144 data points per day. To predict the risk on a given day, the model uses a 12-day window. All features are standardized, and missing values are imputed using linear interpolation. Furthermore, the model includes the information whether the animal is a cow or heifer.
These features form the multivariate input time series processed by the DL model, as detailed below.
The model architecture consists of:
14 inception modules
convolutional kernel sizes of 216, 108, and 54 (in each module)
and a bottleneck layer producing 12 feature maps per module
This configuration yields approximately 773,000 trainable parameters. The model was trained using cross-entropy loss and the Adam optimizer with a batch size of 16. Data was split into training (72%), validation (18%), and test (10%) sets. Early stopping with a patience of 15 epochs without improvement in validation accuracy and dropout layers helped reduce potential overfitting. Hyperparameter tuning and threshold selection were guided by the precision–recall performance of the test set.
Implementation note: The model was implemented in PyTorch 2.3 and trained on an NVIDIA Tesla T4 GPU.