Abstract:To address the issues of blurred, low-contrast underwater images collected due to equipment movement and camera defocusing, as well as the low detection accuracy caused by small target sizes, an improved real-time seafood detection algorithm based on YOLOv5s was proposed. Firstly, contrast limited adaptive histogram equalization(CLAHE) preprocessing was applied to the images to conquer the low contrast and blurriness. Secondly, the C3_Faster module was constructed to replace the original C3 module with an aim to reduce the model’s parameter count and to enhance detection speed. Thirdly, the ACmix attention module was embedded into the backbone network to improve the model’s ability to extract features from small targets. Finally, WIoU v3 was introduced to replace CIoU as the regression loss function, fully considering the impact of low-quality targets on the loss and improving the model’s generalization. The results showed that compared to YOLOv5s, the improved YOLOv5s algorithm achieved an increase in mean average precision by 1.3 percentage points, an increase in frames per second by 10, a reduction in model parameters and computation by 8.20×105 and 2.40×109 FLOPs, respectively, and a model memory of only 12.2 MB. Meeting the requirements for lightness and real-time performance, the model exhibited advantages in detection accuracy and speed, making it suitable for deployment on underwater equipment for real-time detection.