Since the traditional activation function can not match each feature map specifically to achieve the best activation effect, a dynamic activation function is designed to add its own offset to each pixel value on the feature map to achieve a better effect of distinguishing target and background. In order to make the model better focus on the target, an attention mechanism is added to the backbone to improve the accuracy of the model. For scenarios requiring pedestrian flow monitoring and traffic management, such as red-light detection, automatic driving and other scenarios with high real-time performance and limited hardware conditions, channel pruning technology is applied to trim the low-weight parameters of the model. In order to adapt to the hardware acceleration characteristics, the pruning method is improved, so that the number of retained channels is always an integer multiple of 8. In the inference deployment phase, Conv and BatchNorm weights are integrated to further shrink the model and reduce the number of parameters and floating point computation. The final experiment shows that the performance of the improved model is improved to some extent compared with other object detection models, among which, the performance of the improved model is improved by 0.013 in AP0.5:0.95 and 0.005 in AP0.5 compared with the original model of YOLOv8. The number of parameters is reduced by 4.8×106 © 2024 Journal of Computer Engineering and Applications Beijing Co., Ltd.; Science Press. All rights reserved.