Time series data analysis to predict the status of mastitis in dairy cows by applying machine learning models to automated milking systems data.

Journal: Preventive veterinary medicine
Published Date:

Abstract

Mastitis in dairy cows is one of the most important issues that not only pose risk to animal health and welfare but also cause huge direct and indirect economic losses to the dairy sector. In recent times, automated milking systems (AMS) have gained sharp rise in popularity and adaptation by dairy farmers. Mastitis detection under AMS operations becomes more difficult due to lack of direct human inspection of milk and udder during milking. The AMS technology consistently produces large amounts of milking records, which create the opportunity of developing algorithms to identify mastitis. The aim of this study was to predict mastitis in individual dairy cows through application of machine learning (ML) models on AMS generated high resolution data. The multivariable time series data with seven daily observed predictor variables and mastitis records of 1790 individual cows was collected from two dairy farms situated in Saxony and Brandenburg states of Germany for a period of four years. We applied six ML models: logistic regression, support vector machine, decision tree, random forest, gradient boosting and multi-layer perceptron, to correctly predict the status of mastitis (i) one day prior and (ii) on the day of clinical observation. Due to class imbalance, synthetic minority oversampling technique (SMOTE) was used to balance the training data. Each ML model varied in its efficiency for mastitis predictions. The overall accuracy, sensitivity and specificity scores of ML models ranged between (i) 0.80-0.90, 0.64-0.78 and 0.80-0.90 and, (ii) 0.84-0.93, 0.76-0.91 and 0.84-0.93 respectively. Our findings not only indicated the improvement in ML model performances in comparison to other studies with similar background, but also demonstrated the robustness of time series AMS data by predicting the future events. We propose inclusion of additional variables from AMS records and integration of other sensorial data for further improvement of ML models in future studies.

Authors

  • Muhammad N Dharejo
    Institute for Veterinary Epidemiology & Biostatistics, School of Veterinary Medicine, Freie Universität Berlin, House 21, Königsweg 67, Berlin 14163, Germany. Electronic address: m.dharejo@fu-berlin.de.
  • Lukas Minoque
    Department of Sensors and Modelling, Leibniz Institute for Agricultural Engineering and Bioeconomy e.V. (ATB), Max-Eyth-Allee 100, Potsdam 14469, Germany.
  • Tina Kabelitz
    Department of Sensors and Modelling, Leibniz Institute for Agricultural Engineering and Bioeconomy e.V. (ATB), Max-Eyth-Allee 100, Potsdam 14469, Germany.
  • Thomas Amon
    Department of Sensors and Modelling, Leibniz Institute for Agricultural Engineering and Bioeconomy e.V. (ATB), Max-Eyth-Allee 100, Potsdam 14469, Germany; Institute for Animal Hygiene and Environmental Health, School of Veterinary Medicine, Freie Universität Berlin, Robert-Von-Ostertag-Str. 13-17, Building 35, Berlin 14163, Germany.
  • Olivier Kashongwe
    Department of Sensors and Modelling, Leibniz Institute for Agricultural Engineering and Bioeconomy e.V. (ATB), Max-Eyth-Allee 100, Potsdam 14469, Germany; Joint-Lab Artificial Intelligence and Data Science, University Osnabrück, Hamburger Straße 24, Osnabrück 49084, Germany.
  • Marcus G Doherr
    Institute for Veterinary Epidemiology & Biostatistics, School of Veterinary Medicine, Freie Universität Berlin, House 21, Königsweg 67, Berlin 14163, Germany.

Keywords

No keywords available for this article.