AI Image Compression Entropy Coding with Log-Variance Indexing
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional AI image compression technologies require significant computational resources for variance adjustment, leading to inefficiencies in the encoding and decoding processes.
Innovation Solution
Convert multiplication operations between variance and gain into addition operations between an index of the variance and a gain converted to a logarithm domain, and utilize a probability distribution table based on quantized indexes for entropy encoding, reducing computational overheads and enhancing efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Manufacturing precision
If conventional AI image compression algorithms perform variance adjustment through multiplication operations, then compression performance is achieved, but computational complexity and processing time increase significantly
Solution Approach 1:
The patent transforms the variance adjustment operation from multiplication in the original domain to addition in the logarithmic domain. By changing the parameter space (from linear scale to log scale), the complex multiplication operation becomes a simple addition operation, significantly reducing computational complexity while preserving compression performance
Solution Approach 2:
The patent replaces the computationally intensive multiplication mechanism with a simpler addition mechanism. This substitution of the operational mechanism (replacing multiplication with addition through logarithmic transformation) maintains the functional outcome of variance adjustment while dramatically reducing the computational burden
2Manufacturing precision
If conventional algorithms perform variance adjustment through multiplication operations, then compression effect is achieved, but encoding and decoding efficiency decreases
Solution Approach 1:
The patent changes the parameter representation from linear variance values to logarithmic variance indices. This parameter transformation converts the expensive multiplication operation into a cheap addition operation, thereby maintaining compression effect while significantly improving encoding efficiency
Solution Approach 2:
The patent pre-computes and stores probability distribution tables indexed by variance indices during the training phase. During encoding, this allows direct lookup and addition operations instead of real-time complex calculations, further boosting encoding efficiency while preserving compression performance
3Measurement precision
If conventional algorithms search for preset variance closest to calculated variance, then probability distribution selection is achieved, but computational overhead increases
Solution Approach 1:
The patent pre-computes probability distribution tables during training and stores them with variance indices. During inference, the system simply looks up the pre-computed probability distribution corresponding to the calculated variance index, eliminating the need for time-consuming search operations while maintaining accurate probability distribution selection
Solution Approach 2:
The patent creates a lookup table (probability distribution table) that copies pre-computed probability distributions for different variance levels. During encoding, instead of searching for the closest preset variance, the system directly retrieves the corresponding pre-computed probability distribution from the table, significantly reducing computational time while preserving selection accuracy
Data Source
Figure 1A
Figure 1B(1)~1B(2)
Figure 2A
AI summary
Embodiments of this application provide an encoding method, a decoding method, and an electronic device. The encoding method includes: obtaining a to-be-encoded image; performing feature extraction on the to-be-encoded image to obtain a first feature map; determining a probability distribution parameter corresponding to the first feature map, where the probability distribution parameter includes a first index of a variance; performing first adjustment on the first feature map based on a first gain vector to obtain a second feature map; performing second adjustment on the first index based on a second gain vector to obtain a second index, where the second gain vector is obtained by converting the first gain vector to a logarithm domain, and the second adjustment is an addition operation; and performing entropy encoding on the second feature map based on the second index to obtain a bitstream. In this way, a computation amount of variance adjustment can be reduced.