Aiming at the characteristics of large intra-class differences,high similarity between classes,large scale changes of objects and scenes,difficulty in feature extraction,and small samples in the ship fine-grained target detection and classification task of high-resolution images,an improved algorithm based on YOLOv8 is proposed.Firstly,the SimAM Attention Mechanism is introduced into the backbone network to make the algorithm model more focused on the ship object when running in the complex background.Secondly,the SPD-Conv module is introduced in the neck to improve the problems of large ship scale changes and small target detection in complex backgrounds.Finally,for the characteristics of fine-grained ship target detection,it replaces the Mish activation function and Focal-Loss loss function to speed up model convergence and improve model accuracy.Comparative experiments show that the improved algorithm achieves a detection accuracy of 94.49%in the FAIR1M_Ship dataset while ensuring the detection speed and number of model parameters.Compared with the currently popular target detection algorithms,the detection accuracy of the improved algorithm has been improved to a certain extent.