Calvingcatcher
Check out the website for all the information:
cowcatcherai.com
The website is available in multiple languages such as Deutsch, Français, Nederlands, and Español.
We built Calvingcatcher to keep an eye on the maternity pen so we don't have to walk out to the barn
every hour through the night. It is a vision model that detect the visual signs of calving
in cattle from ordinary barn cameras, and it forms the vision core of our CalvingCatcher system — an
extra pair of eyes that watches 24/7.
We are farmers, and we trained these models on our own barn footage. Instead of predicting a single
"calving" label, we detect the individual signs we would look for ourselves — the water bag, protruding
legs, a head coming through. That way the system around the model can reason about how far along a cow
is, not just whether something is happening.
Our latest and best model is CalvingcatcherV9.pt. It is what we run ourselves.
What we detect
| ID | Class | What it marks |
|---|
| 1 | waterbag | Visible amniotic sac — the first hard evidence of active calving |
| 2 | legs | Calf legs protruding |
| 3 | head | Calf head visible |
| 4 | body | Calf body emerging |
| 5 | calf | Newborn calf on the ground |
The detection head carries one further class from an earlier experiment that we no longer use in
production. Ignore anything outside the five classes above.
The models
| File | Base | Train imgsz / epochs | Size | Notes |
|---|
CalvingcatcherV9.pt | yolo26m | 1024 / 150 | 44 MB | What we recommend. Best precision and recall we have |
calvingcatcherV8.pt | yolo26m | 1024 / 150 | 44 MB | Our previous main model |
CalvingcatcherV7.pt | yolo26m | 960 / 150 | 44 MB | Older 960 px generation, fewer false positives than V8 |
All three are Ultralytics 8.4.14 yolo26m detection models.
Getting started
1from ultralytics import YOLO
2
3model = YOLO("CalvingcatcherV9.pt")
4
5results = model.predict("pen_frame.jpg", imgsz=1024, conf=0.40)
6
7for r in results:
8 for box in r.boxes:
9 print(r.names[int(box.cls)], float(box.conf), box.xyxy.tolist())
1# Live camera / RTSP stream
2for result in model.predict(source="rtsp://camera/stream", stream=True, imgsz=1024, conf=0.40):
3 labels = {result.names[int(b.cls)] for b in result.boxes}
4 if "waterbag" in labels or "legs" in labels:
5 print("Possible calving in progress:", labels)
Run V9 and V8 at imgsz=1024 and V7 at imgsz=960 — that is what we trained them at. Dropping
back to the 640 default costs a noticeable amount of recall on small, distant subjects.
How our models compare
Precision, recall and total false positives across the versions we trained. M/S/L are the
Ultralytics size variants, the number is the training resolution.
| Version | Model | Precision % | Recall % | Total FP |
|---|
| V9 | M1024 (epoch 76) | 85.9 | 49.6 | 237 |
| V8 | M1024 | 82.3 | 44.7 | 305 |
| V8 | S1024 | 84.4 | 38.2 | 177 |
| V7.1 | L640 | 74.6 | 35.1 | 412 |
| V7 | M960 | 84.1 | 41.4 | 208 |
| V6 | M960 | 80.4 | 35.0 | 220 |
| V5.1 | M960 | 76.3 | 26.7 | 234 |
| V5 | M960 | 77.7 | 17.3 | 77 |
V9 comes out ahead on both precision and recall. Our recall has roughly tripled since V5 (17.3% →
49.6%) and precision climbed along with it.
How to read those numbers
The recall looks low next to a typical single-class detector, and we want to be upfront about why. This
is a hard problem: the things we look for are small, often partly hidden by the cow herself, and some of
them — a water bag, a pair of legs — are only visible from certain angles and for a limited window.
Every individual object in every individual frame counts against recall.
In daily use we don't need to catch every object in every frame. The camera watches the pen
continuously, and one confident detection is enough to start recording. A calving lasts long enough that
~50% per-frame recall still catches the event reliably. What matters far more to us is precision — we
don't want to be woken for nothing.
If you run these weights standalone, the confidence threshold is your main dial: raise it to cut false
alarms, lower it to catch earlier and weaker signs.
How we use them
- An IP camera streams the maternity pen over RTSP.
- The model analyses a frame every few seconds.
- On a reliable detection we start collecting frames and record several seconds of footage, so we have
enough material to pick good imagery from.
- The clearest images go straight to our phones through Telegram or Home Assistant, with the
confidence score, so we can judge the situation before pulling on our boots.
Everything runs locally on the farm. No footage leaves the premises.
What you need to run it
- A consumer-grade PC, preferably with an NVIDIA GPU (GTX 1000-series or newer)
- One or more IP/WiFi cameras reachable over RTSP
- A PoE switch to power the wired cameras
- LAN cabling for a stable connection
- An internet connection to send the alerts
What it won't do
- It will occasionally raise a false alarm. Precision is good, not perfect.
- It does not read ear tags. It tells you something is happening in the pen, not which animal it is.
- It does not replace walking the barn. We treat it as a monitoring aid; physical checks stay
essential and a stockman's judgement is still indispensable.
- Detection quality depends on camera placement, lighting and how much of the cow you can see. Heavy
occlusion, awkward angles and very distant views are the hard cases.
- The machine has to stay powered and online, or no alert arrives.
- We trained on our own barns only — there is no imagery from other farms in here. Good for privacy, but
a barn that looks very different from ours may need extra data.
License
AGPL-3.0.
We train these weights with
Ultralytics, which is licensed
under AGPL-3.0. Every checkpoint here carries the Ultralytics AGPL-3.0 notice in its metadata, so the
derived weights inherit that license.
In practice: if you use these models in a network-accessible service, AGPL-3.0 requires you to make the
corresponding source of that service available to its users. If that doesn't work for your deployment,
Ultralytics sells a commercial Enterprise License that removes the copyleft obligation — see
ultralytics.com/license.
See also:
Cowcatcher — our sibling model family
that detects mounting behaviour for heat detection.