NIC-RobustBench: A Comprehensive Open-Source Toolkit for Neural Image Compression and Robustness Analysis

Georgii Bychkov, Khaled Abud, Egor Kovalev, Alexander Gushchin, Sergey Lavrushkin, Dmitriy Vatolin, Anastasia Antsiferova

TL;DR

This paper introduces NIC-RobustBench, the first comprehensive open-source toolkit and benchmark designed to evaluate the adversarial robustness of Neural Image Compression (NIC) models. By integrating over 10 codecs, 8 attacks, and 9 defense strategies, the framework exposes critical vulnerabilities in modern learned image compressors, demonstrating that larger and generative models are highly susceptible to severe reconstruction artifacts and bitrate inflation.

What Problem Does This Paper Address?

Neural Image Compression (NIC) has emerged as a powerful alternative to traditional codecs like JPEG and WebP, frequently outperforming them in rate-distortion (RD) efficiency. Because of this, NIC models are increasingly being integrated into standard computer vision pipelines.

However, these deep learning-based codecs inherit a dangerous flaw from deep neural networks: extreme vulnerability to adversarial attacks. A malicious actor can introduce imperceptible perturbations to an image before compression, causing the codec to either output heavily distorted reconstructions or experience a massive explosion in compressed file size (bitrate). Even without malicious intent, some modern neural codecs fail catastrophically on certain natural images, producing bizarre, non-traditional artifacts.

Despite these risks, existing compression benchmarks focus almost exclusively on clean data performance. To bridge this gap, the authors developed a standardized framework to systematically analyze how these models break and how to defend them.

Figure 2. Examples of natural and artificial adversarial examples for neural compression (JPEG AI model). The left image is taken from the Open Images dataset (Kuznetsova et al., 2020), the right is taken from the Kodak dataset (Kodak, 1993).

Methods

The authors present NIC-RobustBench, a modular and scalable Python framework designed to automate and standardize robustness benchmarking. The toolkit includes:

  • 10+ Modern Codecs: Includes state-of-the-art architectures like LIC-TCM, ELIC, HiFiC, and the new neural standard, JPEG AI.
  • 8 Adversarial Attacks: Features 6 white-box attacks (such as MADC variations, I-FGSM, PGD, SSAH, and the compression-specific FTDA) and 2 black-box attacks (NES and Square Attack). These attacks operate across 6 unique optimization targets, such as maximizing reconstruction loss or inflating bits-per-pixel (BPP).
  • 9 Defense Strategies: Divided into random reversible transformations (e.g., Flip, Random Rotate, Random Color Reorder), ensembling techniques (Geometric Self-Ensemble), and adversarial purification networks (DiffPure, DISCO, MPRNet).
  • Downstream Task Evaluators: Tools to test how compression distortions impact subsequent computer vision tasks like image classification (ResNet50), object detection (YOLO11), and depth estimation (Depth Anything V2).
Figure 1. Adversarial attack on NIC with possible attack goals.

Datasets

The benchmark evaluates performance across five prominent image datasets:

  1. KODAK Photo CD: 24 uncompressed images (the gold standard for image compression evaluation).
  2. CITYSCAPES: A subset of 50 domain-specific images typically used for autonomous driving and segmentation tasks.
  3. NIPS 2017: An adversarial learning development set containing 1,000 images.
  4. ImageNet: Subsets used to validate high-resolution performance and downstream task accuracy.
  5. CLIC (Challenge on Learned Image Compression): A curated dataset of high-resolution images.

Key Insights and Ideas

  • Generative Codecs are Fragile: Codecs that rely on generative priors (like HiFiC, CDC, and QRes-VAE) are the most vulnerable to quality degradation. Because they map images to a global latent space, a tiny local perturbation can shift the latents globally, ruining the entire reconstructed image.
  • Capacity Reduces Robustness: There is a strong positive correlation (Spearman Corr = 0.724) between model size and vulnerability. Larger models allocate extra capacity to fine, high-frequency details, creating more pathways for adversaries to exploit.
  • Low Bitrate Acts as a Natural Shield: Codecs optimized for low bitrates naturally act as low-pass filters. They blur out fine details, effectively "erasing" adversarial noise during the compression process.
  • Orthogonal Attack Vulnerabilities: Robustness is target-dependent. Codecs that resist image quality degradation (like the MBT-2018 family) often prove to be the most vulnerable to bitrate inflation attacks.
  • Generic Defenses Hurt Compression Efficiency: Standard vision defenses (like MPRNet) can clean up adversarial noise but often introduce their own subtle artifacts, which degrade the rate-distortion efficiency even on clean, unattacked images.

Key Results

  • White-Box vs. Black-Box: White-box attacks like FTDA and MADC-$L_\infty$ cause severe drops in reconstruction metrics (SSIM, PSNR, VMAF). Conversely, standard query-based black-box attacks (NES, Square Attack) are highly inefficient against NIC models, yielding negligible degradation.
  • Downstream Impact: Object detection (YOLO11) is highly sensitive to adversarial compression, showing significant drops in IoU and F1 scores. Image classification and depth estimation models prove to be much more resilient.
  • Defense Performance: Diffusion-based purification (DiffPure) and DISCO are the most effective at stabilizing image quality metrics. Among geometric defenses, a simple lossless Flip outperforms complex rotations because it avoids interpolation artifacts.

Limitations and Future Work

  • Empirical Focus: The paper provides intuitive explanations for why certain architectures fail, but lacks a formal theoretical analysis of NIC robustness.
  • Defense Stacking: Due to the massive computational footprint of the evaluation pipeline (which required roughly 25,000 GPU-hours), the authors did not explore the effects of combining or stacking multiple defenses.
  • Computational Cost: Evaluating memory-heavy models like JPEG AI under iterative attacks remains computationally prohibitive for researchers without specialized, high-capacity hardware.

Summary updated

BibTeX
@misc{bychkov2025nic,
  author = {Georgii Bychkov and Khaled Abud and Egor Kovalev and Alexander Gushchin and Sergey Lavrushkin and Dmitriy Vatolin and Anastasia Antsiferova},
  title = {{NIC-RobustBench: A Comprehensive Open-Source Toolkit for Neural Image Compression and Robustness Analysis}},
  year = {2025},
  eprint = {2506.19051},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.19051},
}
Figure