In neural image compression, the goal is to transform an image into a compact latent representation and then estimate the probability distribution of that representation as accurately as possible. The more accurately we can predict a pixel's value based on its neighbors, the fewer bits we need to store it.
While early models focused on capturing spatial redundancies (predicting a pixel from those to its left and top), a new wave of research has identified a massive untapped source of efficiency: cross-channel correlations. By treating the latent space as a true 3D volume rather than a stack of independent 2D maps, researchers are achieving state-of-the-art compression that outperforms traditional standards like BPG and VVC.
The Shift from 2D to 3D Context
Standard entropy models often use 2D masked convolutions to look at previously decoded spatial neighbors. However, as Zongyu Guo and colleagues point out in Latent-Separated Global Prediction for Learned Image Compression, these models fail to exploit the complex dependencies that exist across different channels at the same spatial coordinate.
Imagine a latent representation with 128 channels. If channel 1 contains a high-frequency edge at a specific pixel, there is a high probability that channels 2 through 10 also contain related information at that same spot. 3D context modeling treats the channel dimension as a third spatial axis, allowing the model to "see" into the depth of the latent tensor.
3D Masked Convolutions
The most direct implementation of this idea is the 3D masked convolution. In the NLAIC framework, Haojie Liu, Tong Chen, and their team demonstrate that 3D convolutions can capture inter-channel redundancies more effectively than traditional 2D approaches.
As detailed in Non-local Attention Optimized Deep Image Compression, this multi-dimensional context modeling serves two purposes:
- Parameter Efficiency: It reduces the number of parameters required for probability estimation compared to sequential 2D models.
- Accuracy: It captures simultaneous spatial and cross-channel dependencies in a single pass, leading to a tighter estimate of the latent distribution.
Channel Grouping and Causal Prediction
A common challenge with 3D context is maintaining causality—you can't use information to predict a pixel if that information hasn't been decoded yet. To solve this, researchers like Zongyu Guo propose splitting latent representations into groups.
In the 3-D Context Entropy Model for Improved Practical Image Compression, the latents are partitioned. The first group is decoded using only spatial neighbors. Subsequent groups, however, can use both their spatial context and the already-decoded information from previous channel groups at the exact same spatial location. This "group-wise" approach allows the model to aggregate global context without transmitting extra overhead.
Beyond Local Context: Non-Local Attention
While 3D context handles local spatial and channel dependencies, it is often paired with non-local attention to capture global patterns. Standard convolutional networks are "nearsighted," focusing on small receptive fields. Tong Chen and Zhan Ma show in Neural Image Compression via Non-Local Attention Optimization and Improved Context Modeling that non-local modules allow the encoder to recognize similar textures or structures across the entire image, intelligently allocating bits to the most critical regions.
Why It Works: The Intuition
The success of 3D context modeling boils down to conditional entropy. The more information ($C$) we can condition our probability estimate ($P(x|C)$) on, the lower the resulting bitrate. By expanding the condition $C$ from "pixels to the left and top" to "pixels to the left, top, and in the channels beneath," we provide the model with a much richer set of clues.
Recent advancements like GroupedMixer, developed by Daxin Li and Junjun Jiang, further refine this by using transformer-based token mixers. As described in GroupedMixer: An Entropy Model With Group-Wise Token-Mixers for Learned Image Compression, this approach breaks the trade-off between performance and speed, running hundreds of times faster than previous models while maintaining the benefits of 3D dependency modeling.