A Training-Free Defense Framework for Robust Learned Image Compression

Myungseo Song, Jinyoung Choi, Bohyung HanarXiv 2024

Abstract

We study the robustness of learned image compression models against adversarial attacks and present a training-free defense technique based on simple image transform functions. Recent learned image compression models are vulnerable to adversarial attacks that result in poor compression rate, low reconstruction quality, or weird artifacts. To address the limitations, we propose a simple but effective two-way compression algorithm with random input transforms, which is conveniently applicable to existing image compression models. Unlike the naïve approaches, our approach preserves the original rate-distortion performance of the models on clean images. Moreover, the proposed algorithm requires no additional training or modification of existing models, making it more practical. We demonstrate the effectiveness of the proposed techniques through extensive experiments under multiple compression models, evaluation metrics, and attack scenarios.

Introduction

Learned image compression (LIC) models have recently surpassed traditional codecs like JPEG and BPG in performance. However, these deep learning-based models inherit a significant weakness: adversarial vulnerability. Tiny, human-imperceptible perturbations can cause catastrophic failures, leading to massive file sizes or distorted reconstructions. This paper introduces a "Two-way Compression" framework—a simple, training-free defense that uses random image transforms to bypass these attacks without sacrificing performance on clean images.

The Adversarial Vulnerability of LIC

Adversarial attacks on LIC models generally fall into two categories:

  1. Rate Attacks: These aim to bloat the compressed file size (high bitrate) without adding meaningful information.
  2. Distortion Attacks: These cause the reconstructed image to be filled with "weird artifacts," destroying visual fidelity.

Existing defenses, such as adversarial training, are often computationally expensive, require model retraining, and typically degrade performance on normal, unattacked images. There is a clear need for a "plug-and-play" defense that is both effective and practical.

Proposed Method: Two-way Compression

The authors propose a Two-way Compression framework that leverages the inherent properties of image compression. The core logic involves a dual-path processing strategy:

  1. Dual Paths: When encoding an image, the system processes it twice. Path A uses the original image. Path B applies a random, reversible transform (e.g., a small shift, flip, or rotation).
  2. Self-Supervised Selection: Since the encoder's goal is to minimize both size (rate) and error (distortion), it calculates the Rate-Distortion (RD) loss for both paths.
  3. Defense Mechanism: Adversarial perturbations are typically precision-engineered for a specific pixel arrangement. Applying a random transform "breaks" this alignment. The encoder then simply selects the path with the better RD loss.
  4. Minimal Overhead: Only a small amount of metadata (the transform index) is sent to the decoder to allow for the inverse transformation.

This approach is entirely training-free, allowing it to be applied to any pre-trained LIC model immediately.

Key Results and Analysis

The framework was evaluated using the ImageNet and Kodak datasets across several popular LIC models, including Scale Hyperprior (SH) and Mean & Scale Hyperprior (M&S).

Visual Robustness

The defense effectively nullifies the impact of adversarial noise. While undefended models produce images riddled with artifacts under attack, the Two-way defense maintains high visual quality.

Visual comparison of clean and perturbed images with and without the proposed defense.

Quantitative Performance

In "Rate Attacks," the defense kept bitrates near-normal, whereas undefended models saw spikes of 10x or more. Crucially, the method maintains original performance on clean images because it can always default to the original path if no attack is detected.

Rate-distortion performance (PSNR vs. BPP) across various LIC models under different attack strengths.

Insights

  • Self-Judging Encoders: Unlike classification, where ground truth is unknown at test time, compression encoders can use the input image as ground truth to evaluate their own performance and select the most robust path.
  • Model Capacity vs. Vulnerability: Higher-capacity models were found to be more vulnerable, likely due to tighter overfitting to data distributions, providing a clearer target for attackers.
  • Randomization as a Shield: Simple transforms are sufficient to misalign adversarial noise with the model's learned filters.

Discussion and Future Work

While effective, the primary drawback is increased encoding latency, as the image must be processed twice. However, for high-performance models with autoregressive components, this overhead is relatively marginal, and decoding speed remains unaffected.

Future work may explore adaptive attacks where the adversary attempts to find perturbations robust across multiple transforms. While the authors found that $K=2$ (Two-way) offers the best balance, further scaling of the number of transforms ($K$-way compression) remains an area for exploration.

Conclusion

The Two-way Compression framework provides a practical, training-free solution to the adversarial vulnerability of learned image compression. By combining random transforms with self-supervised path selection, it offers robust protection against both rate and distortion attacks without compromising performance on clean data.

Summary updated

BibTeX
@misc{song2024training,
  author = {Myungseo Song and Jinyoung Choi and Bohyung Han},
  title = {{A Training-Free Defense Framework for Robust Learned Image Compression}},
  year = {2024},
  eprint = {2401.11902},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.11902},
}
Figure