# Optimizing JPEG Quantization for Classification Networks

arXiv: https://arxiv.org/abs/2003.02874 · HTML: https://mlsanity.com/paper/2003.02874/

## Key facts

- Cited by 6 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 5 Mar 2020.

## Built on by (most cited first, 6 of 6)

- [Diff-ICMH: Harmonizing Machine and Human Vision in Image Compression with Generative Prior](https://mlsanity.com/paper/2511.22549/) (2025)
- [Countering Adversarial Examples: Combining Input Transformation and Noisy Training](https://mlsanity.com/paper/2106.13394/) (2021)
- [Learned Lossless Compression for JPEG via Frequency-Domain Prediction](https://mlsanity.com/paper/2303.02666/) (2023)
- [TACTIC: Joint Rate-Distortion-Accuracy Optimisation for Low Bitrate Compression](https://mlsanity.com/paper/2109.10658/) (2021)
- [JPEG Compliant Compression for Both Human and Machine, A Report](https://mlsanity.com/paper/2503.10912/) (2025)
- [Learned JPEG Compression for DNN Vision](https://mlsanity.com/paper/2606.16185/) (2026)

## Abstract (arXiv)

Deep learning for computer vision depends on lossy image compression: it reduces the storage required for training and test data and lowers transfer costs in deployment. Mainstream datasets and imaging pipelines all rely on standard JPEG compression. In JPEG, the degree of quantization of frequency coefficients controls the lossiness: an 8 by 8 quantization table (Q-table) decides both the quality of the encoded image and the compression ratio. While a long history of work has sought better Q-tables, existing work either seeks to minimize image distortion or to optimize for models of the human visual system. This work asks whether JPEG Q-tables exist that are "better" for specific vision networks and can offer better quality--size trade-offs than ones designed for human perception or minimal distortion. We reconstruct an ImageNet test set with higher resolution to explore the effect of JPEG compression under novel Q-tables. We attempt several approaches to tune a Q-table for a vision task. We find that a simple sorted random sampling method can exceed the performance of the standard JPEG Q-table. We also use hyper-parameter tuning techniques including bounded random search, Bayesian optimization, and composite heuristic optimization methods. The new Q-tables we obtained can improve the compression rate by 10% to 200% when the accuracy is fixed, or improve accuracy up to 2% at the same compression rate.
