Objectives: The side-scan sonar shipwreck detection method based on the YOLOv3 model has the problems of high miss-alarm rate of small targets, heavy model weight, and slow detection speed that fails to meet real-time requirements. Methods: This paper introduces the YOLOv5 algorithm and pro⁃ poses an improved YOLOv5 model according to the characteristics of the side-scan sonar shipwreck da⁃ teset. We test YOLOv5a, YOLOv5b, YOLOv5c, YOLOv5d, YOLOv5s, YOLOv5m, YOLOv5l and YOLOv5x under the basic framework of YOLOv5 with eight different depth and width model structures. Then we choose the best structure by using genetic algorithm and K-means algorithm to optimize the detec⁃ tion frame, and to improve the loss function through complete intersection over union. Results: The results show that under the different range of intersection over union as 0.5 and 0.5-0.95,the average precisions of the improved YOLOv5a model are increased by about 0.3% and 0.6% than that of the original model,re⁃ spectively. Compared with the YOLOv3 model, the average precisions of the improved YOLOv5a model are increased by 4.2% and 6.1%, respectively, and the detection speed reaches 426 frames per second which is almost doubled that of YOLOv3. Conclusions: The proposed method is more conducive to practical appli⁃ cations and engineering deployment. © 2024 Editorial Department of Geomatics and Information Science of Wuhan University. All rights reserved.