Detection of pavement diseases is crucial for road maintenance. Traditional methods are costly, time-consuming, and less accurate. This paper introduces an enhanced pavement disease recognition algorithm, MS-YOLOv8, which modifies the YOLOv8 model by incorporating three novel mechanisms to improve detection accuracy and adaptability to varied pavement conditions. The Deformable Large Kernel Attention (DLKA) mechanism adjusts convolution kernels dynamically, adapting to multi-scale targets. The Large Separable Kernel Attention (LSKA) enhances the SPPF feature extractor, boosting multi-scale feature extraction capabilities. Additionally, Multi-Scale Dilated Attention in the network's neck performs Spatially Weighted Dilated Convolution (SWDA) across different dilatation rates, enhancing background distinction and detection precision. Experimental results show that MS-YOLOv8 increases background classification accuracy by 6%, overall precision by 1.9%, and mAP by 1.4%, with specific disease detection mAP up by 2.9%. Our model maintains comparable detection speeds. This method offers a significant reference for automatic road defect detection.