The automotive fuse box is a crucial component of a vehicle's electrical safety system. However, due to interference from ambient lighting and variations in component label fonts, traditional machine vision inspection methods face challenges such as low accuracy, high computational demands, and long processing times. To address these issues, we proposed a lightweight improved algorithm based on YOLOv5 for object detection in automotive fuse boxes. First, ShuffleNetV2 was integrated into the backbone network of YOLOv5 to significantly reduce the computational workload. Second, lightweight modules C3Ghost and depthwise separable convolution were introduced into the neck network to further reduce the number of parameters and enhance detection speed. Finally, SCYLLA-IOU was integrated into YOLOv5 as the bounding box regression loss function to improve detection efficiency for rotating objects and accelerate model convergence. The experimental results indicate that, compared with the original YOLOv5s, the improved model reduces the number of parameters by 92.3%, compresses the model size by 90.1%, decreases floating point operations (FLOPs) by 91.8%, and increases frames per second (FPS) by 12.0%, with accuracy reaching 98.8%. Overall, the improved model outperforms eight other classic object detection algorithms. This demonstrates the timeliness and superiority of the proposed method.