Adversarial Detection based on Local Cosine Similarity
Dejian Guan, Dan Liu, Wentao Zhao · 2022 IEEE International Conference on Artificial Intelligence and Computer Applications (ICAICA) · 2022
Deep neural networks (DNNs) have attracted extensive attention because of its powerful performance in many areas, however, DNNs are obviously vulnerable to adversarial examples. By crafting the adversarial examples with human imperceptible perturbations, adversary can confuse the judgement of DNNs. In our work, we propose a simple yet effective adversarial detection method based on Local Cosine Similarity (LCS). Motivated by the idea that the direction of adversarial perturbation matters most, we propose to utilize cosine similarity which is sensitive to direction changes, therefore, is able to effectively discriminate subtle direction differences between adversarial example and normal example. Meanwhile we introduce the local operation, which limits the cosine similarity calculation within k-nearest neighbors so that better to characterize the difference between adversarial example and normal example. Extensive experimental results show that the extracted LCS features can well distinguish adversarial examples from normal examples and achieve better performances.