A Computer Vision Pipeline for Real-Time Fish Population Monitoring in Aquaculture: From Dataset Curation to Deployment with YOLOv5s
Abstract
Automated fish counting in Recirculating Aquaculture Systems (RAS) is essential for improving efficiency but remains difficult due to challenging visual conditions and the high cost of commercial solutions. This study presents a cost-effective computer vision pipeline developed through an iterative, data-centric methodology to overcome these barriers. An initial pilot dataset, captured in a production RAS, diagnosed pervasive issues such as water glare and low contrast. These findings informed the design of a targeted preprocessing stage using Contrast Limited Adaptive Histogram Equalization (CLAHE) and directed subsequent acquisition of an enhanced second dataset with optimized hardware. To build a robust detection model, a two-stage training strategy was employed. A YOLOv5s model was first trained on the initial challenging data, and then fine-tuned on the enhanced, preprocessed dataset. A custom lightweight tracking algorithm was developed to maintain individual fish identities for accurate counting in dense populations. The complete system was integrated into a desktop application for practical deployment. Validation on independent operational videos demonstrated a high efficiency in real-world conditions. This work delivers an affordable alternative to expensive commercial monitoring systems, providing a scalable and practical tool for data-driven management that is particularly accessible to small and medium-sized aquaculture enterprises.