Abstract: In order to improve the accuracy of marine ship recognition in multiple targets and foggy environments, a marine ship recognition model SE-NMS-YOLOv5 is proposed based on improved YOLOv5 deep learning. The model is combined with Dark channel defogging algorithm, SE(squeeze-and-congestion) attention mechanism module and improved non-maximum suppression model for training and testing of ship data sets. The results showed that in the ship recognition task, there was the accuracy of 90.6%, recall rate of 89.9% and SE-NMS-YOLOv5 F1 value of 90.5%, and compared with YOLOv5 model, the detection effect is improved by 6.3%, 4.8% and 5.8%. Compared with YOLOv4, the model improved 19.1%, 19.0% and 19.3%. In foggy conditions, the accuracy, recall rate and F1 value of SE-NMS-YOLOv5-Dark channel model were 88.1%, 87.2% and 87.6%, compared with SE-NMS-YOLOv5 model, the detection results are improved by 13.8%, 13.3% and 13.5%, respectively. The findings indicate that the marine ship recognition method based on SE-NMS-YOLOv5 effectively solves the problem of low accuracy of marine ship detection on multiple targets and foggy conditions, and improve the overall effect of ship detection and recognition.