Pig detection: Datasets & Models
Detect and locate individual pigs in images and video from barn or pen cameras. Useful for counting animals, monitoring movement, and building the foundation for automated livestock analytics.
Pig detection
Pig detection is a computer vision workflow that locates individual pigs and draws bounding boxes around each animal in a scene. It takes still images or video frames from barn or pen cameras as input and returns the position and count of every pig detected, providing a base for counting, movement tracking, and other livestock analytics.
Try it out
Powered by general detection model
Run on custom image
Drop an image here or click to upload
Why automate pig detection
Manually monitoring pigs across a large operation is labor intensive and error prone: counting animals by hand, spotting a downed pig, or checking pen occupancy requires staff to physically walk the barn throughout the day. Automating pig detection with a model like RF-DETR lets a system continuously watch every pen and flag conditions that need attention, without adding headcount. For agriculture teams, this means catching issues like overcrowding, isolation, or missing animals earlier and with consistent accuracy. It also turns raw camera video into structured data you can act on.
Key benefits
Reliable per-frame counts and animal localization power downstream tasks like behavior monitoring, weight estimation, and welfare alerts, and the model runs on the RGB cameras many barns already have installed. RF-DETR offers strong detection accuracy on crowded, overlapping animals, and the workflow scales from a single trial pen to entire multi-barn facilities. Because detections are structured outputs, they integrate cleanly with existing farm management dashboards and automation systems.
How to use it
- Upload an image: Drop any photo into the widget above to try pig detection for free, right on this page.
- Preview instant results: The model detects pig, piglet, feeder, water dispenser, pen fence within seconds and returns an annotated image with structured predictions, so you can immediately see how well it works. Adjust the detection classes and re-run until the results fit your scenario.
- Like what you see?: With a free Roboflow account, you can deploy this workflow with the Serverless Cloud API, customize it in your workspace, or train RF-DETR on your own images for production accuracy.
- Get started for free: No code or training data required to begin: upload, review the results, and make it part of your stack in a single click.
Recommended model for pig detection
RF-DETR is state of the art for real-time object detection, instance segmentation, and keypoint detection, with higher accuracy and lower latency than comparable models, and it's Apache 2.0 licensed. When you're ready to build a production model for pig detection, fine-tune it on your own labeled images, then deploy to a Serverless Cloud API endpoint.
Not sure where to start?
Describe your Pig Detection project to Roboflow Agent.