As a technology that has been developed for more than ten years, small target detection has been very mature at the technical level. A large number of target detection methods such as Faster R-CNN, RetinaNet, and YOLO have emerged that can be used in the industry. However, the problem of poor detection performance of small targets has not been completely solved so far. This paper focuses on the research and analysis of the optimization of the YOLOv5 algorithm around four optimization schemes, so that the sensitivity and fineness of the YOLOv5 algorithm for small target detection have been significantly improved. The experimental results show that the CBAM module can provide more small target feature information in the feature information extraction link, thereby increasing the efficiency of the algorithm for small target detection, and the replacement of the PAN-Net structure with the Bi-FPN structure can be used in the feature information feedback link. Reduce its loss, thereby increasing the efficiency of the algorithm, and the two schemes can be well combined to further improve the detection effect of small targets.