Abstract:The intelligent automation of shrimp larvae farming demonstrates great potential in improving farming efficiency and reducing labor costs. Tracking technology for shrimp larvae is of significant value for in-depth research on their vitality and quality. Due to the small size, semi-transparency, and high density of shrimp larvae, traditional methods often face many challenges: small targets are easily missed, detection accuracy is low under high density, and tracking errors are high due to the similar appearance and fast movement of shrimp larvae. To address these issues, focusing on P15 stage Pacific white shrimp larvae, a tracking method was proposed based on an improved YOLO v8. Firstly, an improved YOLO v8 network was selected as the detector, with CARAFE replacing YOLO v8’s Upsample layer. CARAFE’s adaptive upsampling preserved the semi-transparent edges and morphological features of shrimp larvae, reducing distortion. The backbone network was optimized by using the BiFormer attention mechanism and the C2f-BFB module, which enhanced precision in handling small targets while keeping the model lightweight. Finally, the original model’s CIoU loss was replaced with the Wise-Focaler-ShapeIoU loss function, further improving detection accuracy. A matching strategy that combined distance and angle matching algorithms was also proposed, and the pyramid LK optical flow method was introduced, constructing an accurate and stable tracker that effectively addressed tracking errors caused by the fast movement and similar appearance of shrimp larvae. Experimental results showed that the improved YOLO v8 achieved a 1.1 percentage points increase in mAP@0.5 and a 2.9 percentage points increase in recall rate compared with that of the original model, significantly reducing missed detections and improving detection accuracy. The proposed tracker achieved a MOTA of 74.52%, MOTP of 75.62%, and IDF1 of 76.42%. Compared with DeepSORT, SORT, and ByteTrack algorithms, MOTA was significantly improved, demonstrating excellent tracking performance. The research result can provide strong technical support for the automation of shrimp larvae farming and offer ideas and methods for related research fields.