Automated detection of asymmetrical udders in dairy goats using a camera and deep-learning model YOLOv12

Research output: Contribution to journalArticleAcademicpeer-review

Abstract

Udder asymmetry is a clinical sign in dairy goats frequently linked to udder inflammation (mastitis). Therefore, goats identified with udder asymmetry should be examined and specifically checked for (past) mastitis. Ideally, all goats should be routinely monitored for udder asymmetry during milking. However, in many countries, dairy goat herds consist of hundreds to thousands of animals, which makes it practically impossible and too labor intensive to regularly examine all animals. Therefore, new automated solutions, including computer vision models, are highly desirable. In this study, we trained and validated a custom computer vision model to detect udder asymmetry in goats. To develop the model, 4,321 annotated goat backside udder images and 373 background images were collected during milking sessions on a dairy goat farm on 3 different days. The 3 ground truth labels for the goat udders-symmetrical, left asymmetry, and right asymmetry-were provided by 2 independent dairy goat veterinarians. The dataset was randomly split in 60% training, 20% validation, and 20% unseen test subsets. The model was trained for 300 epoch cycles including hyperparameter optimization for 300 iterations. The performance of our model (Udder_Asymmetry_Model) on the test dataset was satisfactory, with a mean average precision of 0.891 (mAP 50, indicating detection success with 50% overlap between the predicted and actual udder area), and 0.766 (mAP 50-95, the average performance across stricter localization requirements). Ninety-five percent CI were 0.869-0.912 and 0.747-0.789, respectively. In conclusion, the detection of udder asymmetry in dairy goats can be automated using a simple camera and our computer vision model. This solution can facilitate better udder health monitoring, ultimately leading to improvements in animal health, animal welfare, and milk quality.

Original languageEnglish
JournalJournal of Dairy Science
DOIs
Publication statusE-pub ahead of print - 4 Feb 2026

Bibliographical note

© 2026, The Authors. Published by Elsevier Inc. on behalf of the American Dairy Science Association®. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).

Fingerprint

Dive into the research topics of 'Automated detection of asymmetrical udders in dairy goats using a camera and deep-learning model YOLOv12'. Together they form a unique fingerprint.

Cite this