AI Cow Tracking System Follows Every Cow in a Crowded Barn, Thai Study Finds
A new cow tracking system built by researchers in Thailand can follow individual dairy cows through camera video alone. The team at Chulalongkorn University designed it for crowded free-stall barns. It needs no collars or ear tags. The study appeared in Smart Agricultural Technology in 2026.

How the cow tracking system works
The system runs in three stages. First, it detects each cow and its behaviour. Second, it refines each detection into a pixel-level outline using a model called SAM2. Third, it tracks every animal from frame to frame.
The researchers compared two detectors, YOLOv11m and RT-DETR. They also compared two trackers, ByteTrack and a SAM2-assisted version. The goal was to find a setup that keeps the right identity on the right cow, even when animals crowd together.
The data behind the study
Three CCTV cameras recorded nine cows from a herd of about 25. The recording lasted two days in August 2025. The team labelled more than 214,000 images to train and test the models.
This is a small herd and a short period. Even so, the labelled set is large enough to compare methods fairly. The authors say the work covers one barn and one breed, so results may differ elsewhere.
What the cow tracking system did well
Both detectors reached the same overall accuracy, a mean AP50 of 65.4%. Feeding, resting and standing were detected reliably, with scores above 95%. These behaviours matter because they link to health, comfort and intake.
Tracking showed a clear gain from the new method. ByteTrack had the best raw accuracy but switched cow identities 50 to 75 times. The SAM2-assisted tracker switched only 8 to 9 times. Fewer identity switches mean the system is more trustworthy for long-term records on each cow.
Where it struggled
Walking scored only about 33% and drinking about 2%. A single frame lacks motion cues, so the system cannot easily tell walking from standing. Camera placement also had a strong effect on results. In addition, the segmentation stage runs well below real time on a laptop GPU.
Therefore, the cow tracking system is a research step, not a farm product yet. The authors plan to add temporal modelling to separate walking from standing. They will also check camera-based measures against accelerometers, milk yield and veterinary records.
Why it matters for dairy farms
Wearable sensors work well but cost money and need upkeep. Cameras already exist on many farms. If a camera-based cow tracking system proves reliable, farmers could watch lameness, heat and feeding without touching the animals. That could lower costs, especially for mid-size herds in Asia. For now, readers should view the numbers as early research and wait for wider trials.
What farmers should ask before buying
Any dairy farmer who hears about a new cow tracking system should ask four questions. How accurate is it on my breed and barn layout? How many cameras do I need? What does it cost to install and run? And can it work in real time, so I can act the same day?
Moreover, farmers should ask who owns the data. A cow tracking system creates a daily record of every animal. That record has value for breeding, health and insurance, so the contract should be clear.
Frequently asked questions
What is the cow tracking system?
It is a camera-based AI pipeline that detects, outlines and tracks individual dairy cows in a crowded barn without wearable devices.
Which behaviours did it detect best?
Feeding, resting and standing were detected with scores above 95%.
Is it ready for farms?
Not yet. It was tested in one barn on one breed over two days, and its segmentation step is slower than real time.
Related reading
Source: Bioengineer.org | DairyNews7x7. Summarised independently in our own words.
Never miss an important dairy update
Follow DairyNews7x7 on Google to get live milk prices, policy alerts, and daily headlines directly in your feed.









