TL;DR
Deep learning compresses images better than classical codecs, but usually requires slow, floating-point GPUs to open the files—where even a tiny rounding difference between chips can corrupt the entire image. PerLIC bridges this divide: it uses a GPU once during encoding to custom-fit a tiny, integer-only neural network that decodes bit-for-bit identically on any standard CPU. Its smallest model shrinks files by 8.4% more than JPEG XL while decoding at virtually the same speed (56 ms) on an 8-core CPU.
What Problem Does This Paper Address?
Lossless compression is non-negotiable for medical histology, satellite imagery, and archival photography—every pixel must be restored exactly as it was. Because an image is typically compressed once and opened many times across all kinds of hardware, a practical codec lives or dies by its decoder. Classical codecs like JPEG XL shine here: they decode rapidly and deterministically on any CPU.
Learned lossless codecs achieve smaller file sizes using neural networks to predict pixel probabilities, feeding those guesses into an entropy coder (an algorithm that assigns shorter bit sequences to likelier pixels). However, three roadblocks keep them out of everyday deployment:
- The floating-point trap: Floating-point math isn't associative—different GPUs or batch sizes add numbers in slightly different orders. If the decoder's probability table differs from the encoder's by even a single rounding error, the entropy coder desynchronizes and outputs garbage.
- The capacity crunch: Switching to strict integer math on a CPU fixes determinism, but matching JPEG XL's speed restricts you to a tiny fraction of a GPU network's operations, starving the tiny model of capacity and depth.
- Wasted probability in "gappy" histograms: Cheap decoders predict smooth, simple curves (like a single bell-shaped logistic curve). Yet in many images, color transformations leave systematic gaps between intensity values; smooth curves waste precious bits assigning probability to impossible values in those gaps.
Methods
PerLIC pairs an asymmetric GPU encoder with a tiny, deterministic CPU decoder:
- Integer-Only Predictor & Recurrent State: Instead of starting from raw pixels alone, the decoder extracts 93 classical integer features (like local gradients and classical predictor errors) from already-decoded neighbors. It feeds these into a tiny 8-bit integer multilayer perceptron (11.5k to 144k parameters) and decodes via 16 interleaved streams of range asymmetric numeral systems (rANS) so multiple CPU threads can work in parallel along diagonal wavefronts. To give this shallow network a wider view without adding layers, each pixel passes a 16-byte recurrent state—accumulating prediction errors—to future pixels.
- Per-Image Adaptation via a Persistent State Table: To restore capacity, the GPU encoder custom-fits low-rank adapters (LoRA-style weight updates) to each image and transmits them in the file header. Training through a sequential recurrent state across an entire image is normally excruciatingly slow, and cutting the recursion short by starting from zeros ruins accuracy. The authors introduce an unsent persistent state table on the encoder that caches the latest state of every pixel. During fitting, the encoder only recomputes the 8 immediate neighbor states and pulls deeper history straight from the table, followed by a fast head refit on exact integer activations to eliminate float-to-int mismatch.
- Decoder-Side Value Sets: To stop wasting probability on histogram gaps without sending bulky lookup tables, the decoder tracks which Blue values have actually appeared for each previously decoded (Red, Green) pair. It then renormalizes its smooth probability curve over just those seen values (plus an adaptive "escape" probability for new ones), controlled by a single per-image on/off switch in the file header.
Datasets
- Training: 798 crops ($512 \times 512$) drawn from 400 web photos and 398 area-reduced camera photos sourced from public datasets (including ImageNet, DIV2K, and CLIC).
- Evaluation: 250 images across seven benchmarks covering diverse domains: Kodak (24 classic photos), DIV2K (100 validation photos), CLIC 2024 (30 validation photos), Doc (24 historical maps), LoveDA (24 aerial photos), Histo (24 histology patches), and RS19 (24 satellite crops of $576 \times 576$ from WHU-RS19). No completely new datasets are introduced, though they assemble this multi-domain suite from established benchmarks and prior learned compression test sets (FNLIC).
Key Insights and Ideas
- Zero-initialized unrolls actively break recurrent compression: Usually, sequence models are trained with truncated backpropagation starting from zeroed states. Under exact full-image decoding, models trained or adapted from zero states up to 3 steps back actually compressed worse than having no recurrence at all! Storing stale states in a persistent table completely resolves this mismatch at a fraction of exact backpropagation's compute cost.
- Recurrence beats explicit depth at fixed compute: Sharing one recurrent state block across neighbors outperforms stacking two to four untied layers at roughly equal operations, shrinking files by an extra 1.36% to 2.79%.
- Zero-overhead gap recovery: You don't need a heavy mixture-of-logistics output head on every image to handle sparse color palettes. Because both encoder and decoder see the exact same causal pixels, the decoder can build color value sets on the fly—saving 12.2% on Kodak (which has color-transform gaps) and 6.3% on Histo for the price of a one-bit switch in the header.
Key Results
Bitrate vs. decoding time and MACs across lossless codecs
- Classical speed, learned compression: On 8 AVX-512 CPU cores, PerLIC-S (11.3k MACs/pixel) decodes in 55.5 ms per image—virtually tied with JPEG XL at 54.9 ms—while achieving 2.553 bits per sub-pixel (bpsp) vs. JPEG XL's 2.787 bpsp (an 8.4% reduction across the 250 images). Encoding takes 2.15 seconds on one H20 GPU.
- Matching heavy GPU codecs: PerLIC-L (143.7k MACs/pixel) reaches 2.462 bpsp and decodes in 233 ms on a CPU, slightly beating CALLIC (2.482 bpsp), the strongest evaluated GPU codec, while requiring 4× fewer MACs. PerLIC-S decodes 47–73× faster on an 8-core CPU than CALLIC does on a GPU.
- Universal bit-exactness: Every compressed stream decoded identically to the original image across 5 CPU architectures (AMD, Intel, and Apple ARM) and 5 NVIDIA GPU models.
Limitations and Future Work
- Image format & encoder hardware: The study only evaluates 8-bit RGB images, and per-image adapted encoding requires a GPU (though an unadapted 1-thread C encoder still beats JPEG XL by 3.5% in 0.9 s/image).
- Hardware sensitivity & memory: PerLIC-S leans heavily on modern AVX-512 VNNI integer dot-product instructions. Without them, it loses its tie with JPEG XL: it is slower on a single CPU thread (414 ms vs. 387 ms), 1.42× slower than JPEG XL on an 8-thread Apple M4 Pro, and 1.6× slower when restricted to AVX2 instructions. It also uses more RAM during decoding (92 MB vs. 15 MB for JPEG XL). Future directions are not explicitly discussed in the paper.
Summary updated