Picking Up Quantization Steps for Compressed Image Classification

Li Ma, Peixi Peng, Guangyao Chen, Yifan Zhao, Siwei Dong, Yonghong Tian · DOI

Introduction

Deep neural networks (DNNs) have achieved remarkable success in image classification, yet they possess a significant vulnerability: sensitivity to lossy compression. A model trained on high-resolution images may misclassify a "Bald Eagle" as a "Kite" simply due to the artifacts introduced by JPEG compression. This sensitivity creates a "distribution shift" between clean training data and the compressed images encountered in real-world deployments.

The Mechanics of JPEG Compression

Lossy compression algorithms like JPEG reduce file size by discarding information less perceptible to the human eye. This is primarily achieved through quantization.

The JPEG encoding process, where the quantization step introduces lossy artifacts by dividing frequency components by specific steps.

During encoding, an image is partitioned into 8x8 blocks, transformed via Discrete Cosine Transform (DCT), and then quantized using a specific "quantization table." While these tables are essential for decoding, they are typically ignored by downstream classification models. Researchers from Peking University argue that these discarded parameters are actually a "goldmine" of information regarding the specific distortions present in an image.

The Quantization Aware Method (QAM)

To address the degradation caused by compression, the authors propose the Quantization Aware Method (QAM). Instead of treating compression as random noise, QAM leverages the quantization tables found in JPEG headers to inform the model's internal processing.

The QAM framework utilizes quantization steps from the JPEG decoder to adjust model predictions, correcting errors made by baseline models.

QAM consists of two primary innovations:

  1. Quantization Aware Confidence (QAC): This component assigns weights to training samples based on their compression loss. Images with high quantization steps (heavy distortion) are given lower confidence scores, preventing the model from over-fitting to heavily corrupted features.
  2. Quantization Aware Batch Normalization (QABN): Standard Batch Normalization (BN) fails when data distributions vary across different compression levels. QABN introduces a meta-learning approach where a "meta-learner" analyzes the input's quantization table to dynamically adjust normalization parameters. This allows the model to create custom normalization layers tailored to the specific Quality Factor (QF) of each input image.

Experimental Results

The researchers evaluated QAM across several benchmarks, including CIFAR-10-J, CIFAR-100-J, and ImageNet-J. The results demonstrate significant improvements in robustness:

  • CIFAR-100-J: QAM achieved a 6.3% accuracy boost over baseline models.
  • ImageNet-J: The method provided a 1.2% improvement, a notable gain on a large-scale dataset.
  • Generalization: The model also showed improved performance on other formats like WebP and JPEG2000, suggesting that the meta-learner captures fundamental principles of quantization-induced distortion rather than just memorizing JPEG patterns.

Conclusion

By "picking up" the quantization steps usually discarded during decoding, QAM provides an elegant and efficient solution for making image classifiers robust to real-world data. This research highlights the value of utilizing metadata to bridge the gap between clean training environments and the lossy reality of digital image storage.

Summary updated

BibTeX
@article{ma2023picking,
  author = {Li Ma and Peixi Peng and Guangyao Chen and Yifan Zhao and Siwei Dong and Yonghong Tian},
  title = {{Picking Up Quantization Steps for Compressed Image Classification}},
  journal = {IEEE Trans. Circuits Syst. Video Technol.},
  year = {2023},
  doi = {10.1109/tcsvt.2022.3218104},
}
Figure