Skip to main navigation Skip to search Skip to main content

Transformer neural network to predict and interpret pregnancy loss from activity data in Holstein dairy cows

Research output: Journal Publications and ReviewsRGC 21 - Publication in refereed journalpeer-review

Abstract

Predicting/detecting pregnancy loss of dairy cows offers the opportunity to shorten the time interval between artificial inseminations. Although several methods of pregnancy detection are being practiced, models with accurate, timely and interpretable detection of pregnancy are still lacking. This study proposed a transformer neural network to predict the probability of pregnancy loss based on continuous activity data, which were collected from activity-monitoring tags attached to 185 Holstein cows from a commercial dairy farm in Cayuga County, NY, USA. Our best model achieved an average accuracy of 0.87, F1 score of 0.87, recall of 0.87 and specificity of 0.90 using 14-day time-series activity windows (90% overlap) using 5-fold cross-validation, outperforming commonly used classic statistical learning and deep learning models for time-series data. The results indicated that our predictive model gave high probabilities of correctly detecting pregnancy loss prior to the increased activities and veterinary confirmation by transrectal ultrasound. In addition, our model interpretation aligned with the changes in the temporal activity levels, revealing that drastic fluctuations in time-series activity data contributed heavily to the final prediction. To the best of our knowledge, this is the first work on developing transformer models for the prediction of pregnancy loss in dairy cows. In addition to facilitating the development of future precision management on modern farms, our work potentiates an increase in the reproductive efficiency and profitability of dairy farms.
Original languageEnglish
Article number107638
JournalComputers and Electronics in Agriculture
Volume205
Online published19 Jan 2023
DOIs
Publication statusPublished - Feb 2023

Funding

This study was supported by Shenzhen Basic Research Program (JCYJ20190808182402941), Guangdong Basic and Applied Research Major Program (2019B030302005), Collaborative Research Fund (C7013-19GF) in Hong Kong, and City University of Hong Kong internal grant (7005530, 7005756, 9678247, 9680310). We appreciate Dr. Sabine Mann for revising and improving this paper sincerely. We thank the Allflex Livestock Intelligence for providing the activity data.

UN SDGs

This output contributes to the following UN Sustainable Development Goals (SDGs)

  1. SDG 3 - Good Health and Well-being
    SDG 3 Good Health and Well-being

Research Keywords

  • Precision livestock farming
  • Dairy cow
  • Pregnancy loss prediction
  • Time-series activity

RGC Funding Information

  • RGC-funded

Fingerprint

Dive into the research topics of 'Transformer neural network to predict and interpret pregnancy loss from activity data in Holstein dairy cows'. Together they form a unique fingerprint.

Cite this