At present, the existing anomaly traffic detection methods rely on the statistical characteristics of traffic for detection, which can not adapt to the unknown nature of network traffic, resulting in low detection accuracy, high false detection rate, and poor generalization ability of the methods. This paper studies the anomaly traffic detection method of a convolutional neural network based on the Dynamic Adaptive Pooling Algorithm (DAPA). The DAPA algorithm is used to improve the pooling layer of the CNN network to reduce the overfitting interference of unknown features; after the t-SNE algorithm reduces the dimensionality of the data, using clustering to transform the data feature map to get anomaly identification output. The experimental results show that the false detection rate is reduced by about 37.46%. The actual detection results are close to the prediction results, and the method has better generalization ability.