Three-layer PLF engine monitoring 1,242 laying hens at Boonducks Farm, South Africa. YOLOv8-nano vision, XGBoost acoustic stress detection, TimescaleDB telemetry — all on Jetson Orin Nano edge AI.
# Agentic Poultry Monitoring — Boonducks Farm PLF Engine
**A three-layer Precision Livestock Farming (PLF) engine deployed at Boonducks Farm, South Africa.** Monitors 1,242 laying hens across 8 coops using edge AI computer vision, acoustic stress detection, and environmental IoT telemetry.
| Coop Type | Count | Capacity |
|-----------|-------|----------|
| 🏭 Cage Coops | 2 (C1, C2) | 312 + 310 hens |
| 🌿 Deep Litter Coops | 6 (L3–L8) | 104 hens each |
| **Total** | **8 coops** | **1,242 hens** |
---
## Architecture
### Layer 1 — Edge (In-Coop Inference)
- **NVIDIA Jetson Orin Nano Super** (67 TOPS, TensorRT-optimized)
- **YOLOv8-nano** bird detection + Huddling Index from overhead cameras
- **XGBoost** acoustic stress classification from USB/I2S microphones
- Only anomaly JSON forwarded to fog layer — preserves bandwidth
### Layer 2 — Fog (Farm Office Server)
- **TimescaleDB** hypertables for environmental telemetry
- **Express.js** API serving continuous aggregates to dashboard
- **Modbus RTU RS485** daisy-chain for XY-MD02 temp/humidity and NH3 probes
- **Hikvision 4MP PoE** cameras for vision feed
### Layer 3 — Cloud (Future)
- Federated learning across farms
- Remote dashboard access
- Automated model retraining from cross-farm outbreak patterns
---
## Repository Structure
```
├── vision_analyzer.py # YOLOv8-nano bird detection + Huddling Index
├── acoustic_analyzer.py # XGBoost stress classification (MFCC features)
├── telemetry_worker.py # Modbus RTU sensor polling + TimescaleDB ingestion
├── server.js # Express.js API server (sim/live modes)
├── schema.sql # TimescaleDB hypertable definitions
├── client/ # Dashboard frontend (React + Vite)
├── scripts/ # Deployment and utility scripts
├── Dockerfile # Containerized deployment
├── docker-compose.yml # Multi-service orchestration
├── SETUP_GUIDE.md # Complete hardware + software installation guide
└── …