Human Aligned Compression for Robust Models
Samuel Räber, Andreas Plesner, Till Aczel, Roger Wattenhofer
TL;DR
This paper tackles the vulnerability of vision models to adversarial perturbations by introducing human-perception-aligned learned compression as a preprocessing defense. It systematically compares JPEG with learned compressors HiFiC and ELIC on ResNet50 and Vision Transformer (ViT) architectures across Imagenette and ImageNet, including sequential compression. The results show that HiFiC and ELIC generally outperform JPEG, especially for ViT, under black-box attacks, though defenses weaken when gradients propagate through the defense (white-box). Sequential compression significantly enhances robustness with manageable computational overhead, offering a practical, perceptually aligned defense that preserves task-relevant features while removing adversarial noise.
Abstract
Adversarial attacks on image models threaten system robustness by introducing imperceptible perturbations that cause incorrect predictions. We investigate human-aligned learned lossy compression as a defense mechanism, comparing two learned models (HiFiC and ELIC) against traditional JPEG across various quality levels. Our experiments on ImageNet subsets demonstrate that learned compression methods outperform JPEG, particularly for Vision Transformer architectures, by preserving semantically meaningful content while removing adversarial noise. Even in white-box settings where attackers can access the defense, these methods maintain substantial effectiveness. We also show that sequential compression--applying rounds of compression/decompression--significantly enhances defense efficacy while maintaining classification performance. Our findings reveal that human-aligned compression provides an effective, computationally efficient defense that protects the image features most relevant to human and machine understanding. It offers a practical approach to improving model robustness against adversarial threats.
