Estrus detection in dairy cattle
Abstract
Effective estrus detection in dairy heifers is crucial for optimizing farm profitability by minimizing economic losses associated with missed reproductive events. Traditional visual observation methods are labor-intensive and prone to oversight, prompting exploration of alternative approaches such as wearable technology. This study evaluates the efficacy of the HerdDogg® WelfareTag® in conjunction with machine learning (ML) algorithms for early detection of estrus events in dairy heifers. Activity data from 305 animals across four facilities were collected over an 11-month period and analyzed using time series analysis and ML techniques. The ML model achieved a 95% true positive rate for detecting estrus within 16 hours of onset, with a false positive rate of 5%. These results demonstrate the system's capability to accurately and timely alert farm managers to estrus events, thereby potentially reducing economic losses associated with missed or delayed detection. Implementation of this technology promises to enhance operational efficiency and reproductive management in dairy farming.
Introduction
There are numerous ways that missing heifer estrus events can have a negative impact on the profitability of dairy farms. The most significant costs come from decreased milk production, increased culling rates, reproductive costs, and genetic improvement delays. Recent studies have estimated that a single missed heat could cost $42- $105 per cow.2 At large dairy operations where it is difficult to closely monitor the reproductive cycle of every heifer, these costs can end up significantly impacting economic output.
Traditional methods for estrus detection have been based around visual observation. However, this approach can be tedious while also incurring additional labor costs. Using wearables to monitor activity behavior in heifers is an alternative method for detecting estrus earlier and mitigating potential economic losses.
The HerdDogg® WelfareTag® brand cow tag, or WelfareTag, aids in the detection of estrus events 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 operation. Using an activity monitoring system combined with a machine learning classification model, we find that we’re able to accurately identify and alert to estrus events shortly after their onset.
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 305 animals at 4 different facilities over a 11 month period from July 2023- June 2024. Over this time period we identified 864 estrus events.
Figure 1. An example of the movement data for an individual animal (black) and the activity data for the facility’s animals (orange). A period of raised activity on June 14th is an example of the signal associated with an animal undergoing estrus.
Methodology
Data for all animals was first reviewed by subject-matter experts familiar with behavioral changes in heifers undergoing estrus. This approach is based on previous studies that show heifers exhibit prolonged periods of raised activity during estrus events.3
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 activity behavior of heifers that are in estrus from those that are behaving normally.4,5 These signals are also aggregated over various groups of animals, such as which pen they belong to. The additional point of reference provided by this baseline helps further distinguish the signals associated with estrus activity.
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 estrus vs non-estrus 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.
When evaluating the performance of the ML model, we use the following definitions:
- If a detection is within 16 hours after the onset of standing estrus, that detection is classified as a true positive.
- Consecutively labeled hours are to be counted as a single label. Similarly, multiple detections around a set of consecutively labeled hours will be counted as only one true positive.
- If the model gives a true value for a detection and it is not within 16 hours after the onset of a labeled estrus event, that detection is classified as a false positive.
- If the model gives a false value when the animal is not undergoing estrus, that detection is labeled as a true negative.
- If a labeled estrus event does not have any detections within 16 hours of its onset, that event 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 estrus activity within 16 hours of onset 95% of the time. This gives us a corresponding false negative rate of 5%. We are able to accomplish this detection rate while maintaining a false positive rate of only 5%. Detections are made 7 hours on average after the onset of estrus.
Figure 2: An example of the transformed activity data (top) and the model outputs for three correctly identified estrus events (bottom).
Conclusions
With a true positive rate of 95% and a false negative rate of only 5%, we determine that we are able to accurately alert estrus events. The 5% of estrus events that are not captured by this model are due to animals that already display higher than average activity behavior. This model can also potentially miss estrus events that are associated with weaker activity due to the influence of estrus synchronization drugs.
When false positives occur, they are due to large daily swings in activity when an animal is less active than usual, followed by a period of increased activity. While this anomalous behavior is difficult to account for, our false positive rate of only 5% allows us to be confident that we aren’t wasting valuable labor time by falsely alerting too often.
The benefits from using this activity monitor system and machine learning algorithm can therefore greatly enhance productivity at dairy operations, thus reducing the potential economic losses that can come from missed estrus events. Furthermore, with an average detection time of 7 hours, we can be confident that we are catching estrus events early enough in order to maximize the efficiency of artificial insemination.
References
- The Reproductive Status of your dairy herd | New Mexico State University. https://pubs.nmsu.edu/_d/D302/index.html
- Senger, P. L. 1994. The estrus detection problem: new concepts, technologies, and possibilities. J. Dairy Sci. 77:2745–2753.
- At-Taras, E., & Spahr, S. (2001). Detection and Characterization of Estrus in Dairy Cattle with an Electronic Heatmount Detector and an Electronic Activity Tag. Journal of Dairy Science, 84(4), 792–798. https://doi.org/10.3168/jds.s0022-0302(01)74535-3
- TSFEL: Time Series Feature Extraction Library. SoftwareX 11 (2020). https://doi.org/10.1016/j.softx.2020.100456.
- 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
- Timing of insemination for dairy cattle. https://extension.psu.edu/timing-of-insemination-for-dairy-cattle