FeedRight Overview
Comprehensive documentation for the FeedRight intelligent fish feeding optimisation system.
What is FeedRight?
FeedRight is an AI-powered fish feeding optimisation system designed for open-sea cage aquaculture. It combines real-time video analysis with deep reinforcement learning to decide when, how much, and whether to feed fish in each cage — maximising feed conversion efficiency while minimising waste and environmental harm.
The system replaces manual or timer-based feeding schedules with a closed-loop agent that continuously observes cage conditions and adapts its behaviour over time through real-world feedback.
Key Capabilities
| Capability | Description |
|---|---|
| YOLO-based fish & pellet detection | Fine-tuned YOLO models detect individual fish (for biomass estimation) and uneaten pellets (for waste measurement) in real time. |
| Optical-flow behaviour analysis | Farnebäck dense optical flow quantifies motion intensity, feeding frenzy, and surface activity from consecutive video frames. |
| DQN-based feeding agent | A Deep Q-Network trained with Stable-Baselines 3 selects one of 6 discrete feed actions every decision step. |
| 44-dimensional state vector | Environmental sensors, biomass estimates, video features, feeding history, cage performance and physical cage properties are fused into a single observation. |
| Safety constraint layer | Hard-coded rules override the agent when dissolved oxygen, temperature, wind speed or feeding frequency cross critical thresholds. |
| Adaptive retraining | Real-world experiences are stored in a SQLite database and periodically replayed into the model's replay buffer for continuous improvement. |
System Flow (High-Level)
┌──────────────────────────────────────────────────────────────────┐
│ DATA SOURCES │
│ Underwater Camera ─► YOLO Fish Model (biomass estimation) │
│ ─► YOLO Pellet Model (waste detection) │
│ ─► Optical Flow (motion & frenzy) │
│ IoT Sensors ─► Environmental features (DO, temp, etc.) │
│ Farm Database ─► Feeding history & cage metadata │
└──────────────┬───────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────┐
│ STATE CONSTRUCTION (44 features) │
│ Environmental (13) + Biomass (6) + Video (5) + Feeding │
│ History (9) + Performance (5) + Cage (6) │
│ All normalised to [0, 1] │
└──────────────┬───────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────┐
│ DQN AGENT (Stable-Baselines 3) │
│ MlpPolicy [512 → 256 → 128 → 64] ─► Q(s, a) for 6 actions │
│ Double DQN • ε-greedy exploration • γ = 0.99 │
└──────────────┬───────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────┐
│ SAFETY CONSTRAINT LAYER │
│ DO < 4.5 mg/L → block │ Temp > 31 °C → block │
│ Feeds ≥ 6/day → block │ Wind > 15 m/s → block │
│ Low O₂ → reduce amount │ High waste → reduce amount │
└──────────────┬───────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────┐
│ FEED ACTUATOR │
│ Dispatches one of 6 actions: │
│ 0 kg │ 0.5 kg │ 1.0 kg │ 2.0 kg │ 3.5 kg │ 5.0 kg │
└──────────────┬───────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────────┐
│ OUTCOME OBSERVATION │
│ Actual consumption measured ─► Reward calculated │
│ Experience (s, a, r, s') stored to SQLite │
│ Periodic adaptive retraining from real data │
└──────────────────────────────────────────────────────────────────┘Quick Links
- Architecture — detailed component diagram and data flow
- DQN Agent Model — Deep Q-Network formulation, MLP architecture, and production inference
- Input Features — all 44 observation dimensions explained
- Reward System — how the agent is rewarded and penalised
- Training — pretraining pipeline, callbacks, checkpointing, and evaluation
- Safety Constraints — hard safety overrides applied in production
- Adaptive Learning — experience database and continuous retraining loop