Automatic identification of marine ships plays an important role in alleviating the pressure of marine traffic. To address the problem of low automatic ship identification rate, a ship identification model based on ResNet50 (Residual Network50) and improved attention mechanism was proposed. Firstly, a ship data set was made by ourselves, and divided into the training set, the verification set and the test set, which were augmented by blurring and adding noise. Secondly, an improved attention module — Efficient Spatial Pyramid Attention Module (ESPAM) and ship type recognition model ResNet50_ESPAM were designed. Finally, the ResNet50_ESPAM was trained, verified and compared with other commonly used neural network models using ship data sets. The experimental results show that in the verification set, the highest accuracy of ResNet50_ESPAM is 95.5%, and the initial accuracy is 81.2%; compared with AlexNet(Alex Krizhevsky Network), GoogleNet (Google Inception Net), ResNet34(Residual Network34), ResNet50 and ResNet50_CBAM (ResNet50_Convlutional Block Attention Module), the maximum accuracy of the model validation set increases by 5.1, 4.9, 2.6, 1.6 and 1.4 percentage points respectively, and the initial accuracy of the validation set increases by 49.4, 44.7, 27.7, 3.0 and 2.1 percentage points respectively, indicating that ResNet50_ESPAM has a high recognition accuracy in ship type recognition, and the improved attention module ESPAM is highly effective.