基于改进YOLOv8和多目标跟踪的鱼苗计数方法

    Fry counting method using improved YOLOv8 and multi-target tracking

    • 摘要: 水产养殖业中鱼苗的数量检测是一个重要环节。针对传统的人工计数方法效率低、精度差、易造成鱼苗应激和损伤等问题,该研究以体长20~50 mm的草鱼苗为检测对象,提出了一种基于改进YOLOv8和多目标跟踪的小鱼苗计数方法。根据鱼苗目标小且检测速度要求高的特点,在YOLOv8算法中引入了P2小目标检测层,同时在检测头前添加GAM(global attention mechanism)注意力机制,并将目标识别损失函数优化为Inner-SIoU(inner-SCYLLA- intersection over union)损失函数以加快模型的收敛速度、提高对小目标和重叠目标的识别准确率;然后,针对检测识别到的鱼苗目标,结合多目标跟踪算法实现了一种适用于小鱼苗的跟踪计数方法。最后通过设计鱼苗计数试验平台、采集制作数据集、训练计数模型并进行计数试验验证该计数方法的优点和性能指标。试验结果表明,平均计数精度、平均绝对误差、均方根误差分别为97.16%、3.67、5.26,各项指标优于YOLOv5+DeepSORT、YOLOv8+DeepSORT、YOLOv8+StrongSORT 、YOLOv8+ByteTrack、YOLOv8+BoT-SORT等方法。该研究方法能够以更快的速度和更高的准确性统计视频中小鱼苗数量,为工厂化水产养殖的鱼苗快速准确计数、生物量估计等奠定了基础。

       

      Abstract: Fry counting can play a pivotal role in the aquaculture industry. However, manual counting cannot fully meet the large-scale production in recent years, due to the inefficient, low precision, and even damage to the fry. In this study, a new fry counting was proposed using improved YOLOv8 and multi-target tracking. The objects were taken as the grass carp fry with the body lengths ranging from 20 to 50 mm. Firstly, the test platform was designed, according to the test requirements. Eight fry videos were then captured to extract and screen 961 valid images as the initial dataset. Then augmentation operations were performed on the data, including motion blur, brightness adjustment, noise increase, and image flipping. 2285 images dataset was divided into the training set and testing set in the ratio of 9∶1. P2 small layer of target detection was then added into the YOLOv8, due to the small fry targets and high detection speed. While the GAM (global attention mechanism) was introduced in front of the detection head, and the Inner-SIoU (Inner-SCYLLA- Intersection over Union) loss function was used to accelerate the convergence speed of the model for the better recognition accuracy of small and overlapping targets. The YOLOv8 detector was trained with the following settings: initial learning rate of 0.01, moments of 0.9, weight decay of 0.0005, batch size of 16, and 300 training rounds. The image processing computer was a 12th Gen Intel(R) Core (TM) i7-12700H 2.70 GHz, with an operating system of 64-bit Windows 11 system with 24 G of system memory. After that, a tracking and counting approach was realized for fry counting using BoT-SORT multi-target tracking with motion feature matching, eight-element Kalman filter, and camera motion compensation and discarding the appearance feature matching module. The tracking of fry targets was realized for the fry targets. Finally, the performance of the improved model was also evaluated, in terms of merits and performance. The ablation tests showed that the improved model was significantly promoted the counting performance, compared with the pre-improved model; Comparative test results showed that the average counting accuracy (ACP), average absolute error (MAE), and root mean square error (RMSE) were 97.16%, 3.67, and 5.26, respectively. The indexes of improved model were better than those of YOLOv5+DeepSORT, YOLOv8+DeepSORT, YOLOv8+StrongSORT, YOLOv8+ByteTrack, and YOLOv8+BoT-SORT; The comparative tests showed that the counting performance was negatively correlated with the speed of the fry through the shooting area. Once the speed was too high, the tracker was caused the insufficient inference speed, leading to a decline in the counting accuracy. The number of small fries were found in the video with the higher speed and accuracy than before. The finding can lay the strong foundation for the rapid and accurate counting of fry on the biomass estimation in factory aquaculture.

       

    /

    返回文章
    返回