Watching Dairy Cows Beat the Heat
2025 · Prairie View A&M University
A computer vision pipeline that watched 38,000+ videos from a commercial Texas dairy to measure how individual cows drink and brush — behaviors tied to how well they handle heat stress. Published in IEEE Access.
Why watch cows?
Heat stress is quietly one of the most expensive problems in dairy farming. As US summers get hotter, milk losses are projected to reach 1.4 kg per cow per day by the 2050s — about $1.7 billion a year across the industry. Fans and sprinklers help, but they don’t fix it.
What’s interesting is that cows differ. Thermotolerance — how well an individual copes with heat — is partly behavioral, partly physiological, and heritable. If you could measure which cows cope best, you could breed for it. But measuring behavior across a 1,100-cow barn by hand is hopeless, so we taught cameras to do it.
The system
We worked with T&K Dairy, a commercial ranch in Snyder, Texas, with cameras mounted over the water troughs and rotating brushes in six free-stall pens — side-angle and top-down views covering 288 focal cows. My job was the engineering: the end-to-end pipeline that turns raw barn footage into behavior counts.
YOLOv8 finds the cows, waterers and brushes in every frame; DeepSORT keeps track of who’s who between frames; a CNN identifies individual cows by their coat patterns. The models hit 93–96% accuracy across both camera views, and everything feeds a web dashboard where researchers can see per-cow drinking and brushing trends without ever scrubbing through footage.
Running at scale
The pipeline has processed more than 38,000 videos from the farm’s cameras — out of over 300,000 collected — automatically extracting drinking and brushing event counts for each one. That kind of high-resolution behavioral record simply didn’t exist before, and it’s what makes selecting for heat-tolerant cows a realistic goal.
The work was published in IEEE Access in December 2025. You can read the full paper below.