An improved YOLOv8 (You Only Look Once version 8) model is proposed to tackle the challenges of low detection accuracy and slow speed resulting from the complex background and shape diversity of concrete cracks. Firstly, a lightweight feature fusion module, GE_Conv, is designed by integrating the Ghost Module and Efficient Channel Attention in series. This module is embedded into the neck network to preserve more feature information during downsampling and accelerate the model’s inference speed. Secondly, the DBB_Bottleneck is introduced into the C2f module, combining the lightweight GE_Conv with the structurally re-parameterized Diverse Branch Block, enhancing the model’s multi-scale feature extraction capability. Furthermore, the introduction of the GF_Detect detection head significantly reduces the number of model parameters while improving detection performance. Finally, the WIoUv3 loss function is employed to dynamically assign anchor boxes of varying qualities, thereby enhancing the accuracy of anchor box positioning. Experimental results demonstrate that the proposed model achieves a detection precision of 92.9% and a mAP@50 (mean average precision at an Intersection over Union threshold of 0.5) of 77.8%. Compared to state-of-the-art algorithms such as Faster R-CNN, SSD, RetinaNet, YOLOv5s, YOLOv7-tiny, and the original YOLOv8s, the proposed model exhibits superior performance in both detection accuracy and generalization capability. Additionally, the model achieves an average detection time of 10.20 ms per image, demonstrating its practical feasibility. This study not only improves the accuracy and speed of crack detection but also significantly reduces the computational complexity of the model, advancing the development of lightweight and practical crack detection algorithms. The proposed model can be widely applied to crack inspection tasks for roads, bridges, coal mine shafts, and other scenarios, providing efficient and reliable technical support for crack maintenance and management.