Underwater object detection with Synthetic Aperture Sonar (SAS) images faces many problems, including low contrast, blurred edges, high-frequency noise, and missed small objects. To improve these problems, this paper proposes a high-accuracy underwater object detection algorithm for SAS images, named the HAUOD algorithm. First, considering SAS image characteristics, a sonar preprocessing module is designed to enhance the signal-to-noise ratio of object features. This module incorporates three-stage processing for image quality optimization, and the three stages include collaborative adaptive Contrast Limited Adaptive Histogram Equalization (CLAHE) enhancement, non-local mean denoising, and frequency-domain band-pass filtering. Subsequently, a novel C2fD module is introduced to replace the original C2f module to strengthen perception capabilities for low-contrast objects and edge-blurred regions. The proposed C2fD module integrates spatial differential feature extraction, dynamic feature fusion, and Enhanced Efficient Channel Attention (Enhanced ECA). Furthermore, an underwater multi-scale contextual attention mechanism, named UWA, is introduced to enhance the model’s discriminative ability for multi-scale objects and complex backgrounds. The proposed UWA module combines noise suppression, hierarchical dilated convolution groups, and dual-dimensional attention collaboration. Experiments on the Sonar Common object Detection dataset (SCTD) demonstrate that the proposed HAUOD algorithm achieves superior performance in small object detection accuracy and multi-scenario robustness, attaining a detection accuracy of , which is higher than the baseline model (YOLOv8n). Compared with YOLOv8s, the proposed HAUOD algorithm can achieve higher accuracy with only model size, and reduce the computational complexity by half. Moreover, the HAUOD method exhibits significant advantages in balancing computational efficiency and accuracy compared to mainstream detection models.