Abstract #60

# 60
Automated mastitis detection for robotic milking systems using deep learning and recurrent neural networks.
M. T. M. King*1, S. A. Naqvi2, M. Champigny3, R. Deardon2, H. W. Barkema2, T. J. DeVries1, 1Department of Animal Biosciences, University of Guelph, Guelph, ON, Canada, 2Department of Production Animal Health, University of Calgary, Calgary, AB, Canada, 3PhenoLogic Co, Toronto, ON, Canada.

With the abundance of data collected by automated milking systems (AMS) comes the need for reliable, validated algorithms for disease detection. The objectives of this study were to (1) integrate AMS data to develop accurate mastitis detection models using recurrent neural networks; (2) determine the relative importance of variables and their effect on model performance; and (3) assess the accuracy of our models. Milking data (including milk yield, visit frequency, duration, temperature, conductivity), cow behavior (rumination time, activity), cow data (DIM, parity), and mastitis records were collected from 13 commercial AMS dairy herds in Ontario, Canada for the first 30 d of lactation for 822 cows. Clinical mastitis was diagnosed when a cow had poor quality or quantity of milk production, as measured by the AMS, and abnormal milk or udder upon visual examination, and the cow was treated using an antimicrobial. Deep learning models were used to predict the daily probability of a cow being diagnosed with mastitis, based on 54 possible input variables (i.e., milking, behavior, and cow data, for each milking and variance for each day). Initial models were run only using healthy cows (no recorded health disorder) and cows having only mastitis. Recurrent neural networks, with varying numbers of long short-term memory cells, were trained using different lengths of time windows when cows were classified as sick for 3, 5, 7, and 15 d centered around diagnoses. Farms were divided into 3 groups: 9 farms for model training and development (n = 240 cows, 20 mastitis cases), 2 farms for model testing (n = 81 cows, 6 mastitis cases), and 2 farms for hold-out validation. Using a combination of milk and behavior data and prediction windows of 3, 5, 7, and 15 d centered around the day of diagnosis, models achieved 82, 85, 79, and 93% accuracy during testing, respectively. Excluding behavior data reduced prediction accuracy by 5% units. Excluding daily variances reduced prediction accuracy by 7% units. Overall, these methods and resulting algorithms have great potential to improve the reliability and timeliness of automated mastitis detection for dairy producers using AMS.

Key Words: robotic milking, mastitis detection, machine learning