A detection method against adversarial example attack based on neural network decision boundary and consistency analysis
Neural networks exhibit notable vulnerability to adversarial sample attacks, where small, imperceptible input perturbations can lead to high-confidence misclassifications. Existing defense strategies often require modifications to the model architecture or rely heavily on input preprocessing, limiting their effectiveness to specific types of attacks and resulting in poor generalization. To address these limitations, this paper proposes a novel adversarial sample detection method based on neural network decision boundary and consistency analysis. First, the decision boundary of the neural network is modeled based on hyperplane approximation. By calculating the minimum distance from the sample to the decision boundary, the suspicious sample set is quickly screened out from the input samples, thereby enhancing overall detection efficiency. Subsequently, by applying multiple perturbations to the sample along the gradient direction and extracting the mean of the cosine similarity, gradient consistency features are generated; by extracting the label changes and confidence fluctuations before and after compression, compression consistency features are generated. Finally, the consistency features are used to identify adversarial samples in the suspicious sample set, further improving both detection robustness and accuracy. Experimental results on the MNIST, CIFAR-10, and ImageNet datasets demonstrate that, compared to existing state-of-the-art methods, the proposed approach achieves higher detection performance and exhibits superior robustness against complex and varied attack strategies.