Abstract

The dairy industry faces significant economic losses due to morbidity rates in pre-weaning calves, with estimates surpassing$1 billion annually for morbidity rates of 5-7%. Traditional methods of illness detection rely heavily on human observation, often leading to inaccuracies in diagnosis and treatment. Leveraging wearables and activity monitoring, this study introduces the HerdDogg® WelfareTag® cow tag, which employs advanced analytics and machine learning (ML) to identify deviations in calf behavior indicative of health issues. Data from 850 animals across 3 facilities over six months were collected and analyzed. Through time series analysis and ML classification, the model achieved a 74% true positive rate in detecting reduced movement associated with illness within one day with a 8% false positive rate. While periodic surveillance remains necessary, the model offers an objective and efficient method to complement traditional detection approaches, potentially reducing misdiagnosis rates and economic losses in the dairy industry.

Introduction

The economic losses related to calf morbidity and mortality in the dairy industry are substantial. For U.S. dairy farms, preweaning morbidity rates affect about one-third of dairy calves, with mortality rates estimated at around 5-7%. In financial terms, this level of calf loss results in an estimated $1 billion in losses annually due to reduced lifetime productivity and increased costs associated with healthcare and replacement (Dairy Herd Management, 2020). High mortality rates are particularly associated with digestive issues, such as scours, which account for more than half of calf morbidity cases and tend to peak within the first few weeks of life.

Previous research has also shown that changes in physical behavior accompany illnesses and disease in dairy calves.1,2,3 Using wearables and activity monitoring to identify these behavioral changes in a timely manner is an alternative method for decreasing morbidity and mortality rates and minimizing economic losses. The HerdDogg® WelfareTag® brand cow tag, or WelfareTag, aids in the detection of health issues by utilizing advanced analytics and machine learning (ML) to detect changes in an individual animal’s activity relative to its baseline, as well as that of other animals belonging to the same facility or pen. Using an activity monitoring system combined with a machine learning classification model, we find that we’re able to accurately identify activity commonly seen in calves that have health issues.

Data Collection

Individual animal activity is monitored using the WelfareTag, which contains an accelerometer that records movement data every six minutes. Data is collected in fixed intervals and uploaded to a cloud storage system over WiFi or a cellular data connection using strategically placed data gathering stations. In this study, we utilized data collected for 850 animals at 3 different facilities over a 6 month period from June 2024 - Oct 2024.

Methodology

Data for all animals was first reviewed by subject-matter experts familiar with calf activity. When available, treatment datasets provided by the facilities in this study were used as a reference to look for correlations between activity health issues. This approach is based on previous studies showing changes in behavior patterns for dairy calves.1,2,3 When reviewing treatment data, we found that many of the animals with treatment records do not have noticeable changes in activity over time. On average this was the case for approximately 50% of the treatment datasets that were reviewed. In these cases, data was not labeled around the time of treatment. Additionally, animals that did not have treatment records but still displayed activity that deviated from the norm were labeled for model training.

Time series analysis is then performed using open source Python packages to extract statistical, temporal, and frequency-domain signals in the data which distinguish the movement of healthy calves from those that are potentially sick.6,7 These signals are also aggregated over the average activity of all calves at a site. This additional baseline helps prevent false positive detections when the entire lot has periods of lower activity induced by external factors such as environmental or feed changes.

After all data transformations and feature engineering is complete, a machine learning (ML) classification model is trained over 90% of the data. A stratified k-fold cross-validation with 5 folds is used for sampling in order to account for the heavy imbalance of unhealthy to healthy labels in the training set. The remaining 10% of the data is used as a holdout set to validate against the trained model. This holdout set only contains data at times after the data it was trained on in order to simulate how this model is evaluated on live data in a production environment. This process is repeated as more data is acquired in order to have a model that is up-to-date on the latest trends within an individual group of calves.

When evaluating the performance of an ML model, we use the following definitions:

  • If a detection is within one day of labeled activity, that detection is classified as a true positive.
    • Consecutively labeled days are to be counted as a single label. Similarly, multiple detections around a set of consecutively labeled days will be counted as only one true positive. For example, if the dates 01/02, 01/03, and 01/04 are labeled, and detections come back for 01/01 and 01/03, only one true positive is recorded.
  • If a day receives a true value for a detection and it is not within one day of a labeled activity, that detection is classified as a false positive.
  • If a day receives a false value for a detection and it is not labeled, that detection is classified as a true negative.
  • If a labeled health incident does not have any detections within one day of the labeled dates, that health incident is classified as a single false negative.

Results

Using our activity monitoring system and our ML algorithm, we find that we’re able to detect labeled activity related to reduced movement in calves within one day 74% of the time. This gives us a corresponding false negative rate of 26%. We are able to accomplish this detection rate while maintaining a false positive rate of only 8%. It is important to note also that this model has continuously improved over time with repeated training. We expect that this trend will continue as more data is added and additional seasonal effects can be captured.

In addition, we evaluated a separate ML algorithm focused just around the time of feeding for calves. Given that calves are expected to be more active during feeding time, we hypothesized that a narrower timeframe focused on activity within a 4 hour window of scheduled feeding would give us increased alert accuracy. We find that our performance does not change significantly from what we discovered with our standard model, with a true positive rate of 79% and a corresponding false negative rate of 21%. In addition, the false positive rate of this model rises slightly to 9%. While the statistics in model performance are not significantly different, we find that this model allows us to alert earlier than with our standard model. On average, we find that our alerts are generated 2 days earlier, giving us a significant edge in being able to treat early stage calves which may deteriorate quickly after the onset of illness.

Picture1

Figure 1. Top: An example of our standard algorithm’s detection on a sharp decline of an individual (blue) animal’s activity relative to others within the same premise (gold), followed by a detection from the ML algorithm (red).

Bottom: An example of the feeding model’s detection (green) using the individual and group activity around the time of morning feeding.

Conclusions

With a false negative rate of 23%, some periodic surveillance of calves by calf ranch workers is still necessary to catch health issues which are not detected by the ML model. This is in part because there were cases where an unhealthy animal has been treated, but there were no noticeable changes in the accelerometer data being collected. Some of these cases can possibly be attributed to animals which do not show signs of lethargy, but instead only display more visible symptoms such as nasal discharge or coughing. However, it is also possible that some of the treated animals did not show anomalies in their data because they were incorrectly pulled by a calf ranch worker to be treated. In the treatment datasets that we reviewed, we saw that on average around 50% of the treatments given did not have any visible changes in movement activity. This further supports the claim from previous studies that clinical diagnosis is incorrectly given to healthy cattle in general up to 37% of the time.3The low false positive rate of this model therefore provides an opportunity to remove some of the subjectivity in traditional pen riding methods which may be responsible for misdiagnosis.

With a true positive rate of 77% we find evidence that our ML algorithm is picking up on the same patterns in the data that are labeled by subject-matter experts. This allows larger facilities with thousands of calves to more accurately and efficiently allocate resources directly to calves which are showing signs of behavioral changes related to health issues. From the previous research showing that up to 38% of diseased animals may go undiagnosed, we see an opportunity to use this solution to alert to behavioral changes in movement related to disease that may be missed by calf ranch workers.5 In the cases where these changes in activity are related to diseases such as BRD, this means that we can also prevent potentially devastating economic impact from increased death loss.

References

  1. Knauer, W. A., Godden, S. M., Dietrich, A., Hawkins, D. M., & James, R. E. (2021). Automated monitoring of drinking behavior for early disease detection in preweaned dairy calves. Frontiers in Veterinary Science, 8, 615455. https://doi.org/10.3389/fvets.2021.615455
  2. von Konigslow, T., & USDA-NIFA (2024). Novel multi-model sensor technology for early disease detection in pre-weaned dairy breed calves. Cornell University College of Veterinary Medicine. Retrieved from https://www.vet.cornell.edu
  3. Yunta, M., Olmos, G., & Bach, A. (2021). Association between activity monitoring and health status in dairy calves: A machine learning approach. Animals, 11(8), 2249. https://doi.org/10.3390/ani11082249
  4. Dittrich, I., Gertz, M., & Krieter, J. (2019). Alterations in sick dairy cows' daily behavioural patterns. Heliyon, 5(11), e02902. https://doi.org/10.1016/j.heliyon.2019.e02902
  5. Smith, J. L., Vanzant, E. S., Carter, C. N., & Jackson, C. B. (2015). Discrimination of healthy versus sick steers by means of continuous remote monitoring of animal activity. American Journal of Veterinary Research, 76(8), 739-744. Retrieved May 21, 2024, from https://doi.org/10.2460/ajvr.76.8.739
  6. TSFEL: Time Series Feature Extraction Library. SoftwareX 11 (2020). https://doi.org/10.1016/j.softx.2020.100456.
  7. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nat Methods 17, 261–272 (2020). https://doi.org/10.1038/s41592-019-0686-2