Towards Robust Neural Image Compression: Adversarial Attack and Model Finetuning

Tong Chen, Zhan Ma

Abstract: Neural Image Compression (NIC) has emerged as a powerful alternative to traditional codecs, offering superior compression rates. However, these models exhibit a critical vulnerability: extreme sensitivity to imperceptible input noise. This paper systematically explores this fragility by introducing the Fast Threshold-constrained Distortion Attack (FTDA), which exposes how tiny perturbations can lead to massive visual artifacts. Furthermore, the study demonstrates that Adversarial Training (AT) serves as an effective defense, enhancing model robustness against both malicious attacks and common real-world degradation like image recompression, without sacrificing baseline efficiency.

Introduction

The landscape of image compression has been transformed by deep learning. Modern Neural Image Compression (NIC) systems, utilizing complex architectures like Convolutional Neural Networks (CNNs) and attention mechanisms, now frequently outperform established standards such as JPEG and VVC in rate-distortion benchmarks. Despite these gains, the focus has remained primarily on efficiency, leaving the question of model robustness largely unaddressed. Unlike traditional rule-based codecs, NICs rely on high-dimensional non-linear mappings. This complexity introduces a hidden risk: small, carefully crafted errors in the input can be amplified through the network layers, resulting in catastrophic failures in the decoded output.

The Robustness Gap in Neural Compression

The core issue lies in the instability of the learned transformations. When an NIC model encounters an adversarial example—an image modified by a perturbation specifically designed to mislead the network—the resulting reconstruction quality plummets. This phenomenon can be viewed as a significant shift in the model's rate-distortion performance. For a given bitrate, the output quality for adversarial inputs is substantially lower than for natural images.

Conceptual shift in the rate-distortion curve for adversarial examples compared to natural images.

This vulnerability is not just a theoretical concern for security; it manifests in practical scenarios such as image recompression. In the digital ecosystem, images are frequently re-saved and re-uploaded. While traditional codecs like JPEG exhibit predictable, gradual degradation, baseline NIC models can amplify quantization errors over successive cycles, eventually producing glitchy, unrecognizable textures.

Methodology

To quantify and mitigate these risks, the authors approach the problem from both offensive and defensive standpoints:

  1. Fast Threshold-constrained Distortion Attack (FTDA): Standard adversarial attacks from classification tasks are often ill-suited for compression. The authors introduced FTDA, an untargeted attack designed to maximize decoded distortion while keeping the input noise below a strict visibility threshold. FTDA offers a superior balance between computational speed and attack effectiveness compared to existing methods like I-FGSM or CW-$l_2$.
  2. Adversarial Training (AT): To defend against such vulnerabilities, the researchers employed Adversarial Training. This process involves fine-tuning the NIC models using adversarial examples generated during the training phase. By exposing the network to noisy inputs and penalizing the resulting distortions, the model learns to produce stable reconstructions. The study specifically tested a fine-tuning approach where a pre-trained model is "vaccinated" with a small amount of adversarial data.

Experimental Results and Visual Analysis

The evaluation was conducted across several standard datasets, including Kodak and Vimeo90K. The results confirmed a universal vulnerability across various NIC architectures, including those based on CNNs and Invertible Neural Networks (INNs). Models optimized for perceptual metrics (like MS-SSIM) were found to be particularly fragile.

Visual comparison of reconstruction quality under adversarial attack for JPEG, baseline NIC, and adversarially trained (AT) NIC.

As shown in the visual comparisons, baseline NIC models under attack produce severe color artifacts and structural distortions that are absent in traditional JPEG reconstructions. However, the adversarially trained (AT) models successfully suppress these artifacts, maintaining a visual quality comparable to the original compressed image. Quantitatively, AT reduced the $\Delta$PSNR (a metric for noise amplification) significantly—for instance, from 17.29 dB down to 11.54 dB in the Ballé2016 model.

Conclusion

This research highlights a critical security and reliability flaw in state-of-the-art neural image compression. By exposing the link between adversarial vulnerability and recompression instability, the authors provide a unified framework for improving NIC robustness. Adversarial Training emerges as a practical solution that "fixes" these models for real-world use without degrading their primary function: efficient data compression. Future work will look toward improving the transferability of attacks and extending these robustness principles to other image processing tasks like super-resolution.

Summary updated

BibTeX
@article{chen2023towards,
  author = {Tong Chen and Zhan Ma},
  title = {{Towards Robust Neural Image Compression: Adversarial Attack and Model Finetuning}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2023},
  doi = {10.1109/tcsvt.2023.3276442},
}
Figure