Catalog / Computer Vision / VIS-014

Livestock & animal welfare monitoring

Barn, milking-parlour, slaughterhouse and pen-side cameras are analysed by vision models to detect lameness, body-condition change, abnormal behaviour, injuries and stress early, so farmers, vets and inspectors can intervene sooner and document welfare.

Parts needed to run it yourselfDocument readingPrediction & time seriesVision

Herds and flocks are too large for continuous human observation, and many welfare problems (lameness, weight loss, tail biting, heat stress, sick birds) are visible days before they become costly. Cameras plus vision models turn the barn into a continuously scored environment: animals are detected and tracked, gait, posture, body shape and behaviour are quantified, and deviations create alerts for the farmer or vet. The point is earlier intervention and objective welfare documentation, not replacing stockmanship.

Problem & value

  • Today: the farmer or herd manager walks the barn, locomotion-scores cows by eye at intervals, and relies on gut feeling, milk-yield drops or sensor collars. Subjective scoring is inconsistent and rarely done daily; in pigs and poultry, individual animals are almost never observed. Slaughterhouse stunning and handling are checked by supervisors and, increasingly, mandated CCTV.
  • AI value: daily objective scores for every animal (e.g. lameness, body condition), early detection of health events, less antibiotic use through earlier targeted treatment, labour savings on observation, and auditable welfare evidence for retailers' labels and authorities.
  • Evidence: the Welfare Quality protocols define the established animal-based welfare indicators that most systems try to automate; EFSA and the research literature on precision livestock farming describe both the potential and the validation gap [1][2]. Published vendor performance figures differ by barn, breed and camera set-up, so measure on your own animals before trusting headline accuracy.

Variants

  • Dairy cattle: gait/lameness scoring from walkway or parlour-exit cameras, body-condition scoring from top-down depth cameras, heat and calving detection, rumination and lying behaviour.
  • Pigs: pen-level activity, tail biting and aggression, mounting, lying-pattern (thermal comfort), weight estimation, farrowing-pen monitoring (piglet crushing alerts).
  • Poultry: flock-level distribution, mortality and dead-bird detection, activity and gait, litter and crowding indicators; individual tracking is rarely feasible.
  • Aquaculture: underwater cameras for feeding behaviour, lice counting and biomass estimation.
  • Slaughterhouse welfare: CCTV analysis of unloading, stunning and bleeding for supervisors and official veterinarians.

How it works

  1. cameras (RGB / IR / depth / thermal, edge box in barn)
  2. detection + multi-object tracking (animal IDs, optionally linked to ear tag / RFID)
  3. per-animal features: keypoints/pose, silhouette, back-line curvature, activity, posture, position
  4. models: lameness / body-condition / behaviour classifiers, anomaly detection vs. own baseline
  5. fusion with milk, feed, climate and sensor time series
  6. alert scoring + dashboard / app notification
  7. human review (farmer, vet, welfare officer)
  8. action and feedback labels
  • Detection and tracking: YOLO-class or RT-DETR detectors with ByteTrack/BoT-SORT-style trackers; occlusion and identical-looking animals make long-term identity the hardest part, so many systems anchor identity on RFID/ear tags or on walkway choke points.
  • Pose and gait: animal keypoint models (e.g. DeepLabCut, SLEAP, or fine-tuned pose heads) feed gait classifiers; back-posture and step asymmetry are classic lameness cues. Depth maps give body-condition score and weight estimates.
  • Baselines over thresholds: because absolute scores vary by herd, alerts are best defined as change against the animal's or pen's own history.
  • Human-in-the-loop: alerts are suggestions; the farmer or vet confirms, and confirmed/rejected alerts become training data. Slaughterhouse findings are always reviewed by a responsible person.

Data preparation

Needed data: barn camera video, sensor streams (milking robots, activity collars, climate), and herd records with animal IDs, health events and treatments. These typically live in the herd-management software, the milking system, on the camera recorder and in paper stall books or spreadsheets.

Typical gaps: animal IDs not linked to images, health events recorded late or only on paper, no labels for lameness or mounting behaviour, poor lighting and dirty lenses, and different systems with separate logins. Staff images may be captured incidentally.

Preparation steps: capture the herd register and digitise paper treatment records (PREP-006, PREP-008), export system data (PREP-005), have the vet or farm manager label sample events (PREP-018), and harvest labels from treatment records (PREP-020). Tools: CVAT, Label Studio, spreadsheets, vendor export APIs. Plan about 40-50 percent of the effort for data capture and labelling; with a bought product, most of this shrinks to camera placement and animal registration. See GUIDE-003.

Implementation paths

Which path for whom

  • SMB (farms): Path A, because mature barn camera and sensor products with EU support exist at farm-level prices and the process is standard.
  • Enterprise (large producers, integrators): Path B, because herd data from many sites must be combined with own farm-management and processor systems that no product covers.
  • Developer: Path C, because open vision models and edge devices allow custom behaviour detection without licence lock-in.
  • Public (research, veterinary authorities): Path B on sovereign EU cloud, because welfare audits need transparent models and data-sovereign hosting.

Path A — Buy

  • Integrated barn systems: Nedap (NL, EU), Lely (NL, EU), DeLaval (SE, EU), GEA (DE, EU) and Afimilk for dairy management with sensor- and camera-based modules; Cattle Eye (UK) for camera-based cow monitoring; Smartbow (AT; reported to be part of Zoetis) and Datamars Livestock (CH) for ear-tag and collar sensing; Big Dutchman (DE, EU) and Fancom (NL, EU) for pig and poultry house climate/monitoring platforms with camera modules; Faromatics (ES, EU) for poultry vision; Observe Technologies and Aquabyte for aquaculture.
  • Check: EU data hosting, local edge processing, integration with the herd-management system, whether accuracy was validated on your breed/housing, and who owns the footage and the labelled data.
  • Choose A when: you are a farm or cooperative without an ML team; most vendors bundle cameras, edge hardware and support.

Path B — Build on cloud APIs

  • Video/image analysis APIs: Google Cloud Vertex AI Vision / Video Intelligence, Azure AI Vision and AWS Rekognition Custom Labels for custom classes; frontier multimodal models (Gemini, Claude, GPT, Mistral Pixtral) for ad-hoc clip triage and report generation.
  • Choose B when: you are an agri-tech or advisory firm building a service across many farms and need fast iteration; keep raw barn video in EU regions.

Path C — Self-host (open source)

  • Detection/tracking/pose: Ultralytics YOLO (AGPL, check licence), RT-DETR, MMDetection/MMPose, DeepLabCut, SLEAP, Supervision/ByteTrack, SAM 2 for mask annotation, DINOv2 features for few-shot classification; Qwen-VL class open VLMs for clip summarisation.
  • Hardware: HW1 per barn (Jetson Orin class handles several streams); a central HW2 GPU for training and fleet-wide batch scoring.

Path D — Custom training

Almost always required at least in part: breed, housing, floor colour, lighting and camera angle shift domain strongly. Needs thousands of labelled frames or clips with expert scores (vet-confirmed locomotion scores, body-condition scores) from many animals and farms, plus held-out farms for validation. Active learning from farmer confirmations reduces labelling cost.

State of the art (2026)

  • Mature: animal detection, counting, basic activity and lying/standing classification, dead-bird and walkway-based lameness screening in dairy, 3D body-condition scoring in controlled set-ups.
  • Improving: foundation-model features (DINOv2, SAM 2) allow few-shot adaptation to a new barn; pose-based gait analysis works better with depth; VLMs enable natural-language event queries.
  • Hard: long-term individual identity in crowded pens, early detection of subtle pain or disease, tail-biting prediction (before injury), poultry individual welfare, and generalisation across farms. Many published results come from a single farm and degrade on another.
  • Limits and failure modes: false alarms from dirt, lighting changes, camera drift and occlusion; alert fatigue; welfare is multi-dimensional (Welfare Quality) and cameras capture only part of it; "good score" can hide poor housing. Do not treat a model score as proof of compliance.

Shared resources & combinations

  • Same stack: object-detection + tracking + pose with VIS-024 (human pose), VIS-007 (PPE/safety), VIS-032 (species and camera-trap wildlife) and VIS-026 (counting, volume and weight estimation); one edge fleet and annotation pipeline serve all.
  • Combine with sensors: PRED-044 (collar/bolus/ear-tag health and calving prediction) for fused early warning; PRED-013 for production forecasting.
  • Downstream: VIS-031 (natural-language search over camera feeds), ROBO-007 (barn and field robots).

Effort, cost & KPIs

  • Path A: weeks to install; cost is hardware plus subscription per animal or per camera; the main effort is placement and staff routines.
  • Path B: 3-6 months for a multi-farm service; cost drivers are video egress, labelling, and per-clip inference.
  • Path C/D: 6-12+ months including data collection across farms; ongoing re-validation.
  • KPIs: sensitivity/precision of alerts against vet-confirmed cases, days earlier detection, false alerts per animal-week, share of animals scored daily, treatment/antibiotic use, culling and mortality rates, labour hours on observation, audit findings.

People & change

Involve the owner or management first, then the herd manager (process owner) and the stable staff who work with the system daily; their trust decides whether alerts are acted upon. IT or the installer handles network and cameras, the vendor and the vet are key suppliers and data owners. Plan a pilot in one barn or group for one to two production cycles and compare alerts with the herdsman's own judgement.

Works council: only relevant where a works council exists and the cameras can capture employees. Because objective suitability to monitor behaviour or performance is enough (BAG), barn cameras that also film staff trigger co-determination under §87(1) no. 6 BetrVG; solve it with camera angles, masking and a works agreement. §90(1) no. 3 requires early information about AI-planned work processes.

Data protection: farms rarely process personal data of animals, but staff in view and farm owners' data are personal data; involve the DPO or external DPO, conclude an AVV with the vendor and avoid audio. A DPIA is usually not needed unless employees are systematically monitored. For AI literacy, support staff with short hands-on training on what alerts mean and their limits (Art. 4 AI Act). Communicate that the system assists animal care and does not replace the herdsman or the vet; staff confirm every alert. Guides: GUIDE-008, GUIDE-006, GUIDE-004.

Risks, regulation & compliance

  • EU AI Act: typically minimal risk; no Annex III category applies to animal monitoring. Art. 4 AI literacy applies. Art. 5 prohibition watch: if the same cameras are used to infer emotions or monitor performance of employees (stockhands, slaughterhouse workers), emotion recognition in the workplace is prohibited and worker evaluation may become high-risk (Annex III, employment). Keep the system scoped to animals and configure it so worker tracking is not a function [3].
  • GDPR: barns and slaughterhouses film staff, family members and visitors. Employee monitoring needs a legal basis, purpose limitation, works-council involvement (e.g. in Germany), transparency signs, masked zones or privacy-by-design framing, and short retention for raw footage [4].
  • Animal welfare law: Council Directive 98/58/EC (farmed animals), species-specific directives (calves, pigs, laying hens, broilers) and Regulation (EC) 1099/2009 on killing; the Commission's planned revision of welfare legislation may add monitoring duties. Some Member States require CCTV in slaughterhouses; AI review can support but never replace the official veterinarian [5].
  • Mitigations: farm-level validation, human confirmation, data-ownership clauses, network segmentation.

Getting started

  1. Pick one concrete problem (e.g. lameness in dairy, tail biting in pigs) and define the ground truth with your vet (score protocol, e.g. Welfare Quality / locomotion scoring).
  2. Run a 4-8 week pilot of one or two Path A products on one barn and compare alerts against vet findings.
  3. Decide data ownership, retention, staff information and works-council consent before installing cameras.
  4. Mount cameras for the task (walkway, parlour exit, over pen), keep lenses clean, and log changes.
  5. If building, collect a labelled dataset across at least several farms and hold out whole farms for testing.

Sources

  1. Welfare Quality Network, protocols and assessment of animal welfare — https://www.welfarequalitynetwork.net/
  2. EFSA, animal welfare topic page — https://www.efsa.europa.eu/en/topics/topic/animal-welfare
  3. Regulation (EU) 2024/1689 (AI Act), Art. 5 and Annex III — https://eur-lex.europa.eu/eli/reg/2024/1689/oj
  4. EDPB, Guidelines 3/2019 on processing of personal data through video devices — https://www.edpb.europa.eu/our-work-tools/our-documents/guidelines/guidelines-32019-processing-personal-data-through-video_en
  5. Council Directive 98/58/EC on the protection of animals kept for farming purposes — https://eur-lex.europa.eu/eli/dir/1998/58/oj
  6. Regulation (EC) No 1099/2009 on the protection of animals at the time of killing — https://eur-lex.europa.eu/eli/reg/2009/1099/oj
  7. DeepLabCut — https://github.com/DeepLabCut/DeepLabCut
  8. Ultralytics YOLO documentation — https://docs.ultralytics.com/
  9. DINOv2 (Meta) — https://github.com/facebookresearch/dinov2