Abstract
Deep learning models are vulnerable to adversarial examples and make incomprehensible mistakes, which puts a threat on their real-world deployment. Combined with the idea of adversarial training, preprocessing-based defenses are popular and convenient to use because of their task independence and good generalizability. Current defense methods, especially purification, tend to remove "noise" by learning and recovering the natural images. However, different from random noise, the adversarial patterns are much easier to be overfitted during model training due to their strong correlation to the images. In this work, we propose a novel adversarial purification scheme by presenting disentanglement of natural images and adversarial perturbations as a preprocessing defense. With extensive experiments, our defense is shown to be generalizable and make significant protection against unseen strong adversarial attacks. It reduces the success rates of state-of-the-art ensemble attacks from 61.7% to 14.9% on average, superior to a number of existing methods. Notably, our defense restores the perturbed images perfectly and does not hurt the clean accuracy of backbone models, which is highly desirable in practice.
Introduction
Deep learning models, while powerful, are notoriously brittle. By adding tiny, often invisible "adversarial perturbations" to an image, an attacker can trick a world-class classifier into seeing a "bullfrog" as a "kingsnake." This vulnerability poses a significant risk for real-world deployments in security-sensitive areas.
Existing defenses generally fall into two categories: adversarial training, which involves retraining the model on adversarial examples, and adversarial purification, which cleans the image before it reaches the classifier. While adversarial training is effective, it is computationally expensive and often degrades performance on clean data. Purification is more flexible and task-independent, but it faces a major challenge: adversarial noise is not random. It is highly structured and correlated with the image content, causing standard denoising models to overfit to the adversarial patterns rather than truly separating the "signal" from the "malice."
Representation Disentangled Purification (RDP)
To address these challenges, we propose Representation Disentangled Purification (RDP). Instead of simple filtering, RDP treats purification as a disentanglement problem. The goal is to explicitly separate the underlying natural image features from the adversarial perturbations.
As shown in the architecture diagram above, the RDP system consists of two primary branches:
- The Purification Branch ($P$): This branch processes a perturbed image $x'$ to extract "natural" latent features, which are then used to reconstruct a clean version of the image.
- The Reconstruction Branch ($R$): This branch takes the "natural" features from the purification branch and combines them with "adversarial" features to reconstruct the original attacked image $x'$.
By forcing the model to reconstruct both the clean and the attacked versions, the system learns to distinguish between pixels belonging to the object and those belonging to the attack. This process is trained in a self-supervised manner, allowing the model to learn the "natural manifold" of images without requiring knowledge of specific attack types.
Conceptual Framework
The core idea behind RDP is the mapping of adversarial images into distinct latent spaces. The process involves three key steps: (1) encoding the adversarial image into a joint space, (2) disentangling this space into a natural space and an adversarial perturbation space, and (3) decoding the natural representation back into a clean image.
This disentanglement prevents the purifier from accidentally discarding important natural details, as the reconstruction branch acts as an "anchor" that ensures all information from the original input is accounted for in one of the two latent spaces.
Experimental Evaluation
We evaluated RDP using a subset of ImageNet (25,000 images) for training and the NIPS 2017 DEV dataset (1,000 images) for testing. The defense was tested against several backbone architectures, including Inception-v3, Inception-v4, ResNet-101, and ResNet-152.
Key Results
- Robustness Gains: Against difficult "ensemble attacks," RDP reduced the average attack success rate from 61.7% to 14.9%.
- Preserving Clean Accuracy: Unlike many defenses that impose a "clean accuracy tax," RDP maintained or even slightly improved performance on unperturbed data. For example, on the IncRes-v2ens model, it achieved a clean accuracy of 97.70%.
- Visual Fidelity: Qualitative analysis shows that RDP-purified images are virtually indistinguishable from original clean images, avoiding the blurring or distortion common in methods like JPEG compression or Total Variation Minimization.
Conclusion and Future Work
RDP offers a robust, task-agnostic preprocessing defense that effectively strips adversarial noise through representation disentanglement. While highly effective, the dual-branch architecture introduces some computational latency, which may be a factor for real-time applications. Future research could investigate the defense's performance against more sophisticated adaptive attacks designed specifically to target the disentanglement process, as well as its generalizability to domains beyond standard image classification.
Summary updated