Abstract
We introduce a stop-code tolerant (SCT) approach to training recurrent convolutional neural networks for lossy image compression. Our methods introduce a multi-pass training method to combine the training goals of high-quality reconstructions in areas around stop-code masking as well as in highly-detailed areas. These methods lead to lower true bitrates for a given recursion count, both pre- and post-entropy coding, even using unstructured LZ77 code compression. The pre-LZ77 gains are achieved by trimming stop codes. The post-LZ77 gains are due to the highly unequal distributions of 0/1 codes from the SCT architectures. With these code compressions, the SCT architecture maintains or exceeds the image quality at all compression rates compared to JPEG and to RNN auto-encoders across the Kodak dataset. In addition, the SCT coding results in lower variance in image quality across the extent of the image, a characteristic that has been shown to be important in human ratings of image quality.
Introduction
In traditional image compression standards like JPEG, the encoder naturally allocates fewer bits to simple regions (e.g., a clear sky) and more bits to complex textures. However, many early deep-learning-based compression models were constrained by a "fixed-depth" architecture, where every spatial region of an image was represented by the same number of bits regardless of local complexity.
While recurrent architectures allow for variable bitrates by adjusting the number of iterations, they typically apply the same number of iterations to the entire image. Simply "cutting off" transmission for specific tiles in a standard convolutional network often results in severe visual artifacts, such as blocking and blurring. This occurs because the convolutional layers in the decoder expect a continuous grid of data; when data for one tile is missing, the neighboring tiles—which rely on that data due to overlapping receptive fields—fail to reconstruct correctly.
Methods
The proposed architecture builds upon a recurrent Residual Scaling LSTM framework. The primary innovation is the Stop-Code Tolerant (SCT) training regime, which employs a multi-pass approach to teach the network to handle missing data gracefully.
SCT Masking Logic
The system monitors each $16 \times 16$ tile and stops transmitting data if the reconstruction quality hits a target threshold, if the encoder produces an all-zero code, or if the tile was already masked in a previous iteration. To ensure the decoder can handle these gaps, training is split into two passes:
- Forced Masking: An artificially high masking threshold is applied, forcing the network to practice reconstruction even when many neighboring tiles are missing. This reduces the decoder's reliance on adjacent symbols that might be trimmed.
- Natural Masking: A second pass uses the "natural" mask generated by the actual reconstruction quality, focusing on optimizing final accuracy.
Key Insights and Results
Spatial Adaptivity and Uniform Quality
By allowing the network to "stop" early on simple tiles, the model reallocates its bit budget to difficult sections, mimicking the efficiency of classical codecs. Interestingly, SCT leads to lower variance in quality across the image. The standard deviation of reconstruction error was 11% lower with SCT, confirming more consistent quality—a factor highly valued in human perception.
Biased Distributions for Compression
SCT training naturally biases the code distribution toward zeros. This makes the resulting bitstream significantly more efficient for standard entropy coders like LZ77 (gzip), even without specialized neural entropy coding.
Performance Metrics
- Bitrate Savings: SCT achieved a 35% reduction in bitrate over nominal rates. Approximately 30% of this gain came from physically trimming stop codes, while 5% resulted from the improved efficiency of the entropy coder on biased distributions.
- Visual Accuracy: At roughly 0.75 bits per pixel (bpp), the SCT model provided a lower $L_1$ error on 65% of the image compared to non-SCT versions.
Conclusion
The SCT training method successfully enables spatially adaptive neural image compression. By teaching the network to tolerate missing data through a multi-pass training regime, the authors achieved significant bitrate reductions and more uniform image quality. Future work may involve integrating fully learned, spatial-aware neural entropy coders and exploring adaptive thresholds to further optimize the rate-distortion curve.
Summary updated