Animal behavior monitoring system
A pig activity monitoring system that automatically tracks animal behavior, detects early signs of disease, and estimates weight without stressful visual inspections.
Tasks
- Create a computer vision pipeline for detecting, tracking, and identifying pigs in video.
- Collect and annotate a dataset of behavioral patterns (lying, moving, eating).
- Develop a model for rapid weight estimation from video frames.
- Integrate a system for alerting on potential behavioral anomalies.

About the Project
A pig’s health is largely determined by its behavior—whether it lies down longer than usual, eats actively, or moves around the pen.
A computer system was developed that uses video cameras and markers on the animals’ backs to record each pig’s actions, collect behavioral statistics, and signal deviations in real time. This significantly reduces the workload on staff, minimizes animal stress, and consequently reduces weight gain losses.
By integrating these solutions, the farm receives a continuous stream of analytics and can quickly respond to any signs of animal distress.
Results

Challenges and Solutions
The main challenge was that pigs move actively and often overlap, and the markers on their backs may be temporarily obscured.
- Animal Overlaps
- Fine-tuned YOLOv5 on custom samples to reliably distinguish even partially occluded individuals.
- Loss of Tracking During Rapid Movements
- Improved DeepSORT settings (speed and size correction) and introduced re-identification via OSNet, reducing false track breaks.
- Weight Estimation Accuracy
- Applied a regression model using the body’s projected area and the camera’s relative position; validation on a control group showed a 10% error.
Related Services
Ready to discuss your project?
Describe your task, we will make a research and respond to you as soon as possible.