In order to address the issues that the YOLOv5 network structure encounters in road target detection, such as low accuracy in identifying small targets at long distance, limited precision due to environmental factors, and insufficient understanding of complex road information, this article proposes a road object detection algorithm based on an improved Yolov5 and designed a new Yolov5 network model - FRM-Yolov5.The improved algorithm consists of three parts. Firstly, the Fasternet network is used to replace the original backbone network, and the RepGFPN is used to replace the neck network. Both have optimized network structures to enhance the extraction of feature information. Finally, the Mish activation function is used to replace the original SiLU activation function to improve the nonlinear expression ability of the network and enhance the generalization of the network model. By applying the improved network and the original network to the COCO2017 dataset for comparative experiments, the experimental results show that the mAP value of the improved algorithm reached 68%, a 2.5% improvement compared to the original network.