Image compression method and system based on adaptive channel and spatial window entropy model
By using an adaptive channel and spatial window entropy model, image compression is achieved by leveraging the correlation between channels and space, thus solving the problem of unclear image decoding in existing technologies and realizing more efficient image compression and a better visual experience.
Patent Information
- Application Number
- CN202310675737.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-08
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2043-06-08
AI Technical Summary
Existing channel entropy and spatial entropy models fail to effectively utilize the global correlation between channel latent state variables and the local correlation between anchor and non-anchor features in image compression, resulting in unclear decoded images and poor visual experience.
An adaptive channel and spatial window entropy model is adopted. The adaptive channel entropy model is used to update the channel by utilizing the correlation between channels. The window-based spatial entropy model is combined to predict the spatial context of non-anchor features. An adaptive update layer and a channel activation layer are used to enhance the useful response. The spatial transformer layer captures local semantic features, thereby achieving more accurate channel and spatial context prediction.
It improves image decoding clarity, reduces the number of bits required for encoding, saves storage space for compressed images, and enhances the quality of decoded images.
Smart Images

Figure CN116567240B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an image compression method and system based on an adaptive channel and spatial window entropy model, belonging to the field of image compression technology. Background Technology
[0002] Image compression is a crucial task in computer vision, significantly reducing the burden on storage devices and communication networks. In 1992, the Joint Group of Image Experts (JEEG) released the first international image compression standard, JPEG, which has become the most widely used compression standard in the world. JPEG2000, created in 2000, significantly improved upon JPEG. One of the most important improvements was replacing JPEG's Discrete Cosine Transform (DCT) with Discrete Wavelet Transform (DWT). To further enhance compression performance, advanced codecs such as AVC, HEVC, and VVC were developed. These advanced codecs use various intra-frame prediction modes to predict the value of the current pixel based on previously encoded pixels and employ more transform types, such as Discrete Sine Transform (DST) and Hadamard Transform (WHT), to handle residual signals. These methods typically employ hand-customized hybrid coding schemes, including prediction, transform, quantization, and entropy coding. However, hand-customized coding rules are less flexible and may limit image compression performance. In recent years, deep learning-based image compression methods have made significant progress, achieving better rate-distortion performance than traditional image compression methods. Balle et al. designed the first end-to-end optimized image compression method using convolutional neural networks. Subsequently, many methods were developed to further improve compression performance. Learning-based image compression follows a coding framework consisting of nonlinear transformation, quantization, and an entropy model. The nonlinear transformation converts the original RGB image into latent state variables, quantization converts continuous latent state variables into discrete integer values, the entropy model estimates the probability distribution of the quantized latent state variables, lossless encoding and decoding are performed based on the probability estimates, and finally, the decoded latent state variables are converted back into the decoded image through a nonlinear transformation.
[0003] Existing channel entropy models and spatial entropy models mostly use stacked convolutional neural networks to estimate spatial and channel contexts, without considering the global correlation between channel hidden state variables and the local correlation between anchor and non-anchor features, resulting in unclear decoded images and a poor visual experience. Summary of the Invention
[0004] The technical problem solved by this invention is to overcome the shortcomings of existing technologies and provide an image compression method and system based on an adaptive channel and spatial window entropy model, which can greatly save the bits required for image compression and significantly improve the clarity of decoded images.
[0005] Technical solution of the present invention:
[0006] In a first aspect, the present invention provides an image compression method based on an adaptive channel and spatial window entropy model, implemented as follows:
[0007] Step 1: Convert the input image to be compressed into hidden state variables;
[0008] Step 2: Input the hidden state variables into the super-prior analysis downsampling network to obtain super-prior variables; encode and decode the super-prior variables, and input the decoded super-prior variables into the super-prior synthesis upsampling network to obtain upsampled super-prior variables;
[0009] Step 3: Divide the hidden state variables into multiple channel hidden state variables according to the channels in a non-uniform channel division. For each channel hidden state variable, execute steps 4, 5, 6 and 7 in sequence.
[0010] Step 4: Use a chessboard approach to spatially partition the hidden state variables of each channel. The result of the spatial partitioning is divided into anchor features and non-anchor features.
[0011] Step 5: For the first channel hidden state variable, input the upsampled prior variable from Step 2 into the adaptive channel entropy model to predict the channel context; for other channels, input all decoded channel hidden state variables and upsampled prior variables into the adaptive channel entropy model to predict the channel context; input the predicted channel context into two identical anchor parameter transform networks to predict the mean and variance of the anchor features, perform lossless encoding on the anchor features based on the mean and variance to obtain the encoded bitstream, and decode the bitstream to obtain the decoded anchor features;
[0012] Step 6: Input the decoded anchor features from Step 5 into the spatial context of the window-based spatial entropy model to predict the non-anchor features; input the spatial context of the non-anchor features and the channel context predicted in Step 5 into two identical non-anchor parameter transform networks to predict the mean and variance of the non-anchor features; perform lossless encoding on the non-anchor features based on the mean and variance to obtain the encoded bitstream; and decode the bitstream to obtain the decoded non-anchor features.
[0013] Step 7: Merge the decoded anchor features from Step 5 and the decoded non-anchor features from Step 6 in a chessboard-like space to obtain the decoded channel hidden state variables.
[0014] Step 8: Merge all the hidden state variables of the decoded channels according to the channel dimension to obtain the decoded hidden state variables, and input the decoded hidden state variables into the parameter synthesis transform network to obtain the decoded image.
[0015] To further optimize the above technical solution, the present invention also includes the following technical measures.
[0016] Furthermore, in step 5, the adaptive channel entropy model is composed of four stages of feature transformation networks connected sequentially. Each stage of the feature transformation network includes two adaptive update layers and a channel activation layer connected to them. For the first channel hidden state variable, the channel context is initialized as an upsampled super-prior variable. For other channels, the channel context is initialized by connecting the upsampled super-prior variable and all decoded channel hidden state variables on the channel.
[0017] Each adaptive update layer updates the channels using the correlation between channels, specifically the m-th channel in the channel context. The update method is as follows:
[0018]
[0019] Where t represents the number of updates, β is the learned parameter, and N i Indicates the channel context S t The number of central channels, This represents the cosine similarity measure between channels;
[0020] The channel activation layer suppresses irrelevant channel contexts in the updated channel context and enhances relevant channel contexts. The enhancement and suppression of channels are represented as follows:
[0021] S t+1 =S t (σ(W2δ(W1(AVG(S t )))))
[0022] Among them, S t+1 It is the updated channel context, S t For the channel context, δ is the ReLU activation function, σ is the sigmoid activation function, and AVG represents average pooling; W1 and W2 are the parameters of two linear layers in the channel activation layer. To reduce complexity, the first linear layer reduces the channel dimension to its original size. The second linear layer restores the channels to their original channel dimensions.
[0023] Furthermore, in step 6,
[0024] The window-based spatial entropy model includes an encoding network and a decoding network. The encoding network divides the anchor features into M×M non-overlapping windows, where M is the size of the window. The encoding network consists of a positional encoding layer and two spatial transformer layers connected in sequence. The positional encoding layer distinguishes different features in the window by adding a fixed parameter to the features within each window. The spatial transformer layers capture global semantic features and realize feature aggregation.
[0025] The decoding network consists of a positional encoding layer and two spatial transformer layers. The encoding network only processes anchor features, while the decoding network obtains the initial representation of non-anchor features by adding 0s to non-anchor positions. Then, it obtains the spatial context of the predicted non-anchor features by passing through the positional encoding layer and the spatial transformer layers in sequence.
[0026] Secondly, the present invention provides an image compression system based on an adaptive channel and spatial window entropy model, including a parameter analysis transformation network, a priori analysis downsampling network and a priori synthesis upsampling network, a channel partitioning module, a spatial partitioning module, an adaptive channel entropy model, a window-based spatial entropy model, an anchor point and non-anchor point parameter transformation network, and a parameter synthesis transformation network.
[0027] Parametric analysis transform network: transforms the input image to be compressed into hidden state variables;
[0028] Super-prior analysis downsampling network and super-prior synthesis upsampling network: The hidden state variables are input into the super-prior analysis downsampling network to obtain super-prior variables. The super-prior variables are encoded and decoded. The decoded super-prior variables are input into the super-prior synthesis upsampling network to obtain upsampled super-prior variables.
[0029] Channel partitioning module: Divides the hidden state variables into multiple channels by non-uniform channel partitioning;
[0030] Spatial partitioning module: Divides the hidden state variables of each channel into anchor features and non-anchor features using a chessboard-like spatial partitioning;
[0031] Adaptive channel entropy model: Input the already encoded channel latent state variables and upsampled prior variables into the adaptive entropy model to predict the channel context of the channel latent state variables to be encoded;
[0032] Window-based spatial entropy model: Input the encoded anchor features into the window-based spatial entropy model to predict the spatial context of non-anchor features;
[0033] Anchor parameter transformation network and non-anchor parameter transformation network: Input the channel context into two identical anchor parameter transformation networks to predict the mean and variance of anchor features, and input the spatial context and channel context of non-anchor features into two identical non-anchor parameter transformation networks to predict the mean and variance of non-anchor features;
[0034] Parametric synthesis transform network: The hidden state variables of all channels are merged according to the channel dimension to obtain the decoded hidden state variables, and the decoded hidden state variables are input into the parametric synthesis transform network to obtain the decoded image.
[0035] Thirdly, the present invention provides an electronic device (computer, server, smartphone, etc.) including a processor and a memory;
[0036] Memory, used to store computer programs;
[0037] The processor is used to execute computer programs stored in memory, and during execution, it implements an image compression method based on an adaptive channel and spatial window entropy model.
[0038] Fourthly, the present invention provides a computer-readable storage medium (such as ROM / RAM, disk, optical disk) storing a computer program thereon, wherein the computer program, when executed by a processor, implements an image compression method based on an adaptive channel and spatial window entropy model.
[0039] Advantages of this invention compared to existing technologies:
[0040] (1) The present invention can improve the accuracy of channel context and spatial context, thereby improving the accuracy of hidden state variable mean and variance prediction, reducing the number of bits required for encoding, and improving the clarity of decoded images.
[0041] This invention predicts channel and spatial context based on an adaptive channel entropy model and a window-based spatial entropy model. The adaptive channel entropy model consists of a four-stage feature transformation network. Each stage of the feature transformation network comprises two adaptive update layers and one channel activation layer. The adaptive update module updates the channel context based on the correlation between channels, while the channel activation module suppresses irrelevant channel responses and enhances useful channel responses. The window-based spatial entropy model effectively utilizes the local nature of image compression, using a spatial transformer to aggregate features within a local window and employing positional encoding to distinguish the positions of different feature points within the window. Based on the predicted channel and spatial context, an anchor parameter transformation network is used to predict the mean and variance of anchor features, and a non-anchor parameter network is used to predict the mean and variance of non-anchor features. Anchor and non-anchor features are then encoded and decoded based on the predicted mean and variance, respectively. Therefore, the adaptive channel entropy model and the window-based spatial entropy model of this invention can improve the accuracy of channel and spatial context prediction, thereby improving the accuracy of hidden state variable mean and variance prediction, reducing the number of bits required for encoding, and improving the clarity of the decoded image.
[0042] (2) This invention proposes an adaptive channel entropy model that can more accurately predict channel context, reduce channel redundancy of hidden state variables, thereby saving the number of bits required for encoding and improving the quality of the decoded image.
[0043] Traditional channel entropy models are typically implemented using several convolutional layers and activation functions. This approach fails to effectively utilize the correlation between the channel to be encoded and the already encoded channels. This invention employs a four-stage feature transformation network to predict the context of the channel to be encoded. Each stage of the feature transformation network consists of two adaptive update layers and one channel activation layer. The adaptive update module updates the channel context adaptively based on the correlation between channels, while the channel activation module suppresses irrelevant channel responses and enhances useful channel responses. Therefore, the adaptive channel entropy model of this invention can more accurately predict the channel context, reduce channel redundancy in latent state variables, thereby saving the number of bits required for encoding and improving the quality of the decoded image.
[0044] (3) This invention proposes a window-based spatial entropy model, which can more accurately predict the spatial context of non-anchor features, reduce spatial redundancy of images, save the number of bits required for encoding, and improve the quality of decoded images.
[0045] This invention's window-based spatial entropy model effectively leverages the local nature of image compression. It uses a spatial transformer to capture global semantic features within a window and employs positional encoding to distinguish the positions of different feature points within the window. This enables the prediction of the spatial context of non-anchor features based on encoded anchor features. Therefore, this window-based spatial entropy model can more accurately predict the spatial context of non-anchor features, reduce spatial redundancy in the image, save bits required for encoding, and improve the quality of the decoded image. Attached Figure Description
[0046] Figure 1 This is a flowchart illustrating the implementation of the method of the present invention;
[0047] Figure 2 This refers to a spatial division method;
[0048] Figure 3 The image compression performance on the Kodak dataset is shown in the figure, which is compared with the intra-frame coding method of the VVC encoding and decoding algorithm. In the figure, a is the multi-scale structural similarity performance figure and b is the peak signal-to-noise ratio performance figure. Detailed Implementation
[0049] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0050] like Figure 1 As shown, the method of the present invention is specifically implemented as follows:
[0051] Step 1: Convert the input image to be compressed into hidden state variables;
[0052] This invention uses a parametric analysis transform network g a (x) maps the original image x to a hidden state variable y with 320 channels. The parametric analysis transformation consists of four convolutional layers with a stride of 2 and a kernel size of 5. Regularization is performed between adjacent convolutional layers using GDN.
[0053] Step 2: Input the hidden state variables into the super-prior analysis downsampling network to obtain the super-prior variables; encode and decode the super-prior variables, and input the decoded super-prior variables into the super-prior synthesis upsampling network to obtain the upsampled super-prior variables;
[0054] The advanced prior analysis downsampling network consists of five convolutional layers with a kernel size of 3, and adjacent convolutional layers are activated using GELU. The stride of the third and fifth convolutional layers is 2.
[0055] The super-prior synthetic upsampling network consists of five convolutional layers with a kernel size of 3, and adjacent convolutional layers are activated using GELU. The stride of the second and fourth convolutional layers is 2, and upsampling is achieved through sub-pixel convolutions.
[0056] Step 3: Divide the hidden state variables into 4 channels according to the channels to obtain 4 channel hidden state variables. The number of channels for each channel hidden state variable is 32, 32, 64, and 192 respectively. For each channel hidden state variable, execute steps 4, 5, 6, and 7 in sequence.
[0057] Step 4: Use a chessboard approach to spatially partition the hidden state variables of each channel. The result of the spatial partitioning is divided into anchor features and non-anchor features. The spatial partitioning method is as follows: Figure 2 As shown, the top, bottom, left, and right positions of non-anchor point features are all anchor point positions.
[0058] Step 5: For the first channel hidden state variable, input the upsampled prior variable from Step 2 into the adaptive channel entropy model to predict the channel context; for other channels, input all decoded channel hidden state variables and upsampled prior variables into the adaptive channel entropy model to predict the channel context; input the predicted channel context into two identical anchor parameter transform networks to predict the mean and variance of the anchor features, perform lossless encoding on the anchor features based on the mean and variance to obtain the encoded bitstream, and decode the bitstream to obtain the decoded anchor features;
[0059] (51) Adaptive channel entropy model g ce
[0060] To reduce dependencies between channels, the parameters of the later-encoded channels are obtained using the parameters of the previously decoded channels and the super-prior prediction. For the i-th channel block y... i This invention will decode the channel hidden state variables. and upsampling prior variables Merge into a channel set {S i,1 ,S i,2 ,…,S i,Ni}. For y i The k-th channel y to be encoded i,k , and y i,k Decoding channels with high correlation should be for y i,k Channel context prediction contributes more to the encoding process; therefore, the channel entropy parameter should be predicted based on the correlation between the decoded channel and the channel to be encoded. However, since the information of the encoded channel is completely unknown, these correlations cannot be explicitly utilized.
[0061] To address the aforementioned issues, this invention implicitly utilizes the aforementioned correlation prediction channel context.
[0062] This invention uses an adaptive update layer to update S. t Generate y iThe channel context, where t is the number of updates, and For any channel y to be encoded i,k This invention assumes S t The m-th channel It is related to channel y i,k Channels with strong correlation. In each iteration, this invention uses S t All other channels in the middle are used to update To generate y i,k Channel context prediction.
[0063] For any channel Assuming it is with The correlation is τ m,n These three channels are first normalized using the following method:
[0064]
[0065] Here, |·| is the L2 norm, and R(·) stretches a two-dimensional vector into a vector of length HW. Cosine similarity is used to measure the correlation between the three.
[0066]
[0067]
[0068]
[0069] According to the triangle inequality of cosine similarity, we have According to the above formula, τ n,k The lower bound of τ m,n The increase is due to the increase in the number of channels y to be encoded. i,k It is unknown, therefore this invention uses τ. m,n To approximate τ n,k The larger the τ m,k The more accurate the approximation, the better. Based on the above similarity, the channel context S t The m-th channel Update methods are as follows:
[0070]
[0071] Where t represents the number of updates, β is the learned parameter, and N i S represents t The number of central channels, This represents the cosine similarity measure between channels. Since it is unknown which specific predicted channel and the channel to be encoded are strongly correlated, this invention uses the above-described update strategy to update S. t All the channels in the middle.
[0072] In the above update strategy, all channels are assumed to have a strong correlation with the channel to be encoded. In reality, some channels are weakly correlated with the channel to be encoded, and therefore, these channels are considered useless. This invention uses a channel activation layer to suppress the responses of useless channels and enhance the responses of useful channels. First, an average pooling is used to compress the global spatial information of each channel into a channel descriptor. To capture the correlation between channels, a simple gating network and a sigmoid activation function are used to obtain the response weights of the channels.
[0073] Updated channel context S t+1 :
[0074] S t+1 =S t (σ(W2δ(W1(AVG(S t )))))
[0075] Where δ is the ReLU activation function, σ is the sigmoid activation function, W1 and W2 are the parameters of the two linear layers, and AVG represents average pooling. To reduce complexity, the first linear layer reduces the channel dimension to a fraction of the original. The second linear layer restores the channels to their original dimensions.
[0076] (52) Anchor point parameter transformation network g anch or
[0077] The channel context inputs two identical anchor point parameters to transform the network g. anch or to predict the mean and variance of anchor point features, g anchor This represents a 3x3 convolution.
[0078] Step 6: Input the decoded anchor features from Step 5 into the spatial context of the window-based spatial entropy model to predict the non-anchor features; input the spatial context of the non-anchor features and the channel context predicted in Step 5 into two identical non-anchor parameter transform networks to predict the mean and variance of the non-anchor features; perform lossless encoding on the non-anchor features based on the mean and variance to obtain the encoded bitstream; and decode the bitstream to obtain the decoded non-anchor features.
[0079] (61) Window-based spatial entropy model g ce
[0080] Since image compression is a local task, unlike computer vision tasks such as object classification and object detection, it cannot benefit from global semantic information. Therefore, this invention uses a window-based spatial entropy model to predict the spatial context of non-anchor locations.
[0081] The decoded anchor features are first divided into M×M non-overlapping windows, where M is the window size. This invention uses an encoding-decoding structure to predict the spatial context of non-anchor features within each window. The encoder and decoder have similar structures. The encoding network consists of a positional encoding layer and two spatial transformer layers connected sequentially. The positional encoding layer distinguishes different features in position within each window by adding a fixed parameter to the features within each window. The spatial transformer layers capture global semantic features and achieve feature aggregation.
[0082] The spatial transformer layer can be formalized as follows:
[0083] X l =MSA(LN(X) l-1 ))+X l-1 ,
[0084] X l =FFN(LN(X) l '))+X l ',
[0085] Among them, X l-1 X is the input of the l-th layer. l ' is the l-th level intermediate variable, X l It is the output of the l-th layer, and LN represents the Layernormalization regularization method.
[0086] MSA is a multi-head self-attention module, and FFN is a feedforward network module. The encoder input is used. To explain the execution process of MSA. Since the encoder only includes anchor features, the number of features is... Where C is the dimension of the feature. The number h of each attention head is set to 4, so the dimension of each head is... The self-attention of the p-th head is calculated as follows:
[0087]
[0088] in, This is the projection matrix of the query Q, key K, and value V. Then, the outputs of all the heads are concatenated and projected using a linear layer to obtain the final output.
[0089]
[0090] Where Linear represents a linear layer, Concat represents a concatenation operation, and Y1, Y2, ..., Y h Let represent the self-attention of the 1st, 2nd, ..., hth heads, respectively.
[0091] In the feedforward network FFN, a linear layer is first used to increase the dimension of each token to 4 times its original size, and then another linear layer is used to restore the original dimension. The GELU activation function is used between the two linear layers for activation.
[0092] (62) Non-anchor point parameter transformation network g non-anchor
[0093] This invention inputs the channel context and spatial context into two identical non-anchor parameter transform networks g. non-anchor Predict the mean and variance of the non-anchor features, g. non-anchor It consists of four linear layers, and the GELU activation function is used to activate every two linear modules.
[0094] Step 7: Merge the decoded anchor features from Step 5 and the decoded non-anchor features from Step 6 in a chessboard-like space to obtain the decoded channel hidden state variables.
[0095] Step 8: Merge all the hidden state variables of the decoded channels according to the channel dimension to obtain the decoded hidden state variables, and input the decoded hidden state variables into the parameter synthesis transform network to obtain the decoded image.
[0096] This invention uses a parameter synthesis transformation network g s (x) converts the decoded hidden state variables into the decoded image. The parametric analysis transformation consists of four deconvolutional layers with a stride of 2 and a kernel size of 5. Regularization is performed between adjacent convolutional layers using GDN.
[0097] like Figure 3 The image compression performance on the Kodak dataset is shown, compared with the intra-frame coding method of the VVC encoding / decoding algorithm. a is the multi-scale structural similarity performance map, and b is the peak signal-to-noise ratio performance map. The horizontal axis represents the number of bits required to encode each pixel, and the vertical axis represents different performance metrics. Figure 3 As can be seen, the present invention can save the number of bits required to compress images, improve peak signal-to-noise ratio (PSNR) and multi-scale structural similarity (MS-SSIM), and therefore the decoded images have higher clarity.
[0098] Based on the same inventive concept, another embodiment of the present invention provides an electronic device (computer, server, smartphone, etc.) including a memory and a processor, wherein the memory stores a computer program configured to be executed by the processor, and the computer program includes instructions for performing the steps of the method of the present invention.
[0099] Based on the same inventive concept, another embodiment of the present invention provides a computer-readable storage medium (such as ROM / RAM, disk, optical disk), which stores a computer program that, when executed by a computer, implements the various steps of the method of the present invention.
[0100] The above embodiments are provided merely for the purpose of describing the present invention and are not intended to limit the scope of the invention. The scope of the invention is defined by the appended claims. Various equivalent substitutions and modifications made without departing from the spirit and principles of the invention should be covered within the scope of the invention.
Claims
1. An image compression method based on adaptive channel and spatial window entropy model, characterized by, The following is achieved: Step 1: convert the input image to be compressed into a hidden state variable; Step 2: input the hidden state variable into the hyper-prior analysis down-sampling network to obtain a hyper-prior variable; encode and decode the hyper-prior variable, and input the decoded hyper-prior variable into the hyper-prior analysis up-sampling network to obtain an up-sampled hyper-prior variable; Step 3: divide the hidden state variable into multiple channel hidden state variables according to the channel, and sequentially perform steps 4, 5, 6 and 7 for each channel hidden state variable; Step 4: divide each channel hidden state variable into anchor point features and non-anchor point features in a chessboard manner; Step 5: for the first channel hidden state variable, input the up-sampled hyper-prior variable in step 2 into the adaptive channel entropy model to predict the channel context; for the non-first channel hidden state variable, input all decoded channel hidden state variables and the up-sampled hyper-prior variable into the adaptive channel entropy model to predict the channel context; input the predicted channel context into two identical anchor point parameter transformation networks to predict the mean and variance of the anchor point features, losslessly encode the anchor point features according to the mean and variance to obtain a bit stream, and decode the bit stream to obtain decoded anchor point features; Step 6: input the decoded anchor point features in step 5 into the window-based spatial entropy model to predict the spatial context of the non-anchor point features; input the spatial context of the non-anchor point features and the predicted channel context in step 5 into two identical non-anchor point parameter transformation networks to predict the mean and variance of the non-anchor point features, losslessly encode the non-anchor point features according to the mean and variance to obtain a bit stream, and decode the bit stream to obtain decoded non-anchor point features; Step 7: perform chessboard spatial merging on the decoded anchor point features in step 5 and the decoded non-anchor point features in step 6 to obtain decoded channel hidden state variables; Step 8: merge all decoded channel hidden state variables according to the channel dimension to obtain decoded hidden state variables, and input the decoded hidden state variables into the parameter synthesis transformation network to obtain a decoded image.
2. The image compression method based on adaptive channel and spatial window entropy model according to claim 1, characterized in that: In step 5, The adaptive channel entropy model is composed of four stages of feature transformation networks connected in sequence, and each stage of feature transformation network includes two adaptive update layers and a channel excitation layer connected thereto; for the first channel hidden state variable, the channel context is initialized as the up-sampled hyper-prior variable, and for the non-first channel hidden state variable, the channel context is initialized by connecting the up-sampled hyper-prior variable and all decoded channel hidden state variables in the channel; Each adaptive update layer utilizes the correlation between channels to update the channels, the mth channel in the channel context The update is done as follows: wherein, represents the number of updates, is a parameter of the learning, represents the channel context the number of channels in the middle, represents the cosine similarity measure between channels; The channel excitation layer suppresses irrelevant channel context in the updated channel context and enhances relevant channel context, and the enhancement and suppression of the channel are represented as follows: wherein, is the updated channel context, is the channel context, is a RELU activation function, is a sigmoid activation function, AVG denotes average pooling; are parameters of two linear layers in the channel excitation layer, to reduce complexity, the first linear layer reduces the channel dimension to , and the second linear layer restores the channel to the original channel dimension.
3. The image compression method based on adaptive channel and spatial window entropy model according to claim 1, characterized in that: In step 6, The window-based spatial entropy model comprises an encoding network and a decoding network, the encoding network divides anchor point features into non-overlapping windows, is the size of the window; the encoding network is sequentially connected by a position encoding layer and two spatial transformer layers; the position encoding layer distinguishes different features in the window by adding a fixed parameter to the features in each window; and the spatial transformer layer captures global semantic features and realizes feature aggregation. The decoding network is composed of a position encoding layer and two spatial transformer layers, the encoding network only processes anchor point features, and the decoding network obtains the initial expression of non-anchor point features by adding 0 to the non-anchor point features, and then obtains the predicted spatial context of the non-anchor point features by the position encoding layer and the spatial transformer layer.
4. An image compression system based on adaptive channel and spatial window entropy model, characterized by: The method comprises a parameter analysis transformation network, a hyper-prior analysis down-sampling network and a hyper-prior analysis up-sampling network, a channel division module, a spatial division module, an adaptive channel entropy model, a window-based spatial entropy model, an anchor point and non-anchor point parameter transformation network, and a parameter synthesis transformation network. The parameter analysis transformation network converts an input image to be compressed into a hidden state variable. The hyper-prior analysis down-sampling network and the hyper-prior analysis up-sampling network input the hidden state variable into the hyper-prior analysis down-sampling network to obtain a hyper-prior variable, encode and decode the hyper-prior variable, and input the decoded hyper-prior variable into the hyper-prior analysis up-sampling network to obtain an up-sampled hyper-prior variable. The channel division module performs non-uniform channel division on the hidden state variable to obtain multiple channel hidden state variables. The spatial division module divides each channel hidden state variable into anchor point features and non-anchor point features using a chessboard spatial division. The adaptive channel entropy model inputs the encoded channel hidden state variable and the up-sampled hyper-prior variable into the adaptive entropy model to predict the channel context of the channel hidden state variable to be encoded. The window-based spatial entropy model inputs the encoded anchor point features into the window-based spatial entropy model to predict the spatial context of the non-anchor point features. The anchor point parameter transformation network and the non-anchor point parameter transformation network input the channel context into two identical anchor point parameter transformation networks to predict the mean and variance of the anchor point features, and input the spatial context and the channel context of the non-anchor point features into two identical non-anchor point parameter transformation networks to predict the mean and variance of the non-anchor point features. The parameter synthesis transformation network encodes and decodes the mean and variance of the anchor point features to obtain decoded anchor point features, encodes and decodes the mean and variance of the non-anchor point features to obtain decoded non-anchor point features, and then performs chessboard spatial merging on the decoded anchor point features and the decoded non-anchor point features to obtain decoded channel hidden state variables.
5. An electronic device, comprising: The method comprises a processor and a memory. The memory is used to store a computer program. The processor is used to execute the computer program stored on the memory, and the execution realizes the method of any one of claims 1-3.
6. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the method of any one of claims 1-3. The computer program is executed by the processor to realize the method of any one of claims 1-3.
Citation Information
Patent Citations
Intelligent image compression optimization method combining asymmetric convolution block and conditional context
CN112866694A
Methods And Apparatuses For Learned Image Compression
US20200160565A1