CowCatcher AI is an open-source computer vision system designed to monitor your herd 24/7. By analyzing live footage from your barn cameras, it automatically detects "mounting" behaviorβthe primary sign of estrus (heat)βand instantly sends a photo notification to your smartphone via Telegram or combine it with your Home assistant setup.
Powered by eschouten/ai-detector This project utilizes the robust AI detection engine built by E. Schouten to run our custom-trained CowCatcher models.
The system acts as a tireless digital herdsman. It processes video streams locally on your farm and only notifies you when action is required.
π· barn camera footage βββ π€ AI Computer Vision βββ β‘ mounting detection βββ π½ save image βββ π² Telegram notification with image
- Easy Deployment: No Python, Anaconda, or complex environments to install. Just download and run.
- 24/7 Monitoring: Never miss a heat, even during the night.
- Instant Alerts: Get direct notifications with image proof sent to your phone.
- Data Privacy: All video processing happens locally on your machine. No video is sent to the cloud.
- Cost Effective: Free, open-source software. You only pay for your hardware.
Crucial: The AI is only as good as the video feed. For the best results:
- Height: Mount cameras 3-4 meters high to get a clear view over the cows.
- Angle: A downward angle (approx 45Β°) works best. Avoid flat, horizontal views where cows hide behind one another.
- Lighting: Ensure the area is lit at night, or use a camera with strong IR (Night Vision).
- Coverage: 1080p resolution is recommended. Avoid placing cameras facing directly into bright windows/sunlight.
Get started on any standard computer with up to 2 cameras. For those needing the full power of our real-time AI models, we recommend upgrading to specific hardware for optimal results.
| Component | Requirement |
|---|---|
| Graphics Card (GPU) | NVIDIA GTX 1000-series or newer (e.g., GTX 1060, RTX 2060, RTX 3060). Note: Older cards must use the Docker version. |
| Camera | Any IP Camera with RTSP support. Optimal is connect with Lan-cables |
| Internet | Required only for sending Telegram notifications. |
- Telegram App: Installed on your phone.
- AI Detector: The executable engine (instructions below).
Follow these four steps to get up and running in minutes.
You need a "Bot" to send you messages.
- Open Telegram and search for @BotFather.
- Send the message
/newbot. - Follow the prompts to name it (e.g.,
MyFarmAlertBot). - Copy the API Token provided (It looks like
123456:ABC-DEF1234...). - Search for @userinfobot in Telegram and send
/start. - Copy your ID (It is a number like
123456789).
Download the latest aidetector.exe from the repository that powers this tool:
π Download from AI Detector Releases
** link naar de uitleg video over de installatie https://youtu.be/MvbdJx7C3mM
- Create a new folder on your computer (e.g.,
C:\CowCatcher). - Move
aidetector.exeinto this folder. - Create a new text file in that folder named
config.json. - Paste the following code into that file:
{
"detectors": [
{
"detection": {
"source": "rtsp://admin:YourPassword123@192.168.100.22:554/h264Preview_01_sub"
},
"yolo": {
"model": "https://github.com/CowCatcherAI/CowCatcherAI/releases/download/modelv-14/cowcatcherV15.pt",
"confidence": 0.7,
"time_max": 50,
"timeout": 6,
"frames_min": 3
},
"exporters": {
"telegram": {
"token": "YOUR_BOT_TOKEN_HERE",
"chat": "YOUR_USER_ID_HERE",
"confidence": 0.87
},
"disk": {
"directory": "mounts"
}
}
}
]
}Important Edits:
- Token & Chat: Replace
YOUR_BOT_TOKEN_HEREandYOUR_USER_ID_HEREwith your values from Step 1. - Camera Source: Replace the
rtsp://...URL with your camera's specific address.- Tip: If you don't know your RTSP URL, check your camera manual or use a tool like "iSpy Connect Database" to find the format for your camera brand.
Double-click aidetector.exe. A black terminal window will open showing the detection logs. If you see text scrolling and no errors, the system is live!
The config.json file controls the behavior of the AI detector. Here is a breakdown of the available fields:
| Field | Description |
|---|---|
detectors |
A list of detector configurations. You can define multiple detectors for different cameras. |
| Field | Default | Description |
|---|---|---|
source |
A single RTSP URL (e.g., rtsp://...) or local file path. Can also be a list of sources. |
| Field | Default | Description |
|---|---|---|
model |
The URL or local path to the YOLO model weights (.pt file). |
|
confidence |
0.7 |
Minimum certainty (0.0 - 1.0) for a frame to count as a detection. |
frames_min |
1 |
Minimum number of positive frames required to trigger an event. |
timeout |
None |
Seconds of "silence" (no detection) before an event is considered finished. |
time_max |
60 |
Maximum duration (in seconds) for a single event window. |
Defines where the results are sent. All exporters can be a single object or an array of objects.
telegram: Sends notifications to your phone.token: Telegram Bot token.chat: Telegram Chat ID.confidence: (Optional) Specific confidence threshold for Telegram alerts.alert_every: (Optional) Send silent notifications, except every X detections.
disk: Saves images locally.directory: Folder name for saving images.confidence: (Optional) Specific confidence threshold for saving images.
If the AI is missing heats or sending false alarms, adjust the "confidence" value inside the yolo block in your config.json:
- 0.87 (Default): Balanced.
- 0.86 or lower: More sensitive (Detects more, but potential false alarms).
- 0.88 or higher: Stricter (Fewer false alarms, but might miss quick mounts).
- Note: You must restart the application after saving changes.
To monitor multiple areas, you can add more detector blocks to your config.
Click here to view a Multi-Camera Config Example
{
"detectors": [
{
"detection": {
"source": ["rtsp://192.168.1.50/stream1", "rtsp://192.168.1.52/stream1"]
},
"yolo": {
"model": "...",
"confidence": 0.7
},
"exporters": { ... }
}
]
}The black window opens and closes immediately:
This usually means there is a syntax error in your config.json.
- Ensure you didn't accidentally remove a quote
"or a comma,. - Ensure you pasted the raw link for the model, not a formatted link.
I am getting "Connection Failed" errors:
- Check that your computer is on the same network as the camera.
- Verify your RTSP stream URL in a media player like VLC to ensure it works.
For users with older GPUs or those running home servers, we provide a Docker image.
Prerequisites: Docker Compose and the NVIDIA Container Toolkit.
- Create a
compose.ymlfile:
services:
aidetector:
image: "ghcr.io/eschouten/ai-detector:latest"
volumes:
- ./config.json:/app/config.json:ro
- ./detections:/app/detections
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]- Place your
config.json(from Step 3 above) in the same directory. - Run the container:
docker compose up -d
Need help setting up your camera URL or tuning the AI? Join our community of farmers and developers.
- Facebook: CowCatcher AI Group
- Telegram: CowCatcher AI Chat
- Email: cowcatcherai@gmail.com
License: This project uses the GNU Affero General Public License v3.0 (AGPL-3.0). It is built upon Ultralytics YOLO.
- Notice: This software/model is NOT authorized for commercial use or distribution without permission.
Disclaimer:
Use at your own risk. This software is intended as a supplementary tool and does not replace professional veterinary knowledge or human observation. The AI may generate false positives or negatives; the user remains responsible for all final breeding decisions.
