China has an extensive road network, thus requiring daily maintenance. During the collection of road defect data sets, scenarios with low illumination or extreme lack of light may occur. In such environments, the quality of image collection can be significantly reduced due to the low visibility of the surrounding environment, leading to the absence of intricate details. These challenges can negatively impact subsequent intricate visual tasks, including object detection and defect recognition utilizing road dataset images, thereby diminishing the precision and efficiency of the recognition process. Therefore, this paper adopts the Retinex algorithm to enhance low-illumination road images and performs road defect detection on the enhanced images, significantly improving the detection accuracy. An enhanced YOLOv8 detection algorithm is introduced to boost the detection efficiency of road defects. This updated algorithm incorporates FasterNet as the feature extraction network, resulting in improved computational speed. Integrating the Deformable-LKA module in the Neck layer can enhance the detection capability for small and irregularly shaped objects. RFAConv, a combination of spatial attention mechanisms and convolution operations, is employed to enhance the detection head and amplify the model’s feature extraction capabilities.The introduced algorithm model undergoes training, validation, and testing procedures on road defect datasets, while also being evaluated against other algorithm models for comparison. The improved algorithm model can achieve accurate recognition of road defects.