Papers › Differentiable JPEG: The Devil is in the Details

Differentiable JPEG: The Devil is in the Details

13 Sep 2023arXiv:2309.06978archive 2025-07-28

Christoph Reich, Biplob Debnath, Deep Patel, Srimat Chakradhar

JPEG remains one of the most widespread lossy image coding methods. However, the non-differentiable nature of JPEG restricts the application in deep learning pipelines. Several differentiable approximations of JPEG have recently been proposed to address this issue. This paper conducts a comprehensive review of existing diff. JPEG approaches and identifies critical details that have been missed by previous methods. To this end, we propose a novel diff. JPEG approach, overcoming previous limitations. Our approach is differentiable w.r.t. the input image, the JPEG quality, the quantization tables, and the color conversion parameters. We evaluate the forward and backward performance of our diff. JPEG approach against existing methods. Additionally, extensive ablations are performed to evaluate crucial design choices. Our proposed diff. JPEG resembles the (non-diff.) reference implementation best, significantly surpassing the recent-best diff. approach by $3.47$dB (PSNR) on average. For strong compression rates, we can even improve PSNR by $9.51$dB. Strong adversarial attack results are yielded by our diff. JPEG, demonstrating the effective gradient approximation. Our code is available at https://github.com/necla-ml/Diff-JPEG.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2309.06978")

Code

Syntology Ran 9 of 15 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 9 ran with no contract checked.

By repository: official repository: 15 samples from 1 repository, 9 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

necla-ml/diff-jpeg officialmentioned in papermentioned on GitHubpytorchBSD-3-Clause report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 9 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

9ran
6unverified

Licence: 0 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from necla-ml/diff-jpeg. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

dct_8x8 necla-ml/diff-jpeg/diff_jpeg/encode.py official repository ran BSD-3-Clause (permissive) · 07f30b9bb91b2a38 · report
differentiable_clipping necla-ml/diff-jpeg/diff_jpeg/clipping.py official repository ran fingerprinted BSD-3-Clause (permissive) · e43f4d55023f4eb0 · report
differentiable_polynomial_floor necla-ml/diff-jpeg/diff_jpeg/rounding.py official repository ran fingerprinted BSD-3-Clause (permissive) · 1f5ed3bb36a1fdd6 · report
differentiable_polynomial_rounding necla-ml/diff-jpeg/diff_jpeg/rounding.py official repository ran fingerprinted BSD-3-Clause (permissive) · 4fa4c275e04771e2 · report
idct_8x8 necla-ml/diff-jpeg/diff_jpeg/decode.py official repository ran BSD-3-Clause (permissive) · 61c6ccfb962064cd · report
jpeg_coding necla-ml/diff-jpeg/non_diff_jpeg/opencv.py official repository ran BSD-3-Clause (permissive) · 11f4bba6d4dea611 · report
jpeg_quality_to_scale necla-ml/diff-jpeg/diff_jpeg/utils.py official repository ran BSD-3-Clause (permissive) · a933ca7ccd13b1f3 · report
patchify_8x8 necla-ml/diff-jpeg/diff_jpeg/encode.py official repository ran BSD-3-Clause (permissive) · a835ed9ff94efe03 · report
unpatchify_8x8 necla-ml/diff-jpeg/diff_jpeg/decode.py official repository ran BSD-3-Clause (permissive) · c0e44f696eaa3430 · report
chroma_subsampling necla-ml/diff-jpeg/diff_jpeg/color.py official repository unverified BSD-3-Clause (permissive) · ff20a283d1fb0d8d · report
dequantize necla-ml/diff-jpeg/diff_jpeg/decode.py official repository unverified BSD-3-Clause (permissive) · e66c126d26b54e6c · report
diff_jpeg_coding necla-ml/diff-jpeg/diff_jpeg/jpeg.py official repository unverified BSD-3-Clause (permissive) · 8cbdd2c6b920595c · report
quantize necla-ml/diff-jpeg/diff_jpeg/encode.py official repository unverified BSD-3-Clause (permissive) · 544144a7ead4418d · report
rgb_to_ycbcr necla-ml/diff-jpeg/diff_jpeg/color.py official repository unverified BSD-3-Clause (permissive) · 665e316c94707984 · report
ycbcr_to_rgb necla-ml/diff-jpeg/diff_jpeg/color.py official repository unverified BSD-3-Clause (permissive) · d7da9d25c1267dd1 · report

Tasks

Adversarial AttackQuantization

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections