TL;DR
This paper introduces Disentangled Representation-based Reconstruction (DRR), a novel self-supervised method for detecting adversarial examples. By disentangling image features into "label" and "semantic" components, DRR effectively mimics the behavior of adversarial attacks, leading to improved detection accuracy and robustness, even against adaptive adversaries.
What Problem Does This Paper Address?
Deep learning models are notoriously vulnerable to adversarial examples – subtly modified inputs that fool the model into making incorrect predictions, often imperceptible to humans. While autoencoders (AEs) have been used for self-supervised adversarial detection by assuming adversarial examples have higher reconstruction errors, their strong generalization ability can lead to false positives or negatives. This is because AEs can reconstruct slightly perturbed inputs with low error, blurring the line between benign and adversarial examples. Existing methods struggle to generalize to unseen attacks and are often vulnerable to adaptive attackers who specifically target the defense mechanism.
Methods
The core innovation of DRR lies in its use of disentangled representations. Instead of treating an image as a single entity, DRR separates its features into two distinct components:
- Label Feature ($f_l$): This represents the class the image belongs to and is derived from the victim model's logits (outputs before the final softmax layer), rescaled using a temperature parameter. This feature is known to be fragile to adversarial perturbations.
- Semantic Feature ($f_s$): This captures the underlying content of the image and is extracted using a general encoder network. This feature is generally more robust to adversarial perturbations.
DRR then trains an autoencoder (encoder En and decoder De) with a two-pronged approach:
- Reconstructing Benign Examples: The autoencoder learns to reconstruct benign images by combining their correctly paired label and semantic features ($f_s, f_l$). This is trained using a Mean Absolute Error (MAE) loss ($L_1$).
- Mimicking Adversarial Behavior with Counterexamples: To reduce the AE's generalization ability and better distinguish adversarial examples, DRR creates "counterexamples." This is done by pairing the semantic feature of a benign image with a permuted label feature (where the largest element of $f_l$ is moved to a different index). The decoder then reconstructs these counterexamples. This process is trained using a soft hinge loss ($L_{hinge}$), which penalizes counterexamples that are too close to benign reconstructions, forcing the detector to learn a clearer separation.
The overall loss function for training DRR is a combination of $L_1$ and $L_{hinge}$.
Datasets
The paper evaluates DRR on the following standard image datasets:
- MNIST
- SVHN
- CIFAR-10
- CIFAR-100
For textual adversarial attacks, they use:
- SST-2
- AG_News
Key Insights and Ideas
- Adversarial Examples as "Features": The paper leverages the insight that adversarial examples exploit specific features (like the class label) that are sensitive to perturbations, while leaving other features (semantics) relatively intact. DRR explicitly models this by disentangling these two types of features.
- Mimicking Adversarial Behavior for Detection: Instead of just learning what benign data looks like, DRR actively learns to reconstruct "counterexamples" that mimic the distorted representations adversarial examples would produce. This is a clever way to achieve self-supervised learning while directly addressing the problem.
- Reducing Unnecessary Generalization: The soft hinge loss on counterexamples is crucial for preventing the autoencoder from becoming too generalized. By forcing a separation between benign reconstructions and counterexample reconstructions, DRR avoids misclassifying adversarial examples as benign.
- Robustness to Adaptive Attacks: A significant finding is DRR's resistance to adaptive attacks, where the attacker knows the defense mechanism. This is attributed to the disentangled representation and the counterexample generation, which make it harder for an attacker to simultaneously fool both the victim model and the DRR detector.
- Data Agnosticism: The paper demonstrates that the core principle of DRR can be extended beyond images to natural language processing tasks, highlighting the universality of the underlying idea.
Key Results
- Superior Performance: DRR consistently outperforms state-of-the-art self-supervised detectors (HVR and HLR) across various datasets and attack types (FGSM, PGD, DeepFool) in terms of AUC and TPR. For instance, on CIFAR-10, DRR achieves AUCs of 0.911 and 0.904 for PGD L2 and L-infinity attacks, respectively, significantly higher than HVR and HLR.
- High Detection Rates: DRR achieves high true positive detection rates (TPR) even when maintaining a high true negative detection rate (TNR=0.9).
- Adaptive Attack Resistance: DRR shows strong resistance to adaptive PGD attacks, maintaining high detection AUCs while the attacker attempts to bypass the detector. This is a key differentiator from previous methods.
- Textual Attack Defense: DRR demonstrates effectiveness in detecting textual adversarial examples generated by PWWS and Genetic attacks, achieving AUCs of 0.79 and 0.78 on SST-2, and 0.821 and 0.888 on AG_News, respectively.
Limitations and Future Work
- Hyperparameter Tuning: While DRR performs well, the paper mentions that hyperparameters like $\lambda$ (loss weighting), $d$ (distance threshold), and the size of the counterexample set $\Sigma$ require empirical tuning.
- Computational Cost: The method involves training an autoencoder and using a victim model, which can be computationally intensive.
- Future Work: The authors suggest that DRR's success in image and text domains indicates its potential for application in other domains. They also propose combining DRR with other proactive defense strategies for enhanced security.
Summary updated