An image compression method based on local features and non-local features

By using a nonlinear transformation network and frequency domain interaction module based on local features and non-local features in the image compression algorithm, combined with the channel entropy model of non-local similarity, the existing technology solves the problem of failing to effectively integrate spatial and channel non-locality. feature issues, achieving more efficient image compression and decoding quality.

CN118317114BActive Publication Date: 2024-08-16UNIV OF SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410745648.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-08-16
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

Existing image compression algorithms based on non-local and local features fail to effectively fuse spatial and channel non-local features, and the channel entropy model can only remove local redundancy and cannot effectively remove non-local redundancy between different channels.

Method used

A nonlinear transformation network based on local features and non-local features is used to extract non-local features by combining spatial and channel attention, and the features are dynamically fused through the frequency domain interaction module. At the same time, a channel entropy model based on non-local similarity is proposed, using non-local similarity. Local features predict the mean and variance of hidden state features to remove non-local redundancy.

Benefits of technology

It improves the feature expression ability of hidden state features, reduces the number of encoding bits, and improves the quality of decoded images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118317114B
    Figure CN118317114B
Patent Text Reader

Abstract

The present invention provides an image compression method based on local features and non-local features, belonging to the field of image compression technology. The method is based on the nonlinear transformation of non-local features and local features, alternately uses space and channel attention to extract space and channel non-local features, uses depth-level convolution to extract local features, and uses frequency domain interaction modules to dynamically fuse local features and non-local features; based on the channel entropy model of non-local features, the mean and variance of the hidden state feature block to be encoded are predicted, and the non-local redundancy between different channels of the hidden state features is removed. The method can reduce the number of bits for encoding hidden state features and improve the quality of decoded images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of image compression, and in particular relates to an image compression method based on local features and non-local features. Background Art

[0002] Image compression is an application of data compression technology in the field of images. Its purpose is to reduce the redundancy in image data, thereby reducing the storage space required for images and the network bandwidth required for transmitting images. Traditional image compression standards include JPEG, JPEG2000, etc. These standards use discrete cosine transform or discrete wavelet transform to eliminate the redundancy of local image blocks and have been widely used in practical scenarios. In recent years, the intra-frame compression mode of video compression standards such as AVC, HEVC, and VVC has further improved the performance of traditional image compression standards. The intra-frame compression mode takes into account the redundancy between local image blocks of the image. The pixel value of the current image block can be predicted based on the pixel values ​​of the left and upper image blocks. Among them, the type of prediction direction can determine the accuracy of the prediction. AVC, HEVC and VVC use 9, 35 and 67 prediction directions respectively. Traditional image compression algorithms usually use manually designed technical solutions and lack flexibility.

[0003] In recent years, image compression algorithms based on deep learning have developed rapidly and achieved better compression performance than traditional image compression algorithms. Image compression algorithms based on deep learning generally use variational autoencoder structures. At the encoding end, the image to be encoded is input into a nonlinear analysis transformation to obtain hidden state features, the probability distribution of the hidden state features is predicted using a channel entropy model, quantized according to the predicted probability distribution, and the hidden state features are encoded into a bit stream using a lossless encoder. At the decoding end, a lossless decoder is first used to decode the bit stream into hidden state features, and then the decoded hidden state features are further input into a nonlinear synthesis transformation to obtain a decoded image. The key to image compression algorithms based on deep learning lies in the design of effective nonlinear transformations and entropy models.

[0004] The existing nonlinear transformations can be classified into nonlinear transformations based on local features, nonlinear transformations based on local features, nonlinear transformations based on nonlocal features, and nonlinear transformations based on local and nonlocal features. Since nonlocal features and local features can represent the structure and detail information of the image respectively, nonlinear transformations based on local features and nonlocal features achieve better performance than nonlinear transformations based on local features or nonlocal features. However, the existing nonlinear transformations based on nonlocal and local features still have the following two shortcomings. On the one hand, the existing nonlinear transformations based on nonlocal and local features only consider spatial nonlocal features, without considering channel nonlocal features. On the other hand, the existing nonlinear transformations based on nonlocal and local features only consider the extraction of local features and nonlocal features, without further exploring how to effectively fuse local features and nonlocal features.

[0005] Existing channel entropy models use convolutional neural networks to remove redundancy between channels. Since convolutional neural networks have local receptive fields, existing channel entropy models can only remove local redundancy between channels of hidden state features. However, the local details of different channels of hidden state features are usually different, while the non-local structural semantics and structural features are similar. Existing channel entropy models cannot remove non-local redundancy between different channels of hidden state features. Summary of the invention

[0006] To solve the above technical problems, the present invention provides an image compression method based on local features and non-local features. Based on the nonlinear transformation of non-local features and local features, spatial and channel attention are alternately used to extract spatial and channel non-local features, and depth-level convolution is used to extract local features. A frequency domain interaction module is proposed to dynamically fuse local features and non-local features; a channel entropy model based on non-local features is used to remove non-local redundancy between different channels of hidden state features.

[0007] To achieve the above object, the technical solution adopted by the present invention is as follows:

[0008] An image compression method based on local features and non-local features specifically comprises the following steps:

[0009] Step 1: Use a nonlinear analysis transformation network based on local features and non-local features Convert the input image x into hidden state features , the nonlinear analysis transformation network based on local features and non-local features Including convolutional layers, division regularization layers, and dual-aggregation Transformer layers;

[0010] Step 2: Hidden state features Input to the Hyper-Prior Analysis Transformation Network Get the super prior feature z, quantize the super prior feature z to get the quantized super prior feature , will quantize the hyper-prior features Lossless encoding into bit stream and then decoding, input into the super prior synthesis transformation network Get the upsampled hyper-prior feature ;

[0011] Step 3: Transform the hidden state features Divided into 4 channel hidden state feature blocks on the feature channel: the first channel hidden state feature block , the second channel hidden state feature block , the third channel hidden state feature block , the fourth channel hidden state feature block ;

[0012] Step 4: For the first channel hidden state feature block , the upsampled hyper-prior features Input to the channel entropy model to predict the first channel hidden state feature block The mean and variance , according to the predicted first channel hidden state feature block The mean and variance For the first channel hidden state feature block Quantize and losslessly encode into a bit stream, and decode the bit stream to obtain the first channel hidden state feature block decoded For the Channel hidden state feature block , , the upsampled hyper-prior features and the first one that has been decoded, , the k-1th channel hidden state feature block Input to the channel entropy model to predict Channel hidden state feature block The mean and variance , according to the predicted Channel hidden state feature block The mean and variance For Channel hidden state feature block Quantize and losslessly encode into a bit stream, and decode the bit stream to obtain the decoded Channel hidden state feature block ;

[0013] Step 5: Decode the first, second, third, and fourth channel hidden state feature blocks Concatenate on the feature channel to get the decoded hidden state features , the decoded hidden state features Input is a nonlinear synthesis transformation network based on local features and non-local features Get the decoded image ; Nonlinear synthetic transformation network based on local features and non-local features Including transposed convolution layer, inverse division regularization layer, and dual-aggregation Transformer layer.

[0014] The beneficial effects of the present invention are:

[0015] The nonlinear analysis and synthesis transformation network based on local features and non-local features proposed in the present invention can extract spatial non-local features and channel non-local features respectively. Spatial non-local features and channel non-local features are complementary and can effectively improve the feature expression ability of hidden state features in channels and spaces. At the same time, the present invention further considers that non-local features focus on the low-frequency information of the image, while local features focus on the high-frequency features of the image, and proposes a frequency domain interaction module to dynamically fuse non-local features and local features; in addition, the existing channel entropy models are all based on CNN networks, and the receptive field of CNN networks is limited, and can only remove the local redundancy of hidden state features. However, different channels of hidden state features mostly have different detailed local features, but share the same semantic non-local features. The present invention takes into account the above-mentioned non-local features and proposes a channel entropy model based on non-local similarity, which only uses non-local features to predict the mean and variance of the hidden state feature blocks to be encoded.

[0016] In summary, the nonlinear transformation model based on non-local features and local features and the channel entropy model based on non-local similarity proposed in the present invention can effectively reduce the number of bits for encoding latent state features and improve the quality of decoded images. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a network architecture diagram of an image compression method based on local features and non-local features of the present invention;

[0018] Figure 2 This is the network architecture diagram of the spatial aggregation attention layer of the present invention;

[0019] Figure 3 This is the network architecture diagram of the channel aggregation attention layer of the present invention;

[0020] Figure 4 This is the network architecture diagram of the frequency domain interaction module;

[0021] Figure 5This is a comparison chart of image compression performance between the present invention and other methods. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0023] like Figure 1 As shown, the present invention provides an image compression method based on local features and non-local features, which specifically includes the following steps:

[0024] Step 1: Use a nonlinear analysis transformation network based on local features and non-local features Convert the input image x into hidden state features , nonlinear analysis transformation network based on local features and non-local features It consists of a 5x5 convolutional layer with a stride of 2, a division regularization layer, and a dual-aggregate Transformer layer;

[0025] Step 2: Hidden state features Input to the Hyper-Prior Analysis Transformation Network Get the super prior feature z, quantify the super prior feature z to get the super prior feature , super prior features Lossless encoding into a bit stream, the bit stream is decoded and input into the super prior synthesis transformation network Get the upsampled super prior features ;

[0026] Step 3: Transform the hidden state features Divided into 4 channel hidden state feature blocks on the feature channel: the first channel hidden state feature block , the second channel hidden state feature block , the third channel hidden state feature block , the fourth channel hidden state feature block ;

[0027] Step 4: For the first channel hidden state feature block , the upsampled hyper-prior features Input to the channel entropy model to predict the first channel hidden state feature block The mean and variance , according to the predicted first channel hidden state feature block The mean and variance For the first channel hidden state feature block Quantize and losslessly encode into a bit stream, and decode the bit stream to obtain the first channel hidden state feature block decoded For the Channel hidden state feature block , , the upsampled hyper-prior features and the first one that has been decoded, , the k-1th channel hidden state feature block Input to the channel entropy model to predict The mean of the hidden state feature blocks of each channel and variance , according to the predicted The mean of the hidden state feature blocks of each channel and variance For Channel hidden state feature block Quantize and losslessly encode into a bit stream, and decode the bit stream to obtain the decoded Channel hidden state feature block ;

[0028] Step 5: Decode the first, second, third, and fourth channel hidden state feature blocks , , , Concatenate on the feature channel to get the decoded hidden state features , the decoded hidden state features Input nonlinear synthesis transformation network Get the decoded image , nonlinear synthetic transformation network It consists of a 5x5 transposed convolutional layer with a stride of 2, an inverse division regularization layer, and a double-aggregated Transformer layer.

[0029] Specifically, the dual-aggregation Transformer layer includes:

[0030] The dual-aggregation Transformer layer consists of a spatial aggregation Transformer layer and a channel aggregation Transformer layer. The spatial aggregation Transformer layer extracts and aggregates spatial non-local features and local features, and the channel aggregation Transformer layer extracts and aggregates channel non-local features and local features. The dual-aggregation Transformer layer is calculated as follows:

[0031]

[0032]

[0033]

[0034]

[0035] in, are input features, is the output feature of the spatial aggregation Transformer layer, is the output feature of the channel aggregation Transformer layer. SAAB is the spatial aggregation attention layer, and GDFN represents the gated feedforward layer; represents the output of the spatial aggregation attention layer SAAB, represents the output of the channel aggregation attention layer CAAB, and LN represents the layer normalization operation. Figure 2 As shown in the figure, the input features of the spatial aggregation attention layer are respectively input into the spatial attention layer and the depth-level convolution layer after the linear layer to extract the spatial non-local features and local features, and then the frequency domain interaction module is used to fuse the spatial non-local features and local features, and finally the output of the spatial aggregation attention layer is obtained through the linear layer.

[0036] CAAB is a channel aggregation attention layer, such as Figure 3 As shown in the figure, the input features of the channel aggregation attention layer are respectively input into the channel attention layer and the depth-level convolution layer after the linear layer to extract the channel non-local features and local features, and then the frequency domain interaction module is used to fuse the channel non-local features and local features, and finally the linear layer is used to obtain the output of the spatial aggregation attention layer.

[0037] Among them, the implementation of the spatial aggregation attention layer is as follows:

[0038]

[0039]

[0040]

[0041]

[0042] in, represents the spatial attention layer, Representing the spatial attention layer The output of , i.e., the spatial non-local features, represents the depth-level convolution, Represents local features, represents the frequency domain interaction module, represents the learned non-local feature weights, represents the learned local feature weights, represents the weight of the linear layer, Represents the output features of the spatial aggregation attention layer SAAB;

[0043] Specifically, for a width of , the height is , the number of channels is Input features , the spatial attention is first passed through three projection matrices Generate query Q, key K and value matrix V;

[0044] , ,

[0045] In order to reduce the computational complexity, Divided into sizes Window Matrix , , , and further divided into Head, , , . No. Spatial aggregation attention features of individual heads The calculation is as follows:

[0046]

[0047] Where T represents matrix transpose, i=1, 2, ... h, represents the activation function, Represents relative position encoding, scaling factor Spatial aggregation of attention features across all heads Cascade on the channel and linearly project to obtain features ;

[0048]

[0049] in, is the linear projection matrix, represents the channel cascade operation. Finally, the feature Transform window-based features to spatially non-local features of the same size as the input features .

[0050] The implementation of the channel aggregation attention layer is as follows:

[0051]

[0052]

[0053]

[0054]

[0055] in, Represents local features, represents the channel attention layer, Represents the channel attention layer The output of , that is, the channel non-local feature, Represents the output features of the channel aggregation attention layer CAAB.

[0056] Specifically, for a width of , the height is , the number of channels is Input features , the channel attention first passes through three projection matrices Generate query Q, key K and value matrix V and use the permutation operation Will The shape is converted to ;

[0057] ,

[0058] In order to enhance the feature expression ability, Divide into Head , , For the The channel aggregation attention features are calculated as follows:

[0059]

[0060] in, is a learnable parameter. Channel aggregation attention features of all heads Cascade on the channel and linearly project to obtain channel non-local features ;

[0061]

[0062] In addition, the frequency domain interaction module can generate weights to dynamically fuse non-local features and local features, such as Figure 4 As shown in the figure, the non-local features and local features are first concatenated through feature channels, and then the frequency domain features are obtained through a 1x1 convolution layer and a 2D Fourier transform. The frequency domain features are further converted through a 1x1 convolution layer, a Relu activation function, a 1x1 convolution layer, and a 2D inverse Fourier transform to obtain the learned non-local feature weights. .

[0063] When the frequency domain interaction module is used in the spatial aggregation attention layer, we define , when used in the channel aggregation attention layer, define For non-local features and local features ,in Represent the height, width and number of channels of the feature respectively. The frequency domain interaction layer is first cascaded on the channel. and , and use a Convolutional Layer Convert the cascaded feature channel dimension into , get the initial fusion features ;

[0064]

[0065] Initial fusion features The spectrum is obtained by further two-dimensional Fourier transform .

[0066]

[0067] in, , since the Fourier transform is Hermitian symmetric, only the information below the Nyquist frequency needs to be kept to maintain the complete information. Then, the complex feature The real part of and the imaginary part Cascade on the channel to get the cascaded features ;

[0068]

[0069] Furthermore, two The convolutional layer and Activation function is used to model the interaction of frequency domain features to obtain the features after interaction ;

[0070]

[0071] Finally, the interactive features Reconstruct into complex features and use inverse Fourier transform to obtain the learned non-local feature weights ;

[0072]

[0073] in, represents the reconstruction of complex feature operations, Refers to the inverse Fourier transform.

[0074] The channel entropy model includes:

[0075] The present invention takes into account the existence of non-local redundancy in different channels of hidden state features, and therefore, the channel entropy model only uses non-local features to eliminate non-local redundancy.

[0076] The channel entropy model predicts the first Channel hidden state feature block Channel context , channel context After two The convolutional layer predicts Channel hidden state feature block The mean and variance ;

[0077]

[0078]

[0079] Among them, DTB represents the dual-polymer Transformer layer, Indicates the first The convolutional layer, when When the input feature is the up-sampled hyper-prior feature ; Indicates the second The convolutional layer, when When the input feature For the first one that has been decoded, , the k-1th channel hidden state feature block and upsampled hyper-prior features Features after cascading on feature channels.

[0080] The implementation of DTB is as follows:

[0081]

[0082] According to The mean of the channel hidden state feature blocks and variance , use the ANS codec to The channel hidden state feature blocks are encoded and decoded.

[0083] exist Figure 5In the figure, the performance of the present invention and the VVC (H266) intra-frame compression method on the Kodak data set is tested, where the horizontal axis is the number of bits (bpp) required to encode each pixel, and the vertical axis is the peak signal-to-noise ratio. It can be seen from the figure that the method of the present invention can effectively improve the peak signal-to-noise ratio.

[0084] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An image compression method based on local features and non-local features, characterized in that: The steps include: Step 1: Use a nonlinear analysis transformation network based on local features and non-local features The input image Convert to hidden state features , the nonlinear analysis transformation network based on local features and non-local features Including convolutional layers, division regularization layers, and dual-aggregation Transformer layers; Step 2: Hidden state features Input to the Hyper-Prior Analysis Transformation Network Get super prior features , for the hyper-prior feature Quantization obtains quantized hyper-prior features , will quantize the hyper-prior features Lossless encoding into bit stream and then decoding, input into the super prior synthesis transformation network Get the upsampled hyper-prior feature ; Step 3: Transform the hidden state features The feature channel is divided into 4 channel hidden state feature blocks, namely: the first channel hidden state feature block , the second channel hidden state feature block , the third channel hidden state feature block , the fourth channel hidden state feature block ; Step 4: For the first channel hidden state feature block , the upsampled hyper-prior features Input to the channel entropy model to predict the first channel hidden state feature block The mean and variance , according to the predicted first channel hidden state feature block The mean and variance For the first channel hidden state feature block Quantize and losslessly encode into a bit stream, and decode the bit stream to obtain the first channel hidden state feature block decoded For the Channel hidden state feature block , , the upsampled hyper-prior features and the first one that has been decoded, , the k-1th channel hidden state feature block …, Input to the channel entropy model to predict Channel hidden state feature block The mean and variance , according to the predicted Channel hidden state feature block The mean and variance For Channel hidden state feature block Quantize and losslessly encode into a bit stream, and decode the bit stream to obtain the decoded Channel hidden state feature block ; Step 5: Decode the first, second, third, and fourth channel hidden state feature blocks Concatenate on the feature channel to get the decoded hidden state features , the decoded hidden state features Input is a nonlinear synthesis transformation network based on local features and non-local features Get the decoded image ; Nonlinear synthetic transformation network based on local features and non-local features Including transposed convolution layer, inverse division regularization layer, dual-aggregation Transformer layer; The dual-aggregation Transformer layer includes: a spatial aggregation Transformer layer and a channel aggregation Transformer layer; the spatial aggregation Transformer layer extracts and aggregates spatial non-local features and local features, and the channel aggregation Transformer layer extracts and aggregates channel non-local features and local features. The dual-aggregation Transformer layer is calculated as follows: , Among them, SAAB represents the spatial aggregation attention layer, CAAB represents the channel aggregation attention layer, and GDFN represents the gated feedforward layer; represents the input features of the dual-aggregation Transfromer layer, represents the output features of the spatial aggregation Transformer layer, represents the output features of the channel aggregation Transformer layer, represents the output of the spatial aggregation attention layer SAAB, represents the output of the channel aggregation attention layer CAAB, and LN represents the layer normalization operation; The implementation of the spatial aggregation attention layer SAAB is as follows: , in, represents the spatial attention layer, Representing the spatial attention layer The output of , i.e., the spatial non-local features, represents the depth-level convolution, Represents local features, represents the frequency domain interaction module, represents the learned spatially non-local feature weights, represents the learned local feature weights, represents the weight of the linear layer, Represents the output features of the spatial aggregation attention layer SAAB; The implementation of the channel aggregation attention layer CAAB is as follows: , in, represents the channel attention layer, Represents the channel attention layer The output of , that is, the channel non-local feature, represents the learned channel non-local feature weights, Represents the output features of the channel aggregation attention layer CAAB.

2. The image compression method based on local features and non-local features according to claim 1, characterized in that: The channel entropy model predicts the first Channel hidden state feature block Channel context , channel context After two The convolutional layer predicts Channel hidden state feature block The mean and variance , , , Among them, DTB represents the dual-polymer Transformer layer, Indicates the first The convolutional layer, when When the input feature is the up-sampled hyper-prior feature ; Indicates the second The convolutional layer, when When the input feature For the first one that has been decoded, , the k-1th channel hidden state feature block and upsampled hyper-prior features Features after cascading on feature channels; According to the predicted Channel hidden state feature block The mean and variance , use the ANS codec to Channel hidden state feature block Encoding and decoding.