Run this model with HF Jobs
Run CowcatcherAI/Cowcatcher on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/CowcatcherAI/Cowcatcher. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/CowcatcherAI/Cowcatcher on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use CowcatcherAI/Cowcatcher with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use CowcatcherAI/Cowcatcher with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("CowcatcherAI/Cowcatcher", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Upload 6 files
Browse filesFiles changed (5)
- README.md+189-1
- cowcatcherV13.ptAdded+3
- cowcatcherV14.ptAdded+3
- cowcatcherV15.ptAdded+3
- cowcatcherV16.ptAdded+3
123---license: lgpl-3.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191---license: agpl-3.0library_name: ultralyticspipeline_tag: object-detectiontags:- yolo- ultralytics- object-detection- agriculture- livestock- cattle- estrus-detection- computer-vision---# CowcatcherCowcatcher is a family of YOLO models that detect **mounting behaviour** in cattle from camera images.Mounting is one of the clearest visual signals that a cow is in heat, so a reliable detector lets a barncamera flag oestrus automatically instead of relying on someone watching the herd.All models are single-class (`mounting`) Ultralytics models, trained at 640 px on farm camera footagefrom multiple dairy and beef sites, in daylight, night/IR and robot-barn conditions.**Latest and best model: `cowcatcherV17.2.pt`.** It is the only model in the comparison that produces**zero false alarms** on the null set, at any threshold from 0.50 upward.---## Available models| File | Task | Base | Train imgsz / epochs | Size | Notes ||---|---|---|---|---|---|| **`cowcatcherV17.2.pt`** | Detection | `yolo26m` | 640 / 50 | 44 MB | **Recommended.** Best precision and best confidence separation || `cowcatcherV17.pt` | Detection | `yolo26m` | 640 / 400 | 131 MB | Previous main model, higher recall at low thresholds || `cowcatcherV16.pt` | Detection | `yolo26m` | 640 / 400 | 88 MB | Highest recall at 0.88, but 21 false alarms || `cowcatcherV15.pt` | Detection | `yolo12m` | 640 / 100 | 81 MB | Older generation || `cowcatcherV14.pt` | Detection | `yolo12m` | 640 / 100 | 41 MB | Older generation, very few false alarms but low recall || `cowcatcherV13.pt` | Detection | `yolo12m` | 640 / 100 | 81 MB | Oldest published model, kept for reference || `cowcatcherV1-seg.pt` | Segmentation | `yolo11m` | 640 / 100 | 45 MB | Experimental mask model, not part of the benchmark below |All six detection models are published here and all six appear in the benchmark tables below.---## Quick start```bashpip install ultralytics``````pythonfrom ultralytics import YOLOmodel = YOLO("cowcatcherV17.2.pt")# Single imageresults = model.predict("barn_frame.jpg", conf=0.50)for r in results:for box in r.boxes:print("mounting", float(box.conf), box.xyxy.tolist())``````python# Live camera / RTSP streamfor result in model.predict(source="rtsp://camera/stream", stream=True, conf=0.50):if len(result.boxes):print("Mounting detected")```### Which confidence threshold?For `cowcatcherV17.2` the false-positive count stays at **0** across the entire 0.50β0.99 sweep, so thethreshold only trades away recall. F1 peaks at **0.50**; anything up to ~0.80 is still a sensibleoperating point if you want extra headroom.| Threshold | Found (TP) | Missed (FN) | False alarms | Recall | Precision | F1 ||---|---|---|---|---|---|---|| **0.50** | 896 | 4 | 0 | 99.56% | 100% | **99.78%** || 0.60 | 892 | 8 | 0 | 99.11% | 100% | 99.55% || 0.70 | 879 | 21 | 0 | 97.67% | 100% | 98.82% || 0.80 | 869 | 31 | 0 | 96.56% | 100% | 98.25% || 0.88 | 822 | 78 | 0 | 91.33% | 100% | 95.47% || 0.92 | 638 | 262 | 0 | 70.89% | 100% | 82.96% || 0.95 | 125 | 775 | 0 | 13.89% | 100% | 24.39% |---## Benchmark**Test set:** 1000 held-out images β 900 real mounting events and 100 null/noise images (cattle, barnsand robots without mounting). Six models evaluated on 2026-07-23.Of the 900 mounting events, 11 are found by *no* model at 0.88, and 536 are missed by at least one model.### Performance at threshold 0.88| Model | Recall % | Precision % | F1 % | False alarms | Missed | Accuracy % | ms/image ||---|---|---|---|---|---|---|---|| **cowcatcherV17.2** | 91.33 | **100.00** | 95.47 | **0** | 78 | 92.2 | 24.1 || cowcatcherV16 | **96.33** | 97.64 | **96.98** | 21 | 33 | 94.6 | 24.4 || cowcatcherV17 | 86.89 | 99.11 | 92.60 | 7 | 118 | 87.5 | 24.3 || cowcatcherV15 | 74.44 | 97.95 | 84.60 | 14 | 230 | 75.6 | 27.3 || cowcatcherV14 | 65.00 | 99.66 | 78.68 | 2 | 315 | 68.3 | 27.4 || cowcatcherV13 | 50.11 | 99.34 | 66.62 | 3 | 449 | 54.8 | 29.0 |Note that 0.88 is a legacy production threshold. It suits V16, but it sits far above the optimum forV17.2 β see the next table.### Best achievable operating point (max F1)| Model | Best threshold | Found | Missed | False alarms | Recall % | Precision % | F1 % ||---|---|---|---|---|---|---|---|| **cowcatcherV17.2** | 0.50 | 896 | 4 | **0** | 99.56 | **100.00** | **99.78** || cowcatcherV17 | 0.50 | 897 | 3 | 14 | 99.67 | 98.46 | 99.06 || cowcatcherV14 | 0.50 | 886 | 14 | 24 | 98.44 | 97.36 | 97.90 || cowcatcherV16 | 0.80 | 891 | 9 | 33 | 99.00 | 96.43 | 97.70 || cowcatcherV15 | 0.61 | 894 | 6 | 41 | 99.33 | 95.61 | 97.44 || cowcatcherV13 | 0.50 | 867 | 33 | 24 | 96.33 | 97.31 | 96.82 |### Confidence separationThe gap between the mean confidence on real mounts and on null images decides how easy the model is tothreshold. V17.2 is in a different class here: it is almost silent on noise (mean 0.008) while stayingconfident on real events (mean 0.918).| Model | Avg conf β real mounts | Avg conf β null noise | Margin ||---|---|---|---|| **cowcatcherV17.2** | 0.9180 | **0.0079** | **0.9101** || cowcatcherV17 | 0.9026 | 0.1469 | 0.7557 || cowcatcherV14 | 0.8718 | 0.2215 | 0.6503 || cowcatcherV13 | 0.8409 | 0.2250 | 0.6159 || cowcatcherV16 | 0.9316 | 0.4190 | 0.5126 || cowcatcherV15 | 0.8893 | 0.3875 | 0.5018 |The same effect shows in the safety margin (5th percentile of real mounts minus 95th percentile ofnulls). Every other model is negative β its distributions overlap β while V17.2 reaches **+0.827**:| Model | Lowest conf on a real mount | Highest conf on a null | P05 mounts | P95 nulls | Safety margin ||---|---|---|---|---|---|| **cowcatcherV17.2** | 0.1558 | 0.4382 | 0.8450 | 0.0176 | **+0.8274** || cowcatcherV16 | 0.0051 | 0.9304 | 0.8866 | 0.9130 | β0.0264 || cowcatcherV17 | 0.4547 | 0.9107 | 0.8251 | 0.8907 | β0.0656 || cowcatcherV15 | 0.4584 | 0.9060 | 0.8194 | 0.8965 | β0.0772 || cowcatcherV14 | 0.0004 | 0.8925 | 0.7553 | 0.8407 | β0.0854 || cowcatcherV13 | 0.0001 | 0.8995 | 0.6154 | 0.8643 | β0.2489 |### Confidence distribution on null imagesNumber of null images falling in each confidence bin β lower and further left is better.| Bin | V13 | V14 | V15 | V16 | V17 | **V17.2** ||---|---|---|---|---|---|---|| 0.00β0.20 | 68 | 70 | 51 | 47 | 79 | **99** || 0.20β0.60 | 11 | 6 | 6 | 7 | 9 | **1** || 0.60β0.86 | 15 | 19 | 28 | 17 | 4 | **0** || 0.86β0.94 | 6 | 5 | 15 | 29 | 8 | **0** || 0.94β1.00 | 0 | 0 | 0 | 0 | 0 | **0** |---## Choosing a model- **Default choice β `cowcatcherV17.2`.** Best F1, zero false alarms, widest usable threshold window.Pick this unless you have a specific reason not to.- **`cowcatcherV16`** still has the highest raw recall at the legacy 0.88 threshold, but pays for it with21 false alarms out of 100 nulls and heavily overlapping confidence distributions.## Limitations- Single class only: the model detects mounting, not cow identity, lameness or other behaviours.- Trained and evaluated on fixed barn cameras. Very different mounting angles, heavy occlusion orunusual camera placements are under-represented.- The 100-image null set is small; a false-positive rate of 0 on it should be read as "no false alarmsobserved", not as a guarantee.- Benchmark timings (24β29 ms/image) were measured on the evaluation machine and will differ on otherhardware.## License**AGPL-3.0.**These weights are trained with [Ultralytics](https://github.com/ultralytics/ultralytics), which islicensed under AGPL-3.0. Every checkpoint in this repository carries the Ultralytics AGPL-3.0 notice inits metadata, so the derived weights inherit that license.In practice this means that if you use these models in a network-accessible service, AGPL-3.0 requiresyou to make the corresponding source of that service available to its users. If that does not work foryour deployment, Ultralytics sells a commercial Enterprise License that removes the copyleft obligation βsee [ultralytics.com/license](https://www.ultralytics.com/license).
123version https://git-lfs.github.com/spec/v1oid sha256:5560374b8a3332e6de1657cdcf054c2ac5ef2bc51005933befe71d9fd0d88af3size 81188056123version https://git-lfs.github.com/spec/v1oid sha256:1b82708414a67ed665ad243e2277cf4f1dbcec62b2c17aa3727046e4c6b00727size 40746087123version https://git-lfs.github.com/spec/v1oid sha256:5df35e19b3ffe7de65a32bbe74aede8503f33650f811c53eb70e3a1caf74b0fcsize 81188517123version https://git-lfs.github.com/spec/v1oid sha256:65b2d269296d686233da60e540beae8d2548d775f7aefc1b76471bc0069bee9csize 87757764README.md+189-1
cowcatcherV13.ptAdded+3
cowcatcherV14.ptAdded+3
cowcatcherV15.ptAdded+3
cowcatcherV16.ptAdded+3