The YOLOv5 algorithm has gained widespread adoption in maritime target detection due to its impressive speed and accuracy. However, challenges persist in the form of small target leakage and suboptimal multi-target classification performance in complex sea areas during maritime navigation. To address these issues, this paper presents an enhanced convolutional neural network (CNN) named GAG-Net. Specifically, we incorporate a Global Attention Mechanism (GAM) to capture global context information, enabling the model to better discern differences between targets and backgrounds, and thereby significantly improving detection accuracy. Additionally, we introduce the Focal and Efficient IOU (Focal-EIOU) loss for accurate bounding box regression, which focuses more on high-quality samples to improve detection accuracy while accelerating algorithm con-vergence. Finally, we optimize anchor box parameters to better match the shape of vessels and further enhance detection performance. Experimental results demonstrate that our proposal out-performs YOLO series algorithms on the SeaShips dataset in terms of detection accuracy, robustness, and efficiency.