Dairy farm: identifying cows from photos and video
A CV system that identifies cows from a photo (mobile app, 78%) and from a live video feed (Re-ID).
- Scale
- 1,000+ head
- Stage
- Shipped in 2025
- Delivered
- November 2025
TL;DR. A cow identification system with two modes. The herd manager photographs a cow and the app identifies her (78%), then shows her parameters and outstanding treatments. In parallel, Re-ID runs on the live video feed. Three interfaces: mobile app, web panel, API.
Situation
Staff identified animals by hand — from memory or by reading the ear tag. With over 1,000 head, the time spent tracking each animal adds up. Health parameters and the list of required treatments lived in separate systems.
Task
- Identify a cow from a photo: the herd manager takes a picture, the system matches her against the database and immediately shows her parameters and outstanding treatments.
- Identify every cow on the live video feed (Re-ID) with no staff involved.
What we built
The core. EfficientNet-B1 with 128-dimensional embeddings — the model builds a compact representation of each cow from her appearance. ByteTrack handles multi-object tracking on the video feed.
Photo mode. The herd manager photographs a cow from a phone or tablet. The system matches the shot against the embedding database, identifies her (78% accuracy) and returns a card straight away: her key parameters and the treatments she is due.
Re-ID mode on video. Real-time identification across 4 cameras, so the herd manager sees an identifier on every cow in frame without watching the screen.
Interfaces: mobile app, web panel and API, the last one for integration with existing record-keeping systems.
Result
- 78% accuracy from a photo: the herd manager gets the animal's card and treatment list the moment the picture is taken.
- Re-ID runs on the video feed in real time with nobody watching.
- Three interfaces cover three situations: in the field (mobile), at a desk (web), inside the record system (API).
- Shipped in 2025.
Key technical decisions
- Embeddings rather than classification. A classifier doesn't scale here: every new animal would mean retraining. With embeddings, a new cow is added to the database as one more vector — no retraining at all.
- Two modes, one core. Photo and video share the same embedding model, so maintenance and updates cover both channels at once.
FAQ
Is 78% accuracy enough to work with?
It depends on the scenario. Photo identification doesn't replace the ear tag in legally significant operations. It removes the manual lookup in the routine ones: the herd manager gets the card immediately and confirms it, instead of searching for the animal from scratch. An error costs one extra check, not lost data.
What happens when new animals join the herd?
Nothing gets retrained. The model builds an embedding, and the new cow is added as another vector in the index. That is exactly why we chose embeddings over a classifier.
Does the farm need an internet connection for this to work?
The core — the embedding model and index matching — needs no cloud API. Connectivity requirements come from where the server sits and which interfaces are in use: mobile app, web panel or the record system's API.
What would come next
The natural continuation is tying this to the behavioural event detection system: identify a specific animal, then notify automatically when a key event happens to her.
If you run livestock, greenhouses, a warehouse or a factory and have a "we need to know which object this is from a photo or video" problem, let's talk it through in 30 minutes.
Stack
- Python 3.12
- PyTorch
- EfficientNet-B1
- ByteTrack
- OpenCV
- FastAPI