The efficiency and accuracy of ship detection is of great significance to ship safety, harbor management, and ocean surveillance in coastal harbors. The main limitations of current ship detection methods lie in the complexity of application scenarios, the difficulty in diverse scales object detection, and the low efficiency of network training. In order to solve these problems, a novel multi-target ship detection method based on a decoupled feature pyramid algorithm (DFPN) is proposed in this paper. First, a feature decoupling module is introduced to separate ship contour features and position features from the multi-scale fused features, to overcome the problem of similar features in multi-target ships. Second, a feature pyramid structure combined with a gating attention module is constructed to improve the feature resolution of small ships by enhancing contour features and spatial semantic information. Finally, a feature pyramid-based multi-feature fusion algorithm is proposed to improve the adaptability of the network to changes in ship scale according to the contextual relationship of ship features. Experiments on the multi-target ship detection dataset showed that the proposed method increased by 6.3% mAP and 20 FPS higher than YOLOv4, 7.6% mAP and 36 FPS higher than Faster-R-CNN, 5% mAP and 36 FPS higher than Mask-R-CNN, and 4.1% mAP and 35 FPS higher than DetectoRS. The results demonstrate that the DFPN can detect multi-target ships in different scenes with high accuracy and a fast detection speed.