An Adversarial Detection and Defense Method Based on Neural Discrete Representation
摘要
The security of deep neural networks has drawn significant attention due to threats from adversarial examples. To address the limitation of existing defense methods that rely on prior knowledge of attacks, this paper proposes a universal defense framework independent of specific attack assumptions. We innovatively introduce a neural discrete representation learning mechanism, where WGAN-GP loss is employed to constrain PatchGAN-based image reconstruction quality, thereby enhancing the effectiveness of latent features. Building upon the trained discrete representations, a residual network is adopted to embed features into a space aligned with the target model’s output. Adversarial detection is achieved by comparing distribution discrepancies of input examples across these two feature spaces. Experiments on CIFAR-10 and Tiny ImageNet validate the method’s superiority in detection accuracy, defense efficacy, and transferability against unknown attacks. The core innovation lies in establishing an attack-agnostic feature discrimination framework.