AI in livestock farming uses cameras, body-worn sensors and microphones to monitor animals continuously, with models that turn those signals into information the farmer can act on. One commercial camera system scored dairy cow lameness about as well as two trained veterinarians on most agreement measures, and ear-attached accelerometers recorded shorter rumination five days before cows were clinically diagnosed. The weak point is portability: too little diversity in training data limits how well a model generalises across farms, and a person still has to act on what it flags. Livestock is one corner of a wider picture, covered in our piece on AI in agriculture: measured adoption, benefits and barriers.
A quick note on wording: in cattle circles “AI” usually means artificial insemination, so searches for “AI in cows” often return breeding results rather than software. This article is about artificial intelligence.
What Is Precision Livestock Farming and Where Does It Actually Pay Back?
Precision livestock farming (PLF) is the idea that fully automated, continuous monitoring lets farmers follow the health and welfare of their animals continuously, and manage them in real time rather than from last month’s production figures. The EU-PLF blueprint puts the motivation plainly: as farms grow, a farmer cannot watch every animal satisfactorily, and nobody can watch them for 24 hours a day. The tools are cameras, microphones and sensors placed near or on the animal, acting in effect as extra eyes and ears. Sensors attached to animals or to barn equipment can run climate control and track health, movement and needs.
Where AI fits is the step from raw signal to decision. In one commercial system, a model turns parlour video into a mobility score for each cow; in pig research, image features feed rules that recognise aggressive encounters.
Payback is harder to state. Manual lameness scoring is slow, labour-intensive and subjective, and farmers have been shown to significantly underestimate lameness prevalence in their own herds. A system that scores the herd every day could provide information the farmer is otherwise missing. The Frontiers welfare review (2025) adds the counterweight: without clear benefits to the farmer, uptake may stay limited unless regulation or other incentives push it. The EU-PLF authors also observed that many tools focus on automating processes to save labour rather than on the needs of the animal.
Our judgement is that PLF pays back where three things line up: a costly condition that is routinely missed (lameness is the textbook case), a measurement that catches it earlier than people do, and a clear action the farm will actually take on the flag. Remove the third and the system becomes an expensive dashboard.
How AI in Livestock Monitoring Reads Health and Behaviour
Computer vision in livestock does four broad jobs: identifying and tracking individual animals, measuring body size and condition, reading behaviour such as feeding, lying and social interaction, and spotting signs of illness through changes in posture and movement. Identification can rely on natural features, such as the muzzle pattern in cattle, or on ID markers printed on ear tags. Stereo vision and machine learning have been used to estimate body dimensions and weight, which helps catch underfeeding or overfeeding early.
On the modelling side, a 2023 systematic review of deep learning for livestock behaviour recognition found the field covering 13 behaviour recognition problems and 44 behaviour classes, with CNNs, Faster R-CNN, YOLOv5 and YOLOv4 among the most common models. These are ordinary object detection and classification architectures; the hard part is rarely the network choice.
Lameness Scoring Measured Against Veterinarians
One measured case is lameness. One study evaluated CattleEye, a commercial system using inexpensive 2D surveillance cameras mounted above the passageway out of the milking parlour. The system tracks each cow’s outline across at least 40 frames, identifies the animal by coat pattern and head shape, and passes tracked reference points through a convolutional neural network to produce a mobility score from 0 to 100.
Against two trained veterinary assessors, percentage agreement stayed above 80% and Gwet’s AC above 0.80, similar to the agreement between the two humans, although Cohen’s kappa indicated only fair to moderate agreement. For predicting potentially painful foot lesions, the system reached 0.52 sensitivity and 0.81 specificity, against 0.29 and 0.89 for the human assessor, with the same 73.81% accuracy. The authors are candid that 0.52 sensitivity still lets a high proportion of affected cows go undetected. Within this study’s herd lameness prevalence, a “not lame” score from either system or human carried high odds of the cow having no painful lesion.
Dairy Farms and Robotic Milking
A literature review of computer vision in dairy farming covers cattle identification and tracking, feeding and rumination, body condition scoring, lameness and lying behaviour, mastitis and milk yield, and social behaviour and oestrus. The same review names variability in environmental conditions and data integration as the current limits.
Robotic milking depends on knowing which cow is in the stall: an electronic identification tag lets the milking robot look up that cow’s stored udder coordinates.
Can Computer Vision Detect Livestock Disease from Faeces?
The evidence here covers lab slides, not barn cameras. AI-powered veterinary point-of-care instruments evaluate cytological slides for faecal analysis alongside haematology, urine sediment and dermatology, bringing them closer to reference-laboratory capability. That is a lab sample under controlled imaging, not a camera pointed at a pen floor.
Can AI Spot a Sick Cow Before It Looks Sick?
Sometimes: behaviour sensors and sound monitoring have picked up signs of illness days before diagnosis. In a study of 312 Holstein cows wearing ear-attached accelerometers, daily rumination was already shorter five days before clinical diagnosis in cows that became ill (401.9 versus 434.6 minutes per day in healthy cows). “High active” time dropped and “inactive” time rose three days before diagnosis. In pigs, a sound-based cough detection tool gave warnings up to two weeks earlier than observation by the farmer and veterinarian, according to the 2019 PLF review in animal.
Those signals compared diseased cows with healthy ones across disorders, not one named disease. A 2024 Scientific Reports study used feeding, movement and social data from 172 group-housed calves to predict bovine respiratory disease and reached 0.773 accuracy but only 0.625 sensitivity. The authors conclude that further improvement is needed before behaviour changes can reliably predict disease onset in pre-weaned calves. The honest summary: early warning of “this animal is off” is real; early diagnosis of a named disease is not yet dependable.
Do Farms Need Wearable Sensors, or Can Cameras Do the Job?
Each has strengths: cameras watch many animals at once, while wearables give continuous individual readings. A 2025 survey of livestock sensing compared vibration, radio frequency, vision and wearable approaches:
| Modality | What it does well | Where it struggles |
|---|---|---|
| Wearables (collars, ear tags, accelerometers) | Continuous, individual readings of vital signs and activity | Scale poorly with herd size, strain farm networks, and get torn off or crushed, so spares must be stockpiled |
| Cameras | Watch many animals at once with nothing attached to the animal | Depend on lighting, suffer occlusion, and generate tens to hundreds of gigabytes per camera per day |
| RFID | Streamlines identification and health record keeping | Environmental interference and tag collisions at large scale |
| Structural vibration | Privacy-preserving, economical monitoring of activity and vital signs, rated most promising by the survey authors | Needs machine learning and large labelled datasets, which are rare |
The early-illness evidence above came from ear-attached accelerometers. Our view is that the choice follows the question: cameras for gait, body condition, feeding and group behaviour at a fixed point such as a parlour exit; wearables where rumination or continuous individual activity is the signal that matters.
A Model Trained in One Barn Rarely Survives the Next
The Frontiers welfare review states it directly: lack of diversity in gold-standard datasets limits how well models generalise across farms, especially for behaviour assessment.
The 2025 sensing survey lists the specific culprits for vision: indoor lighting with insufficient illumination, shadows and occlusion from the animals themselves, and variation in body size, posture, breed and individual health. The deep learning review adds adhesion (animals so close together the model cannot separate them) and data imbalance. Many vision systems still cannot track individual animals continuously without labelling them. Data noise from unrelated changes, such as a new management routine, can drown out the welfare signal the model was meant to catch.
Our agtech article sketches an illustrative scenario: a dairy operator’s collar-based lameness alerts start firing on healthy cows while sick ones slip through, because the model was trained on a different breed, barn layout and feeding schedule. The broader version of that lab-to-field gap, across crops and fisheries as well as livestock, is in our article on why agricultural AI works in the lab but stalls in the field.
Our position is that off-the-shelf detection and tracking models are not solved problems: real barns, real lighting and real herd sizes expose edge cases a demo never meets. The practical consequence is that validation has to happen on each new farm, with local footage, before anyone trusts the alerts.
Who Can Build Livestock Vision That Holds up Across Farms?
TechnoLynx builds and adapts computer vision and sensor-data models for livestock monitoring so they keep working when they move from the pilot barn to the rest of the estate. TechnoLynx’s AI engineering for agriculture page covers this work.
That engineering does not replace animal welfare science or veterinary validation, and the welfare review calls for welfare scientists to take part in developing and validating these tools. Agtech vendors building a product across many customer farms are the stronger fit for us, because generalisation is their problem every time they sign a new site.
What Does IoT Edge Computing Add over Cloud-Based Farm Monitoring?
Edge processing runs the model in or near the barn; cloud monitoring ships the raw data elsewhere to process. CattleEye, for instance, sends parlour footage directly to company servers for storage and processing. That works, but video is heavy: one camera recording all day can produce tens to hundreds of gigabytes.
The Frontiers review frames the requirement as hardware that survives dirt and collisions and either reliably transmits high-resolution data or runs processing locally. Its authors also see local deployment of small large multimodal models on edge devices as ideal for data privacy and lower energy use.
In our view the edge earns its place on three counts: it sends events and scores instead of raw video, it keeps working when rural connectivity drops, and it keeps footage of the farm on the farm. The cloud keeps its advantages for retraining and for comparing herds across sites, so the sensible design usually processes at the edge and syncs summaries upward.
How Does AI Improve Animal Welfare on a Working Farm?
AI supports welfare by monitoring animals continuously and consistently, without the fatigue of human observers. Automated scoring is not prone to subjectivity or fatigue, and a system scoring every cow several times a week, regardless of herd size, would aid lameness management. In pigs, camera monitoring of aggression replaces labour-intensive manual observation with continuous, real-time detection. In broilers, flocks that clustered for long periods tended to have higher footpad lesion scores, and higher flock activity went with better hock burn scores.
The limits are as real. Pig aggression detection still confuses fighting with play. When the Frontiers authors used GPT-4o to judge cattle cleanliness from segmented images, accuracy was moderate (0.71 for the hind leg, 0.62 for the hindquarter, 0.52 for the udder). Many welfare tools are already marketed without external validation. And the same review warns of a rebound effect: owners who lean on monitoring and cut back personal observation are not guaranteed any welfare gain.
Welfare improves when a flag reaches a person who acts on it, and stops improving when the system becomes a reason to walk the barn less.
Does AI Replace the Vet, or Flag Animals for One?
It flags animals for one. A 2026 Frontiers review of AI in veterinary decision-making concluded that AI should aid, not replace, veterinary professional decisions, and that the veterinarian remains responsible for the standard of care. The diagnostic models it reviewed were better at recognising normal results than abnormal ones, more suited to ruling disease out than confirming it. The review also asks whether diagnostic AI trained mostly on dogs and cats can be relied on for underrepresented species, livestock among them, since results skew when some species dominate the training data.
On the farm, the welfare review is clear that human action is still required for any corrective step, and it flags alarm thresholds as a challenge, warning that systems may overlook concerns to keep alarm volumes manageable. That threshold is the decision we would scrutinise first in any livestock AI deployment, because it encodes how many missed animals the farm will tolerate in exchange for fewer false alarms, and nobody should let a vendor’s default setting make that trade unexamined.