In this paper, we propose a underwater target detection method that optimizes YOLOv8s to make it more suitable for real-time and underwater environments. First, a lightweight FasterNet module replaces the original backbone of YOLOv8s to reduce the computation and improve the performance of the network. Second, we modify current bi-directional feature pyramid network into a fast one by reducing unnecessary feature layers and changing the fusion method. Finally, we propose a lightweight-C2f structure by replacing the last standard convolution, bottleneck module of C2f with a GSConv and a partial convolution, respectively, to obtain a lighter and faster block. Experiments on three underwater datasets, RUOD, UTDAC2020 and URPC2022 show that the proposed method has mAP50\documentclass[12pt]{minimal}
\usepackage{amsmath}
\usepackage{wasysym}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsbsy}
\usepackage{mathrsfs}
\usepackage{upgreek}
\setlength{\oddsidemargin}{-69pt}
\begin{document}$$_{50}$$\end{document} of 86.8%, 84.3% and 84.7% for the three datasets, respectively, with a speed of 156 FPS on NVIDIA A30 GPUs, which meets the requirement of real-time detection. Compared to the YOLOv8s model, the model volume is reduced on average by 24%, and the mAP accuracy is enhanced on all three datasets.