wai-rs: jpegai_icci::IcciNet — the eICCI filter, float-exact vs the ONNX #15

Merged
dcharlot merged 1 commit from feat/jpegai-icci-net2 into main 2026-07-15 09:07:48 -04:00

2026-07-15

Transaction Science
wai-rs: jpegai_icci::IcciNet — the eICCI filter, float-exact vs the ONNX
Completes eICCI, the last unported JPEG-AI decode stage: three planes in, three
refined planes out (wavelet transform included).

The shipped ONNX is much smaller than the reference Python class implies — trust the
export, not icci_models.py:

  class says   nf=64, nbY=8, nbUV=8
  ONNX is      nf=48, nbY=2, nbUV=4     (145,265 params, 21 tensors)

and the exporter has already folded/deduped nearly everything: the luma stem's BN is
folded into onnx::Conv_8299; every conv bias is zero (hence deduped to one tensor);
every block scale equals scaleY=0.1 (also deduped); BNUV is γ=1,β=0,μ=0,σ²=1, i.e.
x/√(1+ε), folded into conv_firstUV here.

IcciNet also drops a redundancy: the reference's process_U and process_V each rebuild
the same chroma features, so it runs that trunk twice. The trunk is evaluated once and
fed to both heads — identical output, half the chroma work.

Validated against the ONNX itself (planes → planes, ort): max|Δ| = 0.0 / 1e-7 / 0.0 for
Y/U/V. Float, not quantised: the net is float in the reference, and IEEE-754 with a
fixed accumulation order is deterministic across machines — so the port is byte-identical
and carries no PTQ error.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-15 09:07:07 -04:00