In reality, deploying the traditional object detection algorithm on mobile and embedded devices is difficult due to the limited memory and computation resources. To solve this problem, we propose a lightweight, real-time detection algorithm, YOLOv5-R. First, inserting the efficient channel attention (ECA) module into the Ghost module achieves the information interaction between channels and suppresses the redundant features. And applying dense connections to it further improves feature reuse and network performance, forming a Ghost-ECA-Dense (GED) module Utilizing the GED module to construct the F-GED, which is the backbone with fewer parameters and better performance, replace CSPDarknet53 in YOLOv5. Second, the redundant operations are replaced with Ghost modules and depthwise separable convolution in the neck and head of YOLOv5, and YOLOv5-R is constructed, which significantly reduces the network size and improves the inference speed. Finally, YOLOv5-R is deployed into the AI embedded device Jetson Nano for TensorRT acceleration. The experimental results indicated that the performance of YOLOv5-R outperformed the YOLOv5s. Specifically, the mean average precision was increased from 69.9% to 72.7%, the number of floating-point operations per second and parameters are reduced by 25% and 47.2%, respectively. The model weight was only 7.52 MB, and frames per second achieved 37, which can provide real-time detection. (C) 2022 SPIE and IS&T