[Paper Review] DARCCC: Detecting Adversaries by Reconstruction from Class Conditional Capsules
DARCCC detects adversarial images by measuring the L2 reconstruction error between input images and reconstructions generated from the pose and identity of the top-level capsule in a capsule network. It effectively identifies adversarial examples across MNIST, Fashion-MNIST, and SVHN, with high detection rates even against white-box attacks, though a stronger reconstruction-aware attack (R-BIM) can evade detection by making adversarial images resemble the target class.
We present a simple technique that allows capsule models to detect adversarial images. In addition to being trained to classify images, the capsule model is trained to reconstruct the images from the pose parameters and identity of the correct top-level capsule. Adversarial images do not look like a typical member of the predicted class and they have much larger reconstruction errors when the reconstruction is produced from the top-level capsule for that class. We show that setting a threshold on the $l2$ distance between the input image and its reconstruction from the winning capsule is very effective at detecting adversarial images for three different datasets. The same technique works quite well for CNNs that have been trained to reconstruct the image from all or part of the last hidden layer before the softmax. We then explore a stronger, white-box attack that takes the reconstruction error into account. This attack is able to fool our detection technique but in order to make the model change its prediction to another class, the attack must typically make the "adversarial" image resemble images of the other class.
Motivation & Objective
- To develop an attack-independent adversarial detection method that does not rely on assumptions about the data manifold or adversarial distribution.
- To leverage the reconstruction sub-network of capsule networks to detect adversarial examples based on reconstruction fidelity.
- To extend the detection technique to standard CNNs by training them to reconstruct from hidden features.
- To evaluate detection performance against black-box and white-box adversarial attacks on multiple datasets.
- To design a stronger white-box attack (R-BIM) that accounts for reconstruction error to bypass DARCCC.
Proposed method
- Train a capsule network with a reconstruction head that reconstructs the input image from the pose and identity of the predicted top-level capsule.
- Use the L2 distance between the input image and its reconstruction as a detection metric for adversarial examples.
- Apply a fixed threshold on the reconstruction error to flag inputs as adversarial if the error exceeds the threshold.
- Extend the method to CNNs by training them to reconstruct from the last hidden layer before the softmax, using the same reconstruction error metric.
- Design a new attack, R-BIM, that jointly minimizes classification loss and reconstruction error to evade DARCCC detection.
- Use iterative optimization with gradient steps that consider both misclassification and good reconstruction quality.
Experimental results
Research questions
- RQ1Can reconstruction error from class-conditional capsule representations effectively detect adversarial examples across different datasets?
- RQ2How does DARCCC perform against black-box and white-box adversarial attacks, including FGSM and BIM?
- RQ3Can the detection method be generalized to standard CNNs trained to reconstruct from hidden representations?
- RQ4What is the impact of a reconstruction-aware attack (R-BIM) on DARCCC's detection performance?
- RQ5Do adversarial examples generated to minimize reconstruction error appear visually plausible and resemble images of the target class?
Key findings
- DARCCC achieves high attack detection rates (over 95%) and successful attack detection rates (over 90%) on MNIST, Fashion-MNIST, and SVHN for both FGSM and BIM attacks.
- The capsule model outperforms CNNs in detection accuracy, particularly on SVHN, where it maintains strong detection performance.
- Reconstruction error correlates strongly with semantic similarity in simpler datasets, but this correlation weakens in complex datasets like ImageNet or CIFAR-10.
- The R-BIM attack successfully evades DARCCC detection by generating adversarial images that resemble the target class, making them visually plausible.
- Despite evading detection, R-BIM is significantly less effective at changing the model's prediction than standard BIM attacks, indicating a trade-off between evasion and misclassification.
- Adversarial examples crafted to minimize reconstruction error often appear as realistic images of the target class, suggesting alignment with the data manifold.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.