Skip to main content
Phenomics

Automated Camera-Based Phenotyping for Individual Identification and Feeding Behavior Classification in Dairy Cows Using Deep Learning

Authors
  • Luara Freitas (University of Wisconsin–Madison)
  • Joao Dorea (University of Wisconsin–Madison)
  • Kent Weigel (University of Wisconsin–Madison)
  • Guilherme Rosa (University of Wisconsin–Madison)

Abstract

Automated phenotyping technologies are transforming animal breeding by enabling continuous, objective, and large-scale collection of phenotypic data. Conventional identification methods, such as physical or electronic ear tags, have limitations: they require one tag or sensor per animal, are prone to physical degradation, and offer limited data collection frequency. In this context, computer vision offers a promising approach for developing non-invasive phenotyping systems capable of extracting complex traits from visual data. This study aimed to develop and evaluate an automated phenotyping framework using deep learning models to perform individual identification and feeding behavior classification of dairy cows in free stall barns, contributing to precision livestock farming and novel phenotyping technologies. Video recordings from 49 Holstein cows were collected. A two-step computer vision pipeline was implemented for individual identification. First, a YOLOv8 model was fine-tuned using the collected dataset (4,390 training, 940 validation, and 942 testing images) to detect cows in the images. This trained model was then applied over four days to crop cow images, even under occlusion, resulting in 98,000 cropped images (500 images per cow per day). Cow IDs for model training were obtained via an RFID system, and cropped images was then labeled with its corresponding ID. The second step consisted of evaluating two deep learning approaches for individual identification: Xception model (closed-set scenario) and a Siamese network model (closed-set and open-set scenarios). The closed-set scenario assumed that all animals were known, while the open-set scenario simulated real-world herd dynamics, in which unknown individuals may be added to the herd at any time. A subset of the cropped images was used for a binary feeding behavior classification task (eating vs. not eating) using the Xception model. In the detection step, the YOLOv8 model achieved a precision of 0.86, recall of 0.87, and F1-score of 0.86. In the closed-set scenario, the Xception model achieved an average precision of 0.84, recall of 0.79, F1-score of 0.78, and accuracy of 0.79 across four test days, outperforming the Siamese network, which obtained a precision of 0.61, recall of 0.70, F1-score of 0.64, and accuracy of 0.70. In the open-set scenario, the Siamese network successfully recognized unknown individuals with 100% accuracy, demonstrating robust generalization to unknown animals. The Xception model successfully classified feeding behavior, achieving an average precision, recall, F1-score, and accuracy of 0.90. These results indicate that deep learning models can reliably phenotype both individual identification and feeding behavior, even under partial occlusion and variable lighting conditions. This study highlights the potential of camera-based phenotyping to provide automated, scalable, and non-invasive measures of animal traits. By integrating individual identification with behavioral phenotyping, this approach can enhance livestock monitoring, reduce manual labor, and provide continuous data to support genetic evaluation and management decisions.

Keywords: 2026

How to Cite:

Freitas, L., Dorea, J., Weigel, K. & Rosa, G., (2026) “Automated Camera-Based Phenotyping for Individual Identification and Feeding Behavior Classification in Dairy Cows Using Deep Learning”, World Congress on Genetics Applied to Livestock Production Digital Archive 2026(1): 2284215. doi: https://doi.org/10.31274/wcgalp.23557

Rights: 1

Downloads:
Download PDF
View PDF

62 Views

16 Downloads

Published on
2026-02-26

Peer Reviewed