A new study published in Scientific Reports has found that machine learning has the potential to improve veterinary surgeons’s ability to diagnose herd mastitis origins accurately and reduce mastitis levels on dairy farms.

The study, which was led by Robert Hyde MRCVS from the School of Veterinary Medicine and Science at the University of Nottingham, aims to create an automated diagnostic support tool for the diagnosis of herd level mastitis origin, an essential first step of the AHDB mastitis control plan. 

Mastitis data from 1,000 herds’ was inputted for several three-month periods. Machine learning algorithms were used to classify herd mastitis origin and compared with expert diagnosis by a specialist vet. 

The machine learning algorithms were able to achieve a classification accuracy of 98% for environmental vs contagious mastitis, and 78% accuracy was achieved for the classification of lactation vs dry period environmental mastitis when compared with expert veterinary diagnosis. 

Robert said: “Mastitis is a huge problem for dairy farmers, both economically and in welfare terms. In our study we have shown that machine learning algorithms can accurately diagnose the origin of this condition on dairy farms. A diagnostic tool of this kind has great potential in the industry to tackle this condition and to assist veterinary clinicians in making a rapid diagnosis of mastitis origin at herd level in order to promptly implement control measures for an extremely damaging disease in terms of animal health, productivity, welfare and antimicrobial use."


  1. Hyde, R.M., Down, P.M., Bradley, A.J. et al. Automated prediction of mastitis infection patterns in dairy herds using machine learning. Sci Rep 10, 4289 (2020). https://doi.org/10.1038/s41598-020-61126-8

Whilst you're here, take a moment to see our latest job opportunities for vets.