Related Experiment Videos
Individual identification of dairy cows with occluded camera views using open-set contrastive learning model
Luara A Freitas1, João R R Dorea1, Kent A Weigel1
1Department of Animal and Dairy Sciences, University of Wisconsin-Madison, Madison, WI, 53706.
Journal of Dairy Science
|June 9, 2026
Summary
Computer vision accurately identifies dairy cows using deep learning, offering an efficient alternative to traditional methods. This technology enhances livestock monitoring and supports precision farming by reducing costs and errors.
Area of Science:
- Agricultural technology
- Computer vision
- Deep learning
- Livestock management
Background:
- Individual identification of dairy cows is crucial for effective livestock management and precision farming.
- Traditional identification methods can be labor-intensive, costly, and prone to errors.
- Challenging visual conditions in free stall barns (occlusions, lighting, poses) hinder accurate identification.
Purpose of the Study:
- To develop and evaluate computer vision techniques for individual dairy cow identification in free stall barns.
- To compare the performance of two deep learning models: Xception (classification) and contrastive learning (similarity).
- To assess the models' robustness and generalization capabilities in both closed-set and open-set scenarios.
Main Methods:
- Collected a dataset of 500 images per cow per day for 49 cows over 4 days.
- Utilized YOLOv8 for initial animal detection and annotation, combined with RFID data.
- Trained and evaluated two deep learning models: Xception for multi-class classification and a Siamese network for contrastive learning.
Main Results:
- The Xception model achieved high accuracy in a closed-set scenario (e.g., 88% accuracy).
- The contrastive learning model demonstrated superior performance in an open-set scenario (100% accuracy), successfully identifying unknown individuals.
- Computer vision offers a scalable, non-invasive alternative to traditional methods, improving efficiency and data collection.
Conclusions:
- Both Xception and contrastive learning models show promise for automated dairy cow identification.
- Contrastive learning excels in real-world, dynamic herd compositions due to its open-set identification capabilities.
- Computer vision integration enhances precision livestock farming by enabling automated phenotyping, tracking, and informed decision-making.