Bridging the gap between image coding for machines and humans

Nam Le, Honglei Zhang, Francesco Cricri, Ramin G. Youvalari, Hamed Rezazadegan Tavakoli, Emre Aksu, Miska M. Hannuksela, Esa RahtuarXiv 2024 · DOI

TL;DR

This paper introduces a decoder-only finetuning scheme using PatchGAN adversarial training to eliminate the "checkerboard artifacts" common in machine-oriented image compression. The approach significantly improves visual quality for human viewers without increasing bitrate or inference complexity, and it maintains high accuracy for machine vision tasks like instance segmentation.

What Problem Does This Paper Address?

Traditional image compression (like JPEG or VVC) is designed for human eyes, prioritizing "looking good." In contrast, Image Coding for Machines (ICM) prioritizes "working well" for algorithms, such as object detectors or segmentation models. While ICM codecs achieve impressive compression ratios, their outputs—especially at low bitrates—often suffer from repetitive, grid-like "checkerboard artifacts."

These artifacts are a byproduct of the convolutional neural network (CNN) architectures used in modern codecs. While a machine vision model might still "see" the objects through the noise, these images are distracting or even unusable for human operators (e.g., a security guard monitoring a surveillance feed). Previous solutions often required separate bitstreams or complex multi-branch architectures to satisfy both humans and machines, which increases system complexity and data overhead.

Methods

The authors propose a novel finetuning strategy that treats a pre-trained ICM codec as a generator in a Generative Adversarial Network (GAN) framework.

  1. Baseline Codec: They start with a standard NN-based codec optimized for machine tasks using a "proxy loss" based on feature distortions rather than just pixel-wise errors.
  2. PatchGAN Discriminator: Instead of a global discriminator that looks at the whole image, they use a PatchGAN. This discriminator focuses on local image patches, which is ideal for identifying and penalizing the localized, repetitive nature of checkerboard artifacts.
  3. Decoder-Only Finetuning: To keep the bitrate identical to the original codec, the authors freeze the encoder and only finetune the first two layers of the decoder. This ensures that the latent representation (the compressed data) remains unchanged.
  4. Loss Function: The objective combines a vanilla GAN loss (to drive realism) with an $L_2$ distance constraint (to ensure the reconstructed image stays faithful to the original pixels).
Fig. 1. The overview of the finetuning scheme using Patch- GAN discriminator. The dashed lines denote gradient back- propagation flows and dotted boxes denote the parameters getting updated by the optimizer. The green lines indicate the data from the input of the ICM codec and the red lines indicate the data from the output of the ICM codec.

Datasets

The models were trained and evaluated using the Open Images V6 dataset, which contains 9.2 million high-quality images. For machine task evaluation, the authors focused on Instance Segmentation, following the testing conditions established by the MPEG Video Coding for Machines (VCM) group.

Key Insights and Ideas

  • Surgical Precision: One of the most surprising findings is that finetuning just the first two layers of the decoder is sufficient to remove artifacts. This suggests that the "checkerboard" problem is localized within specific parts of the reconstruction network.
  • Task-Agnostic Proxy: By using intermediate features from a Feature Pyramid Network (FPN) as a proxy loss, the codec remains effective across various vision tasks without needing to be retrained for every specific application.
  • The "Limited Impact" (LI) Sweet Spot: The authors discovered that by greatly attenuating the adversarial impact (lower learning rates and lower weights for the GAN loss), they could improve visual metrics like PSNR and SSIM without any loss in machine task performance (mAP).

Key Results

The proposed method effectively "cleans up" the image while maintaining a very low bitrate of approximately 0.057 bits per pixel (bpp).

  • Visual Quality: As shown in Figure 2, the finetuned codec almost entirely removes the grid patterns that plague the base model.
  • Quantitative Gains: In the "Limited Impact" (LI) configuration, the model matched the base codec's machine performance (0.766 mAP) while simultaneously improving human-centric metrics like PSNR and VGG perceptual loss.
  • Trade-offs: In more aggressive GAN settings, the artifacts were removed at a negligible cost of a -1.6% relative change in task performance.
Fig. 2. The codec finetuned with PatchGAN (middle) effectively removes the checkerboard artifacts commonly found in the decoded images of the NN-based convolutional codec such as the base model (left), while the codec finetuned with limited ad- versarial impact (right) only mildly suppresses the artifacts. More examples available at: https://flysofast.github. io/human-finetuned-icm/.
Table 1. Evaluation results of PatchGAN finetuning config- urations on different metrics. ↑denotes the higher the better and ↓denotes the lower the better. The average bitrate of outputs is 0.057 bits per pixel. Configuration with low adver- sarial impact settings are marked with “LI”

Limitations and Future Work

While the method is highly effective, the authors note that very small patch sizes (e.g., 32x32) in the discriminator provide less appealing results, likely due to limited context.

The discovery that only a small subset of decoder parameters is responsible for these artifacts opens a fascinating door for neural network explainability. Future work could investigate why these specific layers generate artifacts and whether architectural changes could prevent them from forming in the first place, rather than relying on post-hoc finetuning.

Summary updated

BibTeX
@misc{le2024bridging,
  author = {Nam Le and Honglei Zhang and Francesco Cricri and Ramin G. Youvalari and Hamed Rezazadegan Tavakoli and Emre Aksu and Miska M. Hannuksela and Esa Rahtu},
  title = {{Bridging the gap between image coding for machines and humans}},
  year = {2024},
  eprint = {2401.10732},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.10732},
}
Figure