Computer vision has been integrated into people’s daily lives, but mainstream target detection algorithms deployed to embedded devices with limited hardware resources are difficult to meet the task requirements in terms of real time and accuracy. So we proposed YOLO-DFD, a light detection algorithm based on improved YOLOv4 to solve the problem of dog feces in our living environment. The main improvement strategies are as follows: the YOLOv4 backbone network is replaced with MobileNetV3, and the
3
∗
3
convolutions in the feature enhancement network are replaced by depthwise separable convolutions to further reduce the number of parameters. To enhance the accuracy of target detection, we introduced the convolutional block attention module (CBAM) in neck network, and the complete intersection over union (CIoU) loss of YOLOv4 is replaced with the SCYLLA intersection over union (SIoU) loss to reduce false detection rate. In this paper, the dataset we used was made up of pictures of dog feces taken in life. For the self-made dog feces dataset, we used data enhancement technology to expand it. The training result shows that the average precision (AP) has reached 98.66%. While maintaining detection performance, the parameter of YOLO-DFD is reduced by 82% and FPS increases 14 compared to YOLOv4. And YOLO-DFD has a lower parameter quantity and a smaller calculation than other algorithms, making it easier to deploy on embedded devices to clean dog feces.