Improving individual cattle identification for livestock management systems using vision transformer embeddings and FAISS
Abstract The growing demand for cattle products has created an urgent need for large-scale farms equipped with automated management systems to ensure sustainable and efficient livestock farming practices. One critical challenge is the accurate identification of individual cattle, as errors in identification can negatively affect animal health and overall farm productivity. This study compares closed-set individual cattle identification using classification models, Residual Network with 50 layers (ResNet50) and Shifted Window (Swin) Transformer, with similarity-matching methods employing vision transformer-based feature extractors Contrastive Language Image Pre-training(CLIP) and Distillation with No Labels (DINO) combined with the Facebook AI Similarity Search (FAISS) algorithm nearest-neighbor search on a public cropped muzzle-image dataset. A similarity-based approach demonstrates greater scalability for medium- to large-scale farms, requiring only a small number of reference images per cattle for identification. This addresses key challenges associated with classification-based methods, including the need for multiple training images per individual and computational inefficiencies as herd size increases. The study uses a dataset containing 4,923 images of cattle muzzles from 268 mixed-breed bovine subjects. Using similarity matching, DINO_FAISS achieved 98.6% Top-1 accuracy (95% CI 97.7–99.2) and CLIP_FAISS 96.0% (95% CI 94.6–97.1), compared with 98.5% for the Swin Transformer and 97.2% for ResNet50 under classification. Top-3 retrieval accuracies were 100.0% and 98.2% respectively.
Authors
- Abdulrahman Javaid
- Abrar Alamoudi
- Shiekhah AL-Binali
Institutions
- Saad Specialist Hospital (SA)
Publication Details
- Journal
- Scientific Reports
- Published
- 2026-09-15
- DOI
- https://doi.org/10.1038/s41598-026-71106-z
- Primary Topic
- Food Supply Chain Traceability
- Type
- article
- Field-Weighted Citation Impact
- 0.00