Robust Representation Consistency Model via Contrastive Denoising

Jiachen Lei, Julius Berner, Jiongxiao Wang, Zhongzhu Chen, Chaowei Xiao, Zhongjie Ba, Kui Ren, Jun Zhu, Anima Anandkumar

Introduction

Deep neural networks (DNNs) have demonstrated remarkable performance across various vision tasks but remain notoriously susceptible to adversarial perturbations—small, often imperceptible changes to input data that trigger incorrect classifications. To address this fragility, researchers have turned to randomized smoothing, a technique that provides a mathematically "certified" radius within which a model's prediction is guaranteed to remain constant.

Recent advancements have integrated diffusion models as "purifiers" to remove adversarial noise before classification. However, these methods suffer from two primary bottlenecks: high computational latency due to iterative sampling and a "semantic disconnect" where generative objectives (reconstructing pixels) do not perfectly align with discriminative objectives (categorizing objects). This paper introduces the Robust Representation Consistency Model (rRCM), which achieves state-of-the-art certified robustness by reframing the denoising process as a representation alignment task.

Methodology: Contrastive Denoising

The core innovation of rRCM is the shift from generative purification to Contrastive Denoising. In standard diffusion frameworks, the Probability Flow (PF) ODE defines a deterministic path from a clean image to Gaussian noise. rRCM posits that every point along this trajectory should ideally map to the same semantic representation.

Two-Stage Training Pipeline

  1. Pre-training (Denoising by Discrimination): Rather than training a model to reconstruct the original pixels, rRCM employs an InfoNCE-style contrastive loss. The model is trained to "attract" representations of points that lie on the same diffusion trajectory while "repelling" points from different trajectories. This forces the encoder to map noisy inputs directly into the latent space of their clean counterparts.
  2. Fine-tuning: The pre-trained representations are subsequently fine-tuned using class labels. A consistency loss is applied to ensure that various noisy versions of the same image result in identical predictions, further stabilizing the model's output against variance in noise.

By collapsing the denoising and classification steps into a single forward pass, rRCM eliminates the need for the expensive iterative sampling characteristic of traditional diffusion-based purification.

Experimental Results

The authors evaluated rRCM on the ImageNet and CIFAR-10 benchmarks using Vision Transformer (ViT) architectures. The results demonstrate a significant leap in both efficiency and accuracy.

Performance and Scalability

On ImageNet, rRCM outperformed leading diffusion-based methods, such as DDS and DensePure, by an average of 5.3% in certified accuracy across all perturbation radii. The performance gap was even more pronounced at larger radii, where rRCM achieved improvements of up to 11.6%. Furthermore, the approach scales effectively; increasing the model size (e.g., moving from ViT-Small to ViT-Base) and training batch size consistently yielded higher robustness.

Efficiency Gains

The most striking result is the 85x speedup in inference compared to DensePure. While previous state-of-the-art methods required minutes to certify a single image due to the iterative nature of diffusion sampling, rRCM performs the same task in seconds. This makes certified robustness viable for real-world, latency-sensitive applications.

Discussion and Limitations

While rRCM sets a new benchmark, it is not without limitations. The authors note a "semantic gap" that occurs at extreme noise levels; when the stochastic forward trajectory destroys too much information, the original semantic identity becomes unrecoverable. Future work may involve integrating pre-trained score models to better approximate these trajectories or extending the representation consistency framework to complex tasks like object detection and semantic segmentation.

Conclusion

The Robust Representation Consistency Model (rRCM) demonstrates that for robust classification, explicit image purification is unnecessary. By aligning noisy and clean representations through contrastive learning, rRCM provides a faster, more accurate, and highly scalable solution for certified adversarial defense.

Summary updated

BibTeX
@inproceedings{lei2025robust,
  author = {Jiachen Lei and Julius Berner and Jiongxiao Wang and Zhongzhu Chen and Chaowei Xiao and Zhongjie Ba and Kui Ren and Jun Zhu and Anima Anandkumar},
  title = {{Robust Representation Consistency Model via Contrastive Denoising}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=armbJRJdrH},
}
Figure