IntroductionComputer vision and deep learning methods, particularly convolutional neural networks (CNNs), are increasingly used in precision aquaculture for analysing fish behaviour and appearance. These approaches have been successfully applied to tasks such as feeding monitoring, welfare assessment, and behavioural classification in tanks and sea cages (Føre et al., 2018; Yang et al., 2020). However, the vast majority of existing studies rely on offline processing, in which video data are first recorded and then analysed. Even though many works report that their methods are capable of real-time performance, this is typically demonstrated on pre-recorded datasets rather than during ongoing experiments (Zhao et al., 2019). As a result, these approaches do not allow immediate access to behavioural parameters or intervention during the experiment, and they require the recording and storage of large datasets. In contrast, online/real-time (where analysis is performed during the experiment performance) data processing has been experimentally shown in other domains to enable closed-loop systems, adaptive control, and fundamentally new experimental paradigms (Stowers et al., 2017). Online processing can be performed on-site using specialised low-cost GPU units, without the need to store or transmit data. Such capabilities allow researchers to monitor ongoing processes, detect unexpected events, and dynamically adjust experimental conditions. Despite these advantages, online processing remains largely underutilised in aquaculture research.
In this study, we demonstrate the feasibility and potential benefits of online video analysis in aquaculture by detecting and precisely localising spawning events for artificial pikeperch reproduction.
Materials and Methods
Spawning experiments were recorded using 9 IP cameras under controlled conditions. The fish pair was kept in 1m3 experimental tank with low-light underwater illumination and an artificial nest for several days. The fish exhibits a rotational pattern over the nest during the pre-spawning and spawning periods. Video streams from all tanks were recorded and observed by trained personnel to detect the egg release event. The spawning event is characterised by a short-term increased speed of fish-pair rotation and a curved fish body shape. The video streams were processed using an embedded low-cost computing platform, NVIDIA Jetson Nano. Fish detection was performed using the YOLOv8n model to predict oriented bounding boxes, enabling the estimation of fish position and orientation even under challenging conditions (e.g., overlap and low illumination). The model was trained from existing experiments and applied to the new experiment in the online/real-time regime.
Spawning behaviour was determined by analysing the mutual rotation of fish pairs above the nest. The angular change between consecutive frames was computed and transformed into rotational velocity. To robustly capture behavioural dynamics, the signal was smoothed using two temporal windows (3 s and 20 s). Spawning events were detected when the difference between short-term and long-term rotational activity exceeded a defined threshold, reflecting a rapid increase in spinning behaviour preceding spawning (see Fig 1).
The method was evaluated on annotated video recordings containing both confirmed spawning events and control sequences without spawning and during the spawning experiment.
Results and Discussion
The proposed approach successfully detected spawning events across multiple recordings and streaming, while no false detections were observed in control sequences without spawning. A short delay (~3 s) was introduced due to temporal smoothing, which remains acceptable for real-time applications. Immediately after the spawning detection, the eggs were extracted from the fish and used for artificial reproduction. This approach increases the accuracy of the pikepearch reproduction.
This work illustrates the broader advantages of transitioning from offline to online analysis. Online/real-time processing provides immediate access to behavioural parameters, enabling continuous monitoring and allowing researchers to intervene during the experiment. This can improve experimental efficiency, reduce data redundancy, and support adaptive experimental design. The presented fish spawning detection serves as a proof of concept demonstrating that current computational resources already allow online analysis of complex behavioural events in aquaculture. The transition from offline to online processing has the potential to significantly enhance both experimental research and practical applications in precision aquaculture.
Figure 1. Example of rotational activity processing. Green lines represent fish orientation. The red line indicates that the fish are close to each other, parallel, and it is used for pair rotation velocity calculation.
Acknowledgment
This work was carried out with the support of VVI CENAKVA Research Infrastructure (ID 90238, MEYS CR, 2023–2026).
References
Føre, M., Frank, K., Norton, T., Svendsen, E., Alfredsen, J. A., Dempster, T., et al. (2018). Precision fish farming: A new framework to improve production in aquaculture. Biosystems Engineering, 173, 176–193.
Stowers, J. R., Hofbauer, M., Bastien, R., Griessner, J., Higgins, P., Farooqui, S., et al. (2017). Virtual reality for freely moving animals. Nature Methods, 14, 995–1002.
Yang, H., Shao, X., Wu, H., & Tang, Y. (2020). Application of computer vision in fish behaviour analysis: A review. Aquaculture, 529, 735642.
Zhao, Z., Li, Y., Wan, X., & Luo, J. (2019). Fish feeding intensity recognition based on convolutional neural networks. Aquacultural Engineering, 85, 95–101.