Due to the complex background and blurred images in underwater imaging, conventional target detection algorithms don't extract target features well, leading to missed detections. To enhance the accuracy and speed of underwater target detection algorithms, this paper proposes an improved underwater target detection model based on YOLOv7. Firstly, the Spatial Pyramid Pooling Cross Stage Partial Connection module (SPPCSPC) in the YOLOv7 model is replaced with the Spatial Pyramid Pooling Fast Cross Stage Partial Connection module (SPPFCSPC), which maintains the receptive field while reducing the number of parameters and computational requirements, thus increasing the model's speed. Secondly, a weighted Bidirectional Feature Pyramid Network (BiFPN) is utilized to improve the model's ability to fuse multi-scale target features. Lastly, a Convolutional Block Attention Module (CBAM) is embedded to enhance the model's focus on blurred and small target features. Experimental results show that the improved YOLOv7 model achieves an average accuracy of 85.5% on the URPC2021 dataset, which is a 3.2 percentage point improvement over the original YOLOv7 model, with the inference speed remaining the same. The experimental validation demonstrates that the improved algorithm proposed in this paper offers higher detection accuracy without compromising inference speed, providing advantages in underwater complex environment target detection tasks.