Abstract
Deep Neural Networks (DNNs) are notoriously vulnerable to adversarial examples—images containing imperceptible perturbations designed to cause misclassification. We present ComDefend, an end-to-end image compression framework that purifies adversarial images before they reach a classifier. By squeezing images through a neural compression bottleneck and then reconstructing them, the model strips away adversarial noise, significantly boosting DNN robustness without requiring model retraining. ComDefend is model-agnostic, efficient, and maintains high accuracy on clean images.
Introduction
Deep Neural Networks have revolutionized computer vision but remain brittle. Attackers can exploit this by creating adversarial examples that look normal to humans but cause models to fail—for instance, misidentifying a panda as a dog. Existing defenses typically involve computationally expensive adversarial training or complex pre-processing. ComDefend offers a streamlined alternative: a fast, model-agnostic pre-processing module that treats adversarial noise as redundant information to be removed through compression.
Methodology
ComDefend utilizes a dual-CNN architecture designed to treat adversarial defense as a compression and reconstruction task. The system consists of two primary modules:
- ComCNN (Compression): This network extracts essential structural information, compressing a standard 24-bit RGB image into a compact 12-bit map. This bottleneck is designed to retain clean structural data while discarding adversarial perturbations.
- RecCNN (Reconstruction): This network takes the compressed map and reconstructs a purified version of the original image.
To enhance robustness, the authors employ a "Noise Attack" training trick, adding Gaussian noise to the compressed representation during training. This forces the RecCNN to learn how to recover the original image even from imperfect compressed data. Crucially, ComDefend is trained only on clean images, allowing it to learn the natural image distribution and effectively map "unnatural" adversarial inputs back to a clean state.
Evaluation and Results
The researchers evaluated ComDefend across standard benchmarks including MNIST, CIFAR-10, and ImageNet against various attack methods such as FGSM, BIM, DeepFool, and C&W.
On the CIFAR-10 dataset using a ResNet-50 classifier, ComDefend showed dramatic improvements:
- DeepFool Attack: Accuracy improved from 1% (undefended) to 89%.
- C&W Attack: Accuracy rose from 0% to 87%.
Beyond accuracy, ComDefend excels in efficiency. On ImageNet, it processed images in approximately 1.2 seconds, significantly faster than previous state-of-the-art denoisers like HGD (2.7 seconds). Importantly, the "utility cost" is minimal, with clean-image accuracy remaining very close to the original baseline.
Discussion and Conclusion
ComDefend demonstrates that viewing adversarial perturbations as structured redundancy allows for an effective defense via compression. By reducing the search space available to attackers through a mezzanine effect, the model makes it significantly harder for perturbations to survive the purification cycle. While iterative attacks like BIM remain more challenging than one-step attacks, ComDefend provides a robust, plug-and-play defense for existing vision models. Future work may explore combining ComDefend with adversarial training to create even more resilient hybrid defense systems.
Summary updated