A malicious traffic sample adaptive enhancement device based on Deep Convolutional Generative Adversarial Network (DCGAN) is designed to address the issue of imbalanced network traffic data distribution, aiming to enhance the accuracy and efficiency of anomaly detection. By leveraging generative adversarial network technology, this device can generate samples similar to real malicious traffic to balance the training dataset. It utilizes the generator and discriminator of the Deep Convolutional Generative Adversarial Network (DCGAN), combined with the residual network (ResNet) in the CNN model, to enhance the quality of generated samples. The device can switch states to adapt to various network environments and has been experimentally validated for its effectiveness and feasibility.Moreover, employing an adaptive device, the samples of malicious traffic are adjusted. Experimental analysis demonstrates that the device significantly enhances the accuracy of anomaly traffic detection, improves robustness, and provides robust support for network security protection.