An image compression method based on multi-reference entropy model
Through the image compression method based on the multi-reference entropy model, latent features are extracted and efficiently encoded, which solves the problems of slow image compression speed and low accuracy in the existing technology, and achieves more efficient data encoding and better reconstruction quality and decoding. Speed balance.
Patent Information
- Application Number
- CN202410853805.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing image compression methods are difficult to achieve a good balance between image reconstruction quality and decoding speed, resulting in slow compression speed and low accuracy.
Using an image compression method based on a multi-reference entropy model, latent features are extracted by analyzing the transformation network, a multi-reference entropy model is constructed to estimate the probability distribution, and arithmetic encoding and decoding are performed. The loss function is optimized with end-to-end network training to achieve more efficient Data encoding.
Significantly reduces the number of bits required, improves compression efficiency, achieves a better trade-off between reconstruction quality and encoding and decoding speed, improves PSNR values and reduces bit rates.
Smart Images

Figure CN118400531B
Abstract
Description
Technical Field
[0001] The invention discloses an image compression method based on a multi-reference entropy model, and belongs to the technical field of image processing. Background Art
[0002] Image compression, as a core research topic in the field of multimedia signal processing, has long received widespread attention. It aims to achieve efficient and compact representation of image data by reducing spatial, visual and statistical redundancy in images. Although traditional coding techniques such as JPEG, JPEG2000, BPG and VVC have achieved remarkable performance results, these methods mostly rely on manually designed modules that are independent of each other. This lack of joint optimization limits their ability to further explore the potential of image compression. Although current image compression methods have made technical breakthroughs, they still face challenges in balancing image reconstruction quality and decoding speed. Summary of the invention
[0003] The purpose of the present invention is to provide an image compression method based on a multi-reference entropy model to solve the problems of slow image compression speed and low precision in the prior art.
[0004] An image compression method based on a multi-reference entropy model, comprising:
[0005] S1 obtains the image to be compressed Send it to the analysis transformation network, Perform analysis transformation to extract potential features ;
[0006] S2 Send it to the super analysis transformation network to Perform hyper-analysis transformation to obtain hyper-prior z ,right z Perform arithmetic coding to obtain a super-a priori code stream;
[0007] S3 builds a multi-reference entropy model to estimate The probability distribution of Perform arithmetic coding to obtain a potential representation code stream;
[0008] S4 performs arithmetic decoding on the super-prior code stream to obtain the reconstructed super-prior z’ , and z’ Perform a super-a priori comprehensive transformation;
[0009] S5 decodes the potential representation code stream based on the multi-reference entropy model to obtain the reconstructed potential features ;
[0010] S6 pair Perform comprehensive transformation to obtain the reconstructed image , complete image compression;
[0011] S7 constructs image compression loss function based on rate-distortion optimization objective L , perform end-to-end network training optimization;
[0012] ;
[0013] In the formula, is the bit rate, is the Lagrange multiplier, It's distortion.
[0014] The analysis transformation network consists of three consecutive downsampling modules and feature extraction blocks;
[0015] In the downsampling module, the convolution block, RELU activation function, convolution block, and generalized split normalization layer are connected in sequence through residual connection to obtain the 2x downsampled ;
[0016] The feature extraction block includes a dual-path Swin-Transformer block and a convolution block. The feature extraction block based on Swin-Transformer extracts local and global features, and then fuses them to obtain feature fusion. ;
[0017] After three consecutive downsampling modules and feature extraction blocks, we get a 6-fold downsampled .
[0018] S2 includes,the super analysis transformation network including downsampling module,feature extraction block and convolution block,obtain z After that, z Quantization is performed to further reduce the amount of information, and a super-a priori bit stream is obtained through arithmetic coding based on factorization.
[0019] S3 includes,the multi-reference entropy model including a channel context module, an,inter-group global spatial context module, an intra-group spatial context module, and a,super-prior module;
[0020] Call the channel context module and Based on the uneven channel groups, the Hiera-Transformer feature extraction module is used to extract the channel context in the channel dimension;
[0021] Call the inter-group global spatial context module and use the Swin-Transformer global feature extraction block to extract the inter-group spatial global context in the spatial dimension;
[0022] The intra-group spatial context module is called, and the group is divided into two parts based on the checkerboard mechanism. The dual-path convolutional feature extraction block and the Hiera-Transformer feature extraction module are used to extract the local and global spatial context within the group in the spatial dimension.
[0023] S4 includes decoding the super-prior code stream using factorization-based arithmetic decoding; the super-prior comprehensive transformation uses a super-prior comprehensive transformation module, and the super-prior comprehensive transformation module includes an upsampling module, a Swin-Transformer feature extraction block and a convolution block.
[0024] S6 includes,the comprehensive transformation using the comprehensive transformation network, which,consists of three consecutive upsampling modules and a feature extraction block based,on the Swin-Transformer attention mechanism;
[0025] The upsampling module includes a convolution block, a RELU activation function, a convolution block, and a generalized split normalization layer to obtain a 2x upsampling ;
[0026] The feature extraction block based on the Swin-Transformer attention mechanism includes the Swin-Transformer block, the convolution block, and the RULU activation function;
[0027] After three consecutive upsampling modules and a feature extraction block based on the Swin-Transformer attention mechanism, a 6-fold upsampling result is obtained.
[0028] Compared with the prior art, the present invention has the following beneficial effects: the present invention helps to obtain potential features of lower bit rates, achieve more efficient data encoding, can significantly reduce the number of bits required, thereby improving compression efficiency, and achieving a better trade-off between reconstruction quality and encoding and decoding speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of the analysis transformation network structure;
[0030] Figure 2 It is a schematic diagram of the network structure of a single downsampling module and feature extraction block;
[0031] Figure 3 It is a schematic diagram of the entropy model structure. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention is described clearly and completely below. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] An image compression method based on a multi-reference entropy model, comprising:
[0034] S1 obtains the image to be compressed Send it to the analysis transformation network, Perform analysis transformation to extract potential features ;
[0035] S2 Send it to the super analysis transformation network to Perform hyper-analysis transformation to obtain hyper-prior z ,right z Perform arithmetic coding to obtain a super-a priori code stream;
[0036] S3 builds a multi-reference entropy model to estimate The probability distribution of Perform arithmetic coding to obtain a potential representation code stream;
[0037] S4 performs arithmetic decoding on the super-prior code stream to obtain the reconstructed super-prior z’ , and z’ Perform a super-a priori comprehensive transformation;
[0038] S5 decodes the potential representation code stream based on the multi-reference entropy model to obtain the reconstructed potential features ;
[0039] S6 pair Perform comprehensive transformation to obtain the reconstructed image , complete image compression;
[0040] S7 constructs image compression loss function based on rate-distortion optimization objective L , perform end-to-end network training optimization;
[0041] ;
[0042] In the formula, is the bit rate, is the Lagrange multiplier, It's distortion.
[0043] The analysis transformation network consists of three consecutive downsampling modules and feature extraction blocks;
[0044] In the downsampling module, the convolution block, RELU activation function, convolution block, and generalized split normalization layer are connected in sequence through residual connection to obtain the 2x downsampled ;
[0045] The feature extraction block includes a dual-path Swin-Transformer block and a convolution block. The feature extraction block based on Swin-Transformer extracts local and global features, and then fuses them to obtain feature fusion. ;
[0046] After three consecutive downsampling modules and feature extraction blocks, we get a 6-fold downsampled .
[0047] S2 includes,the super analysis transformation network including downsampling module,feature extraction block and convolution block,obtain z After that, z Quantization is performed to further reduce the amount of information, and a super-a priori bit stream is obtained through arithmetic coding based on factorization.
[0048] S3 includes,the multi-reference entropy model including a channel context module, an,inter-group global spatial context module, an intra-group spatial context module, and a,super-prior module;
[0049] Call the channel context module and Based on the uneven channel groups, the Hiera-Transformer feature extraction module is used to extract the channel context in the channel dimension;
[0050] Call the inter-group global spatial context module and use the Swin-Transformer global feature extraction block to extract the inter-group spatial global context in the spatial dimension;
[0051] The intra-group spatial context module is called, and the group is divided into two parts based on the checkerboard mechanism. The dual-path convolutional feature extraction block and the Hiera-Transformer feature extraction module are used to extract the local and global spatial context within the group in the spatial dimension.
[0052] S4 includes decoding the super-prior code stream using factorization-based arithmetic decoding; the super-prior comprehensive transformation uses a super-prior comprehensive transformation module, and the super-prior comprehensive transformation module includes an upsampling module, a Swin-Transformer feature extraction block and a convolution block.
[0053] S6 includes,the comprehensive transformation using the comprehensive transformation network, which,consists of three consecutive upsampling modules and a feature extraction block based,on the Swin-Transformer attention mechanism;
[0054] The upsampling module includes a convolution block, a RELU activation function, a convolution block, and a generalized split normalization layer to obtain a 2x upsampling ;
[0055] The feature extraction block based on the Swin-Transformer attention mechanism includes the Swin-Transformer block, the convolution block, and the RULU activation function;
[0056] After three consecutive upsampling modules and a feature extraction block based on the Swin-Transformer attention mechanism, a 6-fold upsampling result is obtained.
[0057] Coding is a key step in improving model performance. By using an entropy model to estimate the entropy of the potential representation, more efficient data encoding can be achieved. An accurate entropy model can significantly reduce the number of bits required, thereby improving compression efficiency.
[0058] The analysis transformation network structure of the present invention is as follows Figure 1 As shown in Figure 1, it includes three downsampling and feature extraction after inputting the image, and then outputting the potential features. The network structure of a single downsampling module and feature extraction block is shown in Figure 1. Figure 2 As shown in , after inputting the latent features, one path is sequentially subjected to convolution, activation function, convolution and normalization, and then fused with the other path of features, and then input into the convolution and Swin-Transformer blocks respectively. The entropy model structure is shown in Figure 3 As shown, the channel context module, the inter-group global spatial context module, the intra-group spatial context module and the hyper-prior module are used together for Gaussian estimation probability distribution to calculate the distribution of latent features.
[0059] In order to prove the feasibility and superiority of the present invention, relevant experiments were conducted, including Experiment 1 and Experiment 2.
[0060] Experiment 1 is a rate-distortion performance experiment. Different Lagrange multipliers are used to construct the image compression loss function L to train image compression models with different compression degrees. The Kodak dataset, which consists of 24 images with a resolution of 512×768 or 768×512, is selected as the test set for the rate-distortion performance experiment. PSNR is used to evaluate the method of the present invention and some recent image compression methods based on deep learning. PSNR is the peak signal-to-noise ratio, which is the most common and widely used objective image evaluation index. It is based on the error between corresponding pixels. The larger its value, the smaller the difference between the compressed and reconstructed image and the original image, and the more details are retained.
[0061] The experimental results of Experiment 1 are as follows:
[0062] The PSNR values obtained by the models with different compression degrees using the method of the present invention are {30.5213, 33.8631, 37.0875} dB. Compared with the existing methods, the method proposed by the present invention can improve the PSNR by 0.5-0.9 dB at most.
[0063] Furthermore, BD-Rate is used on the Kodak dataset to evaluate the compression performance of the compression model. BD-Rate is used to measure the compression ratio and evaluate the rate-distortion performance of different video encoders, where negative numbers represent bit rate savings and positive numbers represent bit rate increases. Setting the anchor to VTM-17.1 and BD-Rate=0%, the method proposed in the present invention reduces the BD-Rate by 13.15%. The prior art generally reduces the BD-rate by 5.95% to 10.14%. From the above data, it can be seen that the method proposed in the present invention is superior to other compared methods in terms of rate-distortion performance.
[0064] Experiment 2 is a complexity experiment, and the Kodak data set is selected as the test set for the complexity experiment. The experiment was conducted on the Kodak data set, and the complexity of the method proposed in the present invention was compared with that of other methods, and the total time for encoding and decoding was recorded respectively. VTM-17.1 takes the longest time of 402.27 seconds to encode, but once the encoding is completed, its decoding time is very fast, only about 0.6 seconds; Entroformer takes 18.78 seconds to encode and 0.95 seconds to decode; another prior art takes 5.52 seconds to encode and 13.68 seconds to decode. The method proposed in the present invention shows extraordinary encoding and decoding times, which are only 0.61 seconds and 0.88 seconds respectively, proving that the model complexity of the method proposed in the present invention is relatively low.
[0065] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features may be replaced by equivalents, and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An image compression method based on a multi-reference entropy model, characterized in that: include: S1 obtains the image to be compressed Send it to the analysis transformation network, Perform analysis transformation to extract potential features ; S2 Send it to the super analysis transformation network to Perform hyper-analysis transformation to obtain hyper-prior z ,right z Perform arithmetic coding to obtain a super-a priori code stream; S3 builds a multi-reference entropy model to estimate The probability distribution of Perform arithmetic coding to obtain a potential representation code stream; S4 performs arithmetic decoding on the super-prior code stream to obtain the reconstructed super-prior z’ , and z’ Performing a super-a priori comprehensive transformation; S5 decodes the potential representation code stream based on the multi-reference entropy model to obtain the reconstructed potential features ; S6 pair Perform comprehensive transformation to obtain the reconstructed image , complete image compression; S7 constructs image compression loss function based on rate-distortion optimization objective L , perform end-to-end network training optimization; ; In the formula, is the bit rate, is the Lagrange multiplier, It is distortion; The analysis transformation network consists of three consecutive downsampling modules and feature extraction blocks; In the downsampling module, the convolution block, RELU activation function, convolution block, and generalized split normalization layer are connected in sequence through residual connection to obtain the 2x downsampling ; The feature extraction block includes a dual-path Swin-Transformer block and a convolution block. The feature extraction block based on Swin-Transformer extracts local and global features, and then fuses them to obtain feature fusion. ; After three consecutive downsampling modules and feature extraction blocks, we get a 6-fold downsampled ; S2 includes,the super analysis transformation network including downsampling module,feature extraction block and convolution block,obtain z After that, z Quantization is performed to further reduce the amount of information, and a super-a priori code stream is obtained through arithmetic coding based on factorization; S3 includes,the multi-reference entropy model including a channel context module, an,inter-group global spatial context module, an intra-group spatial context module, and a,super-prior module; Call the channel context module and Based on the uneven channel groups, the Hiera-Transformer feature extraction module is used to extract the channel context in the channel dimension; Call the inter-group global spatial context module and use the Swin-Transformer global feature extraction block to extract the inter-group spatial global context in the spatial dimension; The intra-group spatial context module is called to divide the group into two parts based on the checkerboard mechanism. The dual-path convolutional feature extraction block and the Hiera-Transformer feature extraction module are used to extract the local and global spatial context of the group in the spatial dimension. S4 includes decoding the super-a priori code stream using arithmetic decoding based on factorization; the super-a priori comprehensive transformation uses a super-a priori comprehensive transformation module, and the super-a priori comprehensive transformation module includes an upsampling module, a Swin-Transformer feature extraction block and a convolution block; S6 includes,the comprehensive transformation using the comprehensive transformation network, which includes three,consecutive upsampling modules and a feature extraction block based on the,Swin-Transformer attention mechanism; The upsampling module includes a convolution block, a RELU activation function, a convolution block, and a generalized split normalization layer to obtain a 2x upsampling ; The feature extraction block based on the Swin-Transformer attention mechanism includes the Swin-Transformer block, the convolution block, and the RULU activation function; After three consecutive upsampling modules and a feature extraction block based on the Swin-Transformer attention mechanism, a 6-fold upsampling result is obtained.
Citation Information
Patent Citations
Region-of-interest compression method based on multi-layer hyper-prior network
CN114723836A
Image compression method and system for feature preprocessing based on feature stacking attention
CN116916035A
