Deep learning image compression method based on space-channel mixed attention
By combining Transformer and convolutional neural network in the deep learning image compression method, the space-channel hybrid attention module is designed, which solves the problem of receptive field limitation in the existing technology and significantly improves the image compression performance.
Patent Information
- Application Number
- CN202410682159.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-06
AI Technical Summary
Due to the limitation of the receptive field, existing deep learning image compression methods have insufficient modeling capabilities for large objects in images and poor compression performance.
A deep learning image compression method based on spatial-channel hybrid attention is used. By combining the Transformer model and the convolutional neural network, a window-based spatial attention module and a channel attention module are designed, and the residual block is combined to learn the local spatial information and Global channel information is used to build a hybrid attention module to improve the receptive field and image compression performance of the model.
It effectively improves the modeling capabilities of large objects in images and the rate-distortion performance of deep learning image compression models, significantly improving image compression performance.
Smart Images

Figure CN118612467A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a deep learning image compression method based on space-channel mixed attention. Background Art
[0002] The deep learning image compression method is to input the image data into a deep neural network, first use the encoder to encode it to generate a bit stream, and then use the decoder to restore the image.
[0003] Existing deep learning image compression methods are mainly based on Transformer modules or Convolutional Neural Networks (CNNs). The deep learning image compression methods based on Transformer modules have limited receptive field growth due to the limitation of shift window attention, which affects their ability to model large objects in images. The deep learning image compression methods based on Convolutional Neural Networks have poor image compression performance due to the small receptive field of the Convolutional Neural Network itself. It can be seen that there is room for improvement in the image compression performance of these two methods in the prior art. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the object of the present invention is to provide a deep learning image compression method based on spatial-channel mixed attention, aiming to solve the problem of poor image compression performance of the deep learning image compression method in the prior art.
[0005] In order to achieve the above object, the first aspect of the present invention provides a deep learning image compression method based on space-channel mixed attention, comprising:
[0006] Get the image to be processed;
[0007] Using multiple groups of alternately arranged hybrid attention modules and residual blocks in a preset feature encoder to perform spatial and channel optimization and dimensionality reduction processing on the image to be processed, to obtain a compressed high-dimensional feature map, and the hybrid attention module includes a window-based spatial attention module for learning local spatial information of the image to be processed and a window-based channel attention module for learning global channel information of the image to be processed;
[0008] Using a preset entropy model, sequentially performing arithmetic coding and arithmetic decoding on the compressed high-dimensional feature map to obtain a reconstructed high-dimensional feature map;
[0009] The reconstructed high-dimensional feature map is subjected to dimensionality increase and spatial and channel inverse optimization processing using multiple groups of alternating residual blocks and hybrid attention modules in a preset feature decoder to obtain a reconstructed image.
[0010] Optionally, after acquiring the image to be processed, the step further includes performing dimension conversion on the image to be processed to update the image to be processed, including:
[0011] Decomposing the image to be processed according to a preset frequency decomposition rule by using wavelet transform to obtain a plurality of sub-images with different frequencies, and superimposing all the sub-images along the channel dimension to obtain a superimposed image;
[0012] The stacked image is dimensionally transformed using the first residual block to update the image to be processed.
[0013] Optionally, the using of multiple groups of alternately arranged hybrid attention modules and residual blocks in a preset feature encoder to perform space and channel optimization and dimensionality reduction processing on the image to be processed to obtain a compressed high-dimensional feature map includes:
[0014] Each group of the hybrid attention module and residual block performs the following steps in sequence:
[0015] Using the window-based spatial attention module and the second residual block connected in parallel in the hybrid attention module to capture local spatial information in the image to be processed, and obtain a spatially optimized feature map;
[0016] The window-based channel attention module and the third residual block connected in parallel in the hybrid attention module are used to capture the global channel information and local spatial information in the spatial optimization feature map to obtain the channel optimization feature map.
[0017] The fourth residual block in the feature encoder is used to perform dimensionality reduction processing on the channel optimized feature map to obtain a compressed high-dimensional feature map.
[0018] Optionally, the using the window-based spatial attention module and the second residual block connected in parallel in the hybrid attention module to capture local spatial information in the image to be processed to obtain a spatially optimized feature map includes:
[0019] Using the window-based spatial attention module to learn the local spatial information based on the Transformer model in the image to be processed, to obtain a first spatial feature map;
[0020] Using the second residual block to learn the local spatial information based on the convolutional neural network in the image to be processed, to obtain a second spatial feature map;
[0021] A spatial optimization feature map is obtained based on the first spatial feature map, the second spatial feature map and the image to be processed.
[0022] Optionally, the using the window-based channel attention module and the third residual block connected in parallel in the hybrid attention module to capture the global channel information and local spatial information in the spatial optimization feature map to obtain the channel optimization feature map includes:
[0023] Using the window-based channel attention module to learn the global channel information based on the Transformer model in the spatial optimization feature map to obtain an initial channel feature map;
[0024] Using the third residual block to learn the local spatial information based on the convolutional neural network in the spatial optimization feature map, to obtain a third spatial feature map;
[0025] A channel optimization feature map is obtained based on the initial channel feature map, the third spatial feature map and the spatial optimization feature map.
[0026] Optionally, using the window-based channel attention module to learn the global channel information based on the Transformer model in the spatial optimization feature map to obtain an initial channel feature map includes:
[0027] Dividing the spatial optimization feature map into windows to obtain a plurality of spatial optimization sub-feature maps;
[0028] Using the space-channel dimension exchange module to transpose each of the space optimization sub-feature graphs, respectively, to obtain a channel optimization sub-feature graph corresponding to each of the space optimization sub-feature graphs;
[0029] All the channel optimized sub-feature maps are superimposed and the global channel information based on the Transformer model is learned to obtain an initial channel feature map.
[0030] Optionally, the using a preset entropy model to sequentially perform arithmetic coding and arithmetic decoding on the compressed high-dimensional feature map to obtain a reconstructed high-dimensional feature map includes:
[0031] Calculating the mean of the compressed high-dimensional feature map using the entropy model, and subtracting the mean from the compressed high-dimensional feature map to obtain a residual feature map;
[0032] Quantizing the residual feature map to obtain a quantized residual feature map;
[0033] Calculate the quantization error using a preset entropy model to obtain a compensation feature map;
[0034] The entropy model is used to calculate the probability of each character appearing in the quantized residual feature map, and arithmetic coding is performed based on the probability of each character appearing to obtain a transmittable bit stream, and the transmittable bit stream is arithmetically decoded to restore the quantized residual feature map;
[0035] The restored quantized residual feature map is added to the compensated feature map to obtain a reconstructed residual feature map, and the reconstructed residual feature map is added to the mean value of the compressed high-dimensional feature map to obtain a reconstructed high-dimensional feature map.
[0036] A second aspect of the present invention provides a deep learning image compression system based on space-channel mixed attention, the system comprising:
[0037] A data acquisition module, used for acquiring images to be processed;
[0038] A compression module, used to perform spatial and channel optimization and dimensionality reduction processing on the image to be processed by using multiple groups of alternately arranged hybrid attention modules and residual blocks in a preset feature encoder to obtain a compressed high-dimensional feature map, and the hybrid attention module includes a window-based spatial attention module for learning local spatial information of the image to be processed and a window-based channel attention module for learning global channel information of the image to be processed;
[0039] A coding and decoding module, used for performing arithmetic coding and arithmetic decoding on the compressed high-dimensional feature map using a preset entropy model to obtain a reconstructed high-dimensional feature map;
[0040] The decompression module is used to use multiple groups of alternately arranged residual blocks and hybrid attention modules in a preset feature decoder to perform dimensionality increase and spatial and channel inverse optimization processing on the reconstructed high-dimensional feature map to obtain a reconstructed image.
[0041] The third aspect of the present invention provides an intelligent terminal, which includes a memory, a processor, and a deep learning image compression program based on spatial-channel mixed attention stored in the memory and executable on the processor. When the deep learning image compression program based on spatial-channel mixed attention is executed by the processor, it implements any step of the above-mentioned deep learning image compression method based on spatial-channel mixed attention.
[0042] A fourth aspect of the present invention provides a computer-readable storage medium, on which is stored a deep learning image compression program based on spatial-channel mixed attention. When the deep learning image compression program based on spatial-channel mixed attention is executed by a processor, the steps of any one of the above-mentioned deep learning image compression methods based on spatial-channel mixed attention are implemented.
[0043] Compared with the prior art, the beneficial effects of this solution are as follows:
[0044] The present invention proposes a novel hybrid attention module constructed based on both a Transformer model and a convolutional neural network, improves the basic computing module of a feature codec, designs a window-based spatial attention module and a window-based channel attention module, utilizes the window-based spatial attention module and a residual block to learn the local spatial information of the image, and utilizes the window-based channel attention module to learn the global channel information, effectively avoiding the problem of limited receptive field growth of existing image compression models, can effectively improve the modeling capability of large objects in images, and is beneficial to improving the rate-distortion performance of deep learning-based image compression models. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0046] Figure 1 It is a flow chart of the deep learning image compression method based on space-channel mixed attention of the present invention;
[0047] Figure 2 It is a schematic diagram of the overall process of the deep learning image compression method based on space-channel mixed attention of the present invention;
[0048] Figure 3 It is a schematic diagram of wavelet transform downsampling and residual block feature mapping of the present invention;
[0049] Figure 4 Schematic diagram of the processing flow of the hybrid attention module of the present invention;
[0050] Figure 5 Schematic diagram of the processing flow of the channel attention module of the present invention;
[0051] Figure 6 Schematic diagram for comparing spatial attention mechanism and channel attention mechanism;
[0052] Figure 7 Schematic diagram of the spatial attention module processing flow of the present invention;
[0053] Figure 8 A schematic diagram of the visualization effect of the two-dimensional discrete Haar wavelet transform of the present invention;
[0054] Fig. 9 A schematic diagram of the visualization effect of the effective receptive field under different modules in the deep learning image compression framework based on spatial-channel hybrid attention of the present invention;
[0055] Fig.10 A comparison diagram of the effects of image compression and reconstruction by the method of the present invention and the image compression method in the prior art;
[0056] Fig.11 It is a schematic diagram of the module of the deep learning image compression system based on space-channel mixed attention of the present invention;
[0057] Fig.12 It is a schematic diagram of the structure of the intelligent terminal of the present invention. DETAILED DESCRIPTION
[0058] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0059] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0060] It should also be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0061] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0062] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, 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.
[0063] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0064] The existing deep learning image compression algorithm based on convolutional neural network has good local modeling ability, but is limited by the size of convolution kernel. Its limited receptive field leads to its lack of learning ability for global correlation in the image. The deep learning image compression algorithm based on Swin Transformer has good local modeling ability. The attention calculation mechanism gives it a larger receptive field than convolutional neural network. However, the shift window attention mechanism limits the growth of the receptive field of Swin Transformer, which also affects its modeling ability for large objects in the image. Therefore, the existing deep learning image compression method has poor image compression performance. Based on this, the present invention proposes a new deep learning image compression method based on spatial-channel mixed attention. Since the single channel attention will hinder the learning of local spatial information, the present invention combines it with the residual block and the spatial attention module to construct a deep learning image compression framework based on spatial-channel mixed attention to simultaneously learn the local spatial information and global channel information in the image, which can significantly improve the image compression performance of the model.
[0065] The main implementation process of the method is as follows: at the input end of the model, the original image is input, the feature encoder converts it into a feature vector, quantizes the feature vector, and uses the entropy model to estimate the probability of occurrence of each character in the feature vector, thereby entropy encoding it into a compressed bit stream. At the output end of the model, the compressed bit stream is entropy decoded according to the character probability to compensate for the quantization error, and the feature decoder converts the feature vector into a reconstructed image. The present invention improves the basic calculation module of the feature codec, designs a window-based spatial attention module and a window-based channel attention module, uses the window-based spatial attention module and the residual block to learn the local spatial information of the image, uses the window-based channel attention module to learn the global channel information, and incorporates the two-dimensional wavelet transform into the image compression framework constructed by this method, which can effectively improve the rate-distortion performance of the deep learning image compression model.
[0066] The embodiment of the present invention provides a deep learning image compression method based on spatial-channel hybrid attention, which is deployed on electronic devices such as computers and servers, and the application scenario is image compression. Specifically, Figure 1 As shown, the steps of the method in this embodiment include:
[0067] Step S100: obtaining an image to be processed;
[0068] Specifically, this embodiment uses a three-channel RGB original image as the image to be processed. The source of the original image is not restricted. It is preferred that an image containing a large object be used as the original image so that the model can learn information with a larger receptive field and improve the model's compression capability for large objects.
[0069] Step S200: using a plurality of groups of alternately arranged hybrid attention modules and residual blocks in a preset feature encoder to perform spatial and channel optimization and dimensionality reduction processing on the image to be processed, to obtain a compressed high-dimensional feature map, and the hybrid attention module includes a window-based spatial attention module for learning local spatial information of the image to be processed and a window-based channel attention module for learning global channel information of the image to be processed;
[0070] Specifically, the pre-built feature encoder includes multiple groups of alternating hybrid attention modules (i.e., spatial-channel hybrid modules) and residual blocks, and each group includes a hybrid attention module and a residual block. The hybrid attention module is used to learn the spatial information or channel information in the image features using the Transformer model, specifically using the window-based spatial attention module to learn the local spatial information of the image to be processed, and using the window-based channel attention module to learn the global channel information of the image to be processed, so that the feature encoder can better capture and understand the complex patterns and structures in the image to more effectively represent the features of the image. The residual block is used to learn the local spatial features based on the convolutional neural network, which can be achieved by stacking convolutional layers with a step size greater than 1. At the same time, the introduction of residual connections helps to solve the gradient disappearance problem of deep networks. The final image is converted into a set of compressed feature maps with optimized spatial dimensions and channel dimensions. It can be seen that the feature encoder can extract compressed and information-rich feature representations from the original RGB image, providing strong support for subsequent encoding and decoding.
[0071] Step S300: using a preset entropy model to sequentially perform arithmetic coding and arithmetic decoding on the compressed high-dimensional feature map to obtain a reconstructed high-dimensional feature map;
[0072] The inter-channel autoregressive entropy model splits the probability estimation of the entropy model into multiple steps between channels, that is, using the already encoded (or decoded) channel group to predict the probability distribution of the current channel group, so as to achieve more efficient probability estimation. Based on the principle of entropy, high-frequency features are represented by shorter codes, and low-frequency features are represented by longer codes, so as to achieve effective data compression, that is, using entropy coding technology (such as arithmetic coding or Huffman coding, etc.) to first arithmetically encode the compressed high-dimensional feature map through the inter-channel autoregressive entropy model into a bit stream, and then arithmetically decode the bit stream to obtain the reconstructed high-dimensional feature map, so as to achieve compression encoding and decoding of the compressed high-dimensional feature map, thereby improving image compression efficiency.
[0073] Step S400: Utilize multiple groups of alternating residual blocks and hybrid attention modules in a preset feature decoder to perform dimensionality increase and spatial and channel inverse optimization processing on the optimized high-dimensional feature map to obtain a reconstructed image.
[0074] Specifically, the structures of the pre-built feature decoder and feature encoder are symmetrically arranged to perform decompression according to the reverse process of the image compression process of the feature encoder, thereby ensuring the consistency of reconstructing the compressed high-dimensional feature map back to the original image.
[0075] In this embodiment, a deep learning image compression framework based on spatial-channel hybrid attention is constructed by a feature encoder, an inter-channel autoregressive entropy model and a feature decoder, wherein the hybrid attention module in the feature encoder and the feature decoder is a new hybrid attention module constructed based on both the Transformer model and the convolutional neural network. The spatial features and channel features of the image can be learned simultaneously through the hybrid attention module, which effectively avoids the problem of limited growth of the receptive field of the existing image compression model and can effectively improve the modeling ability of large objects in the image. At the same time, since a single channel attention module will hinder the learning of local spatial information, this embodiment combines it with the residual block (Residual Block) and the spatial attention module to form a hybrid attention module, which can simultaneously learn the local spatial information and global channel information in the image, thereby significantly improving the image compression performance of the model.
[0076] In one embodiment, after obtaining the image to be processed in step S100, step S500 is further included: performing dimension conversion on the image to be processed to update the image to be processed, including:
[0077] Step S510: using wavelet transform to decompose the image to be processed according to a preset frequency decomposition rule to obtain a plurality of sub-images with different frequencies; and superimposing all the sub-images along the channel dimension to obtain a superimposed image;
[0078] Step S520: Dimensionally transform the superimposed image using the first residual block to update the image to be processed.
[0079] Specifically, Figure 2 As shown, in this embodiment, a wavelet downsampling module and a first residual block are symmetrically arranged in a feature decoder and a feature encoder. The wavelet downsampling module uses Haar wavelet to perform lossless transformation on the image, and decomposes the image into four sub-graphs of different frequencies, namely, LL (low frequency-low frequency) graph for representing low frequency information of the image, HL (high frequency-low frequency) graph for representing horizontal high frequency information of the image, LH (low frequency-high frequency) graph for representing vertical high frequency information of the image, and HH (high frequency-high frequency) graph for representing diagonal high frequency information of the image. After the image is transformed and stacked along the channel dimension, the spatial dimension (i.e., the width and height of the image) becomes one quarter of the original, and the channel dimension (color or feature channel number) becomes four times the original. Through such a transformation, the different frequency components of the image are effectively separated, and the transformed sub-graphs are rearranged in the channel dimension so that the subsequent processing can make full use of the correlation between different frequency components and improve the effectiveness of feature extraction. This embodiment implements downsampling of different frequencies through a wavelet transform module, which can increase the effective receptive field based on the deep learning image compression model, thereby enhancing the extraction of global image information, and effectively improving the rate-distortion performance based on the deep learning image compression model. Moreover, since the wavelet transform does not contain parameters that need to be learned during the frequency division downsampling process, while the conventional residual block for frequency division downsampling requires learning parameters, the wavelet transform is more efficient than the conventional residual block for downsampling. The first residual block is then used to map the features from the RGB dimension to the set feature dimension.
[0080] For example, Figure 2 The feature encoder g in a Partial and Figure 3 In the image preliminary processing flow shown in the figure, the input x is a three-channel RGB original image of H×W×3, and the feature encoder g a To extract and compress feature information. In the feature encoder, the wavelet transform module first uses Haar wavelet for lossless wavelet transform, decomposing the image into sub-images with frequency components of LL, HL, LH and HH and stacking them along the channel dimension. The spatial dimension is one quarter of the original, and the channel dimension is four times the original. The total amount of features after transformation remains unchanged. Rearrangement along the channel dimension can achieve efficient downsampling at different frequencies. Then enter the first residual block to map the features from the RGB dimension to the feature dimension N (such as N = 256), so that the total number of features becomes For the subsequent residual downsampling module, downsampling is performed while keeping the channel dimension size unchanged, and finally a convolutional layer is used to increase the feature channel dimension to M (such as M = 320).
[0081] like Figure 4 As shown, in one embodiment, the step S200 uses multiple groups of alternately arranged hybrid attention modules and residual blocks in a preset feature encoder to perform spatial and channel optimization and dimensionality reduction processing on the processed image to obtain a compressed high-dimensional feature map, including:
[0082] Each set of hybrid attention modules and residual blocks performs the following steps in sequence:
[0083] Step S210: using the window-based spatial attention module and the second residual block connected in parallel in the hybrid attention module to capture local spatial information in the image to be processed, and obtain a spatially optimized feature map;
[0084] Step S220: Use the window-based channel attention module and the third residual block connected in parallel in the hybrid attention module to capture the global channel information and local spatial information in the spatial optimization feature map to obtain the channel optimization feature map.
[0085] Step S230: using the fourth residual block in the feature encoder to perform dimensionality reduction processing on the channel optimized feature map to obtain a compressed high-dimensional feature map.
[0086] Specifically, Figure 4 The hybrid attention module shown in the figure includes a window-based spatial attention module and a window-based channel attention module, thereby dividing the feature extraction of the initial feature map corresponding to the processed image into two stages. In the first stage, the input vector x0 (with dimensions C×H×W) is first preprocessed by 1×1 convolution and then split into two vectors x in the spatial dimension. attn and x conv , and the dimensions of both vectors are In this way, the extraction of the initial feature map is converted into a parallel computing design, thereby reducing the number of channels in each branch, which is beneficial to saving the amount of calculation for each branch, and different feature information can be obtained through different branches. attn Convert to x' attn , in order to learn the local spatial information based on Transformer; through the second residual block connected in parallel with the window-based spatial attention module, x conv Convert to x' conv, in order to learn local spatial information based on convolutional neural networks. Finally, the feature vectors of the two branches are merged in the spatial dimension, and the information is integrated through a 1×1 convolution layer to obtain a spatially optimized feature map. Here, by introducing residual connections at the input and output ends of the first stage, the input vector x0 and the sum of the extracted spatial features x1 are used as the output of the first stage, thereby strengthening the initial feature map in the spatial dimension. At the same time, the introduction of residual connections is conducive to the gradient return during network training. In the second stage, the window-based spatial attention module is replaced by a window-based channel attention module to extract global channel information. The input vector x1 (dimension C×H×W) is first preprocessed by a 1×1 convolution and then split into two vectors x in the channel dimension. attn and x conv , to extract global channel information, and then merge the feature vectors of the two branches in the channel dimension after being processed by the window-based channel attention module and the third residual block connected in parallel with the window channel attention module, and integrate the information through the convolution layer. Similarly, residual connections are introduced at the input and output ends of the second stage to obtain channel optimized feature maps. The detailed processing process is similar to that of the first stage and will not be repeated here. It is worth noting that Figure 4 All convolutional layers in are used to integrate information between different channels while keeping the channel dimension unchanged.
[0087] like Figure 2 As shown in , in order to obtain the ideal spatial optimized feature map and channel optimized feature map, multiple sets of hybrid attention modules and the fourth residual block are usually arranged alternately in the feature encoder, that is, Figure 1 The various residual downsampling modules shown in , since these residual downsampling modules are all used to convert dimensions, the only difference is the size of the dimensions, which are collectively referred to as the fourth residual block here, so as to gradually perform information learning and dimensionality reduction processing on the processed image, so that the validity of the extracted spatial information and channel information can be guaranteed to a greater extent, so that the compressed high-dimensional feature map obtained is as faithful as possible. It should be stated that for the multiple groups of alternating residual blocks and hybrid attention modules in the preset feature decoder in step 400, the residual block here also refers to the fourth residual block, which is the same in structure as the fourth residual block in the feature encoder in step 230, but the function is changed from downsampling to upsampling, so as to perform dimensionality increase processing on the optimized high-dimensional feature map, and perform spatial and channel reverse optimization processing on the optimized high-dimensional feature map through the hybrid attention module, so as to obtain the process of reconstructing the image.
[0088] This embodiment captures the local spatial correlation in the image through the spatial attention module and the residual block, and captures the global channel correlation through the channel attention module and the residual block, so as to realize the extraction of spatial information and channel information of the image by the hybrid attention module, which is conducive to retaining the significant features of the image, thereby improving the quality of the compressed image. At the same time, multiple groups of alternating hybrid attention modules and residual blocks are set in the feature encoder to repeatedly perform the "spatial optimization-channel optimization-dimensionality reduction" operation steps to progressively optimize the feature map, so that the compressed high-dimensional feature map obtained in the end can extract sufficient feature information.
[0089] Figure 6 Shown Figure 5 and Figure 7 The principle visualization diagram of attention calculation shown in , assuming that the window size of the image is set to 2×2 and the number of channels is set to 5. First, the input is projected into three vectors: query vector q, key vector k, value vector v, and the dimensions of these three vectors are n×hw×C. Figure 6 Schematic diagram of the spatial attention mechanism shown in (a) in the figure. Within a window, the query vector q and the key vector k (such as the vertical bars of different colors in the spatial attention module) are used to calculate the spatial attention matrix A. s =q×k T The dimension transformation process can be described as (hw×C)·(C×hw)=hw×hw (ignoring the number of sub-windows n). Different channels share the local space matrix, and then multiply it by the value vector v to obtain the spatial attention calculation result r1=A s ×v, the dimensional transformation process can be described as (hw×hw)·(hw×C)=hw×C, thereby realizing the integration of local spatial information. Figure 6 Schematic diagram of the channel attention mechanism shown in (b). Within a window, the channel sub-vectors (such as the bars of different colors in the channel attention module) provide a variety of global views of image features, and the query vector q and the key vector k are used to calculate the channel attention matrix A. c =q×k T , the dimension transformation process can be described as (C×hw)·(hw×C)=C×C, each element in the window shares the global matrix, and then multiplies it by the value vector v to obtain the channel attention calculation result r2=A c ×v, the dimension is transformed into (C×C)·(C×hw)=C×hw, thereby realizing the integration of global channel information between different windows.
[0090] The present invention uses an attention calculation mechanism based on the Transformer model to implement spatial attention and channel attention mechanisms, and can eventually calculate a spatial attention matrix of size HW×HW and a channel attention matrix of size C×C. The amount of information contained is significantly greater than the amount of information obtained by using the pooling method to obtain spatial attention and channel attention information. Therefore, it is possible to learn global and local information to the greatest extent, which is beneficial to ensuring the quality of subsequently reconstructed images.
[0091] In one embodiment, the hybrid attention module in step S210 is connected in parallel as follows Figure 7 The window-based spatial attention module and the second residual block shown capture the local spatial information in the image to be processed and obtain a spatially optimized feature map, including:
[0092] Step S211: using a window-based spatial attention module to learn local spatial information based on a Transformer model in the image to be processed, to obtain a first spatial feature map;
[0093] Step S212: using the second residual block to learn local spatial information based on a convolutional neural network in the image to be processed, to obtain a second spatial feature map;
[0094] Step S213: obtaining a spatial optimization feature map based on the first spatial feature map, the second spatial feature map and the image to be processed.
[0095] Specifically, for Figure 7 In the spatial attention module shown, the convolutional position encoding process is used to encode the relative position information of each element in the feature; the layer normalization process is used to speed up the network convergence speed; the window-based spatial attention mechanism is mainly implemented through window division, spatial attention module and window merging, wherein window division is used to divide the input vector x1 of dimension H×W×C into n sub-windows of dimension hw×C, the spatial attention module is used to learn the spatial information based on the Transformer model in each sub-window, and the window merging is used to merge the windows from which the spatial information has been extracted; the channel multi-layer perceptron MLP (Multilayer Perceptron) module is used to integrate the attention calculation results between different channels in the re-merged window to obtain the first spatial feature map.
[0096] Then, the second residual block connected in parallel with the spatial attention module learns the local spatial information based on the convolutional neural network to obtain the second spatial feature map. Finally, by introducing residual connections, the first spatial feature map, the second spatial feature map and the initial feature map corresponding to the image to be processed are superimposed to obtain the spatial optimized feature map. The introduction of residual connections is conducive to gradient backpropagation, thereby accelerating the network convergence speed.
[0097] like Figure 5 As shown, in one embodiment, the window-based channel attention module and the third residual block connected in parallel in the hybrid attention module are used in step S220 to capture the global channel information and local spatial information in the spatial optimization feature map to obtain the channel optimization feature map, including:
[0098] Step S221: using a window-based channel attention module to learn channel information based on the Transformer model in the feature map to obtain an initial channel feature map;
[0099] Step S222: using the third residual block to learn the local spatial information based on the convolutional neural network in the spatial optimization feature map to obtain a third spatial feature map;
[0100] Step S223: Obtain a channel optimization feature map based on the initial channel feature map, the third spatial feature map and the spatial optimization feature map.
[0101] Specifically, after the input vector x1 of dimension H×W×C is divided into n sub-windows of dimension hw×C by window partitioning, the spatial dimension and channel dimension of the feature vector n×hw×C are exchanged to n×C×hw by the spatial-channel dimension exchange module, and the updated feature map is input into the window-based channel attention module. The processing process is similar to that of the window-based spatial attention module, except that the spatial attention module is replaced by the channel attention module, the channel information based on the Transformer model in the spatial optimization feature map is learned, and the window is merged after the channel information is extracted. Then, the local spatial information based on the convolutional neural network is learned by the third residual block connected in parallel with the channel attention module to obtain the third spatial feature map. Finally, by introducing the residual connection, the initial channel feature map, the third spatial feature map and the spatial optimization feature map are superimposed to obtain the channel optimization feature map. The optimized feature map includes the information of the initial feature map corresponding to the image to be processed, as well as the spatial information and channel information extracted from the initial feature map, so as to realize the extraction of the salient features of the initial feature map, which is conducive to improving the quality of image compression of the initial feature map.
[0102] In one embodiment, the step S221 of using the window-based channel attention module to learn the global channel information based on the Transformer model in the spatial optimization feature map to obtain the initial channel feature map includes:
[0103] Step S2211: dividing the spatial optimization feature map into windows to obtain a plurality of spatial optimization sub-feature maps;
[0104] Step S2212: using the space-channel dimension exchange module to transpose each space optimization sub-feature map respectively, to obtain the channel optimization sub-feature map corresponding to each space optimization sub-feature map;
[0105] Step S2213: Superimpose all channel optimized sub-feature maps and learn the global channel information based on the Transformer model to obtain the initial channel feature map.
[0106] Specifically, for an input vector x1 of dimension H×W×C, i.e., a spatially optimized feature map, where H is the height of x1 and W is the width of x1, its dimension is adjusted to n×hw×C through the window division module, where n is the number of sub-windows divided, and hw is the height and width of a single sub-window after the window division. Then, the dimension of the spatially optimized sub-feature map obtained after the division is hw×C. Then, each spatially optimized sub-feature map is transposed through the spatial-channel dimension exchange module to obtain a channel-optimized sub-feature map C×hw corresponding to each spatially optimized sub-feature map, and all channel-optimized sub-feature maps are superimposed to realize the conversion of spatial dimension and channel dimension, thereby providing strong support for realizing the combination of spatial channel attention mechanism and channel attention mechanism. Then, based on the channel-optimized feature map obtained after superposition, the global channel information based on the Transformer model is learned to obtain the initial channel feature map.
[0107] like Figure 2 As shown, in one implementation, the step S300 sequentially performs arithmetic coding and arithmetic decoding on the compressed high-dimensional feature map using a preset entropy model to obtain a reconstructed high-dimensional feature map, including:
[0108] Step S310: using the entropy model to calculate the mean of the compressed high-dimensional feature map, subtracting the mean from the compressed high-dimensional feature map to obtain a residual feature map;
[0109] Step S320: quantizing the remaining feature map to obtain a quantized remaining feature map;
[0110] Step S330: Calculate the quantization error using a preset entropy model to obtain a compensation feature map;
[0111] Step S340: using the entropy model to calculate the probability of each character appearing in the quantized residual feature map, and performing arithmetic coding based on the probability of each character appearing to obtain a transmittable bit stream, and performing arithmetic decoding on the transmittable bit stream to restore the quantized residual feature map;
[0112] Step S350: Add the quantized residual feature map and the compensated feature map to obtain a reconstructed residual feature map, and add the reconstructed residual feature map and the mean of the compressed high-dimensional feature map to obtain a reconstructed high-dimensional feature map.
[0113] Specifically, Figure 2 The entropy coding process shown in the figure, the entropy model calculates the mean of the compressed high-dimensional feature map y On the one hand, the mean Input channel-to-channel autoregressive entropy model to learn the probability of each character in feature vector y. On the one hand, the compressed high-dimensional feature map y is subtracted from the mean. Get the remaining feature map y r , quantize and obtain the quantized residual feature map y q , entropy encoding is performed using the character probability φ estimated by the inter-channel autoregressive entropy model to obtain the encoded bit stream. Then, entropy decoding is performed using the character probability φ estimated by the inter-channel autoregressive entropy model at the decoding end to restore the quantized residual feature map y q Finally, the compensation value r for the quantization error output by the entropy model is combined with the quantized residual feature map y q Add together to obtain the reconstructed residual feature map The remaining feature maps after reconstruction With the mean Add together to obtain the reconstructed feature map Since the compensation estimation cannot be completely accurate, the reconstructed feature map There are slight differences from the compressed high-dimensional feature map y.
[0114] In the inter-channel autoregressive entropy model, the feature vector y is used to calculate the super prior feature vector z as side information. The probability of each element in the feature vector y is modeled as an independent Gaussian distribution, where the mean and standard deviation are calculated from the super prior feature vector z. Therefore, the probability of the i-th element in the feature vector y is Since the probability distribution of the feature vector is decomposed into independent distributions of spatial dimensions, spatial redundancy in probability estimation is eliminated. In the design of the inter-channel autoregressive entropy model, the feature vector y is divided into s slices {y0,y1,…,y s-1}, the model uses the quantized hyper-prior feature vector and the encoded channel slice y <i ={y0,y1,…,y i-1} to jointly encode the current channel slice y i , achieving decoupling between channels during encoding.
[0115] The overall processing flow of the inter-channel autoregressive entropy model is as follows:
[0116] z=h a (y; φ h ), (1)
[0117]
[0118] Among them, φ h is the super prior encoder h a , Q(·) is the quantization operation, θ h is the super prior decoder h s , μ and σ are the mean and standard deviation of the probability estimates, is the inter-channel autoregressive encoder e of the i-th slice i Parameters.
[0119] At the decoding end, the process of the inter-channel autoregressive entropy model is consistent with that of the encoding end, that is, the feature decoder g s is the feature encoder g a The inverse operation process is as follows: Figure 2 As shown in the figure, the only difference is that the downsampling module is replaced by an upsampling module, while the space-channel mixing module remains unchanged. The final feature vector will be upsampled to the original image size by wavelet to reconstruct the image Figure 2 The overall processing flow is as follows:
[0120] y=g a (x; φ), (2)
[0121]
[0122] y q =Q(y r )
[0123]
[0124] Where φ is the feature encoder g a Parameters, is the mean of the eigenvector y estimated by the entropy model, y r is the residual of the eigenvector minus the mean, Q(·) is the quantization operation, and y r Quantized to y q It is then used for arithmetic encoding into a bit stream and arithmetic decoding back to y q , r is the compensation estimate of the entropy model for the error caused by the quantization operation, θ is the feature decoder g s Parameters.
[0125] Since the bit rate needs to be considered during deep learning image compression and reconstruction error Therefore, the present invention converts the loss function of the entire deep learning image compression network in the training phase into Defined as:
[0126]
[0127] in, In order to obtain the hyper-prior eigenvector The high-dimensional feature vector compressed under the condition of information The estimated bit rate, yes The estimated bit rate, is the image reconstruction error. Bit rate loss and reconstruction error loss The weight between is adjusted by the Lagrange multiplier λ, where the bit rate is calculated by the entropy model and the reconstruction error is measured by the root mean square error. For different Lagrange multipliers λ, different deep learning image compression networks can be trained to compress images at different bit rates.
[0128] The effectiveness of the method of the present invention is verified by experiments as follows: Figure 8 The original image I (i.e. Figure 8 (a) in the figure shows the visualization effect of the two-dimensional discrete Haar wavelet transform. The four filters used in the two-dimensional Haar wavelet transform are as follows:
[0129]
[0130] Among them, f LL It is used to implement the summing and pooling operations, and the generated downsampled low-frequency information graph is as follows Figure 8 As shown in (b); using f HL 、f LH and f HH They are used to implement high-frequency filtering operations and generate downsampled high-frequency information, where I LH and I HL What is obtained is the vertical high-frequency information and horizontal high-frequency information of the original image, that is, the edge features in two directions in the image, as shown in Figure 8 As shown in (c) and (d) in the figure, I HH What is obtained is a diagonal information map, such as Figure 8 As shown in (e) in . It can be seen that the image can be decomposed into sub-images of different frequencies through wavelet transform, which can guide the network model to learn the correlation of different frequencies and learn more complex image textures.
[0131] like Fig. 9 The figure shows the above-mentioned deep learning image compression framework based on spatial-channel hybrid attention, comparing the effective receptive fields of different modules. Specifically, by selecting a point in the feature map for gradient backpropagation, the gradient of this point with respect to all points in the feature map is calculated and normalized. Fig. 9 By comparing the effective receptive fields of different modules shown in Figure 2, we can see that the channel attention module under the action of wavelet transform has the largest effective receptive field (e.g. Fig. 9 The receptive field reasonably covers the nose and propeller of the aircraft, indicating that the channel attention successfully obtains the global information of the large object aircraft in the image. The effective receptive field of the residual block and the spatial attention module (respectively Fig. 9 (b) and (c) in Figure 1 are obviously smaller, indicating that the residual block and the spatial attention module are subject to the local spatial information learning mechanism. In addition, compared with the channel attention module under the action of wavelet transform, the receptive field of the channel attention module after removing the wavelet transform (as shown in Figure 1) is smaller than that of the channel attention module under the action of wavelet transform. Fig. 9 (d) in the figure) is smaller, indicating that wavelet transform helps to increase the effective receptive field of the channel attention module.
[0132] This experiment uses four standard test sets including the Kodak test set, the Tecnick test set, the 2020 Deep Learning Image Compression Challenge Validation Set (CLIC Pro Val) and the 2021 Deep Learning Image Compression Challenge Test Set (CLIC'21Val). The main parameter settings are: The deep learning image compression model proposed in this method is implemented through the CompressAI library. Based on Figure 2 The model structure shown in the figure sets N to 256, M to 320, and the number of channels of the super prior feature vector z to 192. Feature encoder g a and feature decoder g s Stack {2,4,2} layers respectively. Figure 4 In the spatial-channel hybrid module shown, the window size is set to 8×8. The training parameters include: using the largest 300,000 images in the ImageNet training set, randomly cropped to a size of 256*256 for training. Using the Adam optimizer with a batch size of 8. The learning rate is initialized to 1×10 -4 , which is adjusted by the ReduceLROnPlateau learning rate regulator in the PyTorch machine learning library with a coefficient of 0.3. The model is defined by the loss function above. The optimization was performed, and the Lagrange multipliers were set to {0.0025, 0.0035, 0.0067, 0.016, 0.025, 0.05}. The model was trained for an average of 3.5 trillion iterations. Test environment: Ubuntu 20.04 system was used for testing, the CPU was AMD EPYC 7763, and the computing card was NVIDIA A100 (80GB).
[0133] Table 1 shows the rate-distortion ratio (Bjontegaard-delta-rate, BD-Rate) of different methods / data sets on four standard test sets, in %. The smaller the value, the better the rate-distortion performance of the model, and vice versa. The performance benchmark uses the general test model VTM-23.1 of the universal video coding (VVC). "-" in Table 1 means that the model has not been tested on the corresponding standard test set. It can be seen from Table 1 that compared with other existing methods, the image compression method proposed in the present invention performs well in the rate-distortion ratio on the four standard test sets.
[0134] Table 1:
[0135]
[0136] Table 2:
[0137]
[0138] It can be seen from Table 2 that the rate-distortion ratio of the image compression method proposed by the present invention is the smallest, which is significantly better than the existing methods. Fig.10 The tower top image shown in (a) is reconstructed and visualized, and the effects of compressing and reconstructing the target image by the image compression method proposed by the present invention and the existing method are compared. Fig.10 (a) in the figure is the original image. Fig.10 (b) is the image reconstructed by the method proposed in the present invention. Fig.10 (c) in the figure is the image reconstructed using the symmetric Transformer model. Fig.10 (d) in the figure is the image reconstructed by the general video coding (23.1) method. Fig.10 From the comparison of the reconstruction effects shown in (b)-(d) in FIG. 1 , it can be seen that the image reconstructed by the method proposed in the present invention ( Fig.10 (b)) in the figure has the clearest texture details and is the only method that successfully reconstructs the lightning rod on the top of the tower, which effectively verifies that the attention calculation mechanism that combines local spatial learning with global channel learning in the present invention helps the model distinguish complex foreground and background.
[0139] like Fig.11 As shown, corresponding to the above-mentioned deep learning image compression method based on space-channel mixed attention, an embodiment of the present invention further provides a deep learning image compression system based on space-channel mixed attention, and the above-mentioned deep learning image compression system based on space-channel mixed attention includes:
[0140] A data acquisition module 111 is used to acquire an image to be processed;
[0141] A compression module 112 is used to perform spatial and channel optimization and dimensionality reduction processing on the image to be processed by using multiple groups of alternately arranged hybrid attention modules and residual blocks in a preset feature encoder to obtain a compressed high-dimensional feature map, and the hybrid attention module includes a window-based spatial attention module for learning local spatial information of the image to be processed and a window-based channel attention module for learning global channel information of the image to be processed;
[0142] The encoding and decoding module 113 is used to perform arithmetic encoding and arithmetic decoding on the compressed high-dimensional feature map in sequence using a preset entropy model to obtain a reconstructed high-dimensional feature map;
[0143] The decompression module 114 is used to use multiple groups of alternating residual blocks and hybrid attention modules in a preset feature decoder to perform dimensionality increase and spatial and channel inverse optimization processing on the reconstructed high-dimensional feature map to obtain a reconstructed image.
[0144] Specifically, in this embodiment, the specific functions of the above-mentioned deep learning image compression system based on spatial-channel mixed attention can also refer to the corresponding description in the above-mentioned deep learning image compression method based on spatial-channel mixed attention, and will not be repeated here.
[0145] Based on the above embodiments, the present invention further provides an intelligent terminal, whose principle block diagram can be shown as follows: Fig.12 As shown. The above-mentioned intelligent terminal includes a processor, a memory, a network interface and a display screen connected through a system bus. Among them, the processor of the intelligent terminal is used to provide computing and control capabilities. The memory of the intelligent terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a deep learning image compression program based on space-channel mixed attention. The internal memory provides an environment for the operation of the operating system and the deep learning image compression program based on space-channel mixed attention in the non-volatile storage medium. The network interface of the intelligent terminal is used to communicate with an external terminal through a network connection. When the deep learning image compression program based on space-channel mixed attention is executed by the processor, the steps of any one of the above-mentioned deep learning image compression methods based on space-channel mixed attention are implemented. The display screen of the intelligent terminal can be a liquid crystal display screen or an electronic ink display screen.
[0146] Those skilled in the art will understand that Fig.12 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the scheme of the present invention, and does not constitute a limitation on the smart terminal to which the scheme of the present invention is applied. The specific smart terminal may include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0147] In one embodiment, a smart terminal is provided, which includes a memory, a processor, and a deep learning image compression program based on spatial-channel mixed attention stored in the memory and executable on the processor. When the deep learning image compression program based on spatial-channel mixed attention is executed by the processor, the steps of any one of the deep learning image compression methods based on spatial-channel mixed attention provided in the embodiments of the present invention are implemented.
[0148] An embodiment of the present invention also provides a computer-readable storage medium, on which is stored a deep learning image compression program based on spatial-channel mixed attention. When the deep learning image compression program based on spatial-channel mixed attention is executed by a processor, the steps of any one of the deep learning image compression methods based on spatial-channel mixed attention provided in an embodiment of the present invention are implemented.
[0149] It should be understood that the serial numbers of the steps in the above embodiments do not imply a sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0150] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0151] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0152] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0153] In the embodiments provided by the present invention, it should be understood that the disclosed apparatus / terminal equipment and method can be implemented in other ways. For example, the apparatus / terminal equipment embodiments described above are only illustrative, for example, the division of the above modules or units is only a logical function division, and in actual implementation, other division methods can be used, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0154] 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, it should be understood by those skilled in the art that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A deep learning image compression method based on spatial-channel mixed attention, characterized in that: include: Get the image to be processed; Using multiple groups of alternately arranged hybrid attention modules and residual blocks in a preset feature encoder to perform spatial and channel optimization and dimensionality reduction processing on the image to be processed, to obtain a compressed high-dimensional feature map, and the hybrid attention module includes a window-based spatial attention module for learning local spatial information of the image to be processed and a window-based channel attention module for learning global channel information of the image to be processed; The image to be processed is optimized in space and channels and reduced in dimension by using multiple sets of alternately arranged hybrid attention modules and residual blocks in the preset feature encoder to obtain a compressed high-dimensional feature map. The hybrid attention module includes a window-based spatial attention module and a window-based channel attention module for learning the local spatial information and global channel information of the image to be processed respectively. Using a preset entropy model, sequentially performing arithmetic coding and arithmetic decoding on the compressed high-dimensional feature map to obtain a reconstructed high-dimensional feature map; The reconstructed high-dimensional feature map is subjected to dimensionality increase and spatial and channel inverse optimization processing using multiple groups of alternating residual blocks and hybrid attention modules in a preset feature decoder to obtain a reconstructed image.
2. The deep learning image compression method based on spatial-channel hybrid attention according to claim 1 is characterized in that: After the image to be processed is acquired, the method further includes performing dimension conversion on the image to be processed and updating the image to be processed, including: Decomposing the image to be processed according to a preset frequency decomposition rule by using wavelet transform to obtain a plurality of sub-images with different frequencies; and superimposing all the sub-images along the channel dimension to obtain a superimposed image; The stacked image is dimensionally transformed using the first residual block to update the image to be processed.
3. The deep learning image compression method based on spatial-channel hybrid attention according to claim 1 is characterized in that: The method uses a plurality of groups of alternately arranged hybrid attention modules and residual blocks in a preset feature encoder to perform space and channel optimization and dimensionality reduction processing on the image to be processed to obtain a compressed high-dimensional feature map, including: Each group of the hybrid attention module and residual block performs the following steps in sequence: Using the window-based spatial attention module and the second residual block connected in parallel in the hybrid attention module to capture local spatial information in the image to be processed, and obtain a spatially optimized feature map; Using the window-based channel attention module and the third residual block connected in parallel in the hybrid attention module to capture the global channel information and the local spatial information in the spatial optimization feature map, to obtain a channel optimization feature map; The fourth residual block in the feature encoder is used to perform dimensionality reduction processing on the channel optimized feature map to obtain a compressed high-dimensional feature map.
4. The deep learning image compression method based on spatial-channel hybrid attention according to claim 3 is characterized in that: The method of capturing local spatial information in the image to be processed by using the window-based spatial attention module and the second residual block connected in parallel in the hybrid attention module to obtain a spatially optimized feature map includes: Using the window-based spatial attention module to learn the local spatial information based on the Transformer model in the image to be processed, to obtain a first spatial feature map; Using the second residual block to learn the local spatial information based on the convolutional neural network in the image to be processed, to obtain a second spatial feature map; A spatial optimization feature map is obtained based on the first spatial feature map, the second spatial feature map and the image to be processed.
5. The deep learning image compression method based on spatial-channel hybrid attention according to claim 3 is characterized in that: The method of capturing global channel information and local spatial information in the spatial optimization feature map by using the window-based channel attention module and the third residual block connected in parallel in the hybrid attention module to obtain the channel optimization feature map includes: Using the window-based channel attention module to learn the global channel information based on the Transformer model in the spatial optimization feature map to obtain an initial channel feature map; Using the third residual block to learn the local spatial information based on the convolutional neural network in the spatial optimization feature map, to obtain a third spatial feature map; A channel optimization feature map is obtained based on the initial channel feature map, the third spatial feature map and the spatial optimization feature map.
6. The deep learning image compression method based on spatial-channel hybrid attention according to claim 5, characterized in that: The using the window-based channel attention module to learn the global channel information based on the Transformer model in the spatial optimization feature map to obtain the initial channel feature map includes: Dividing the spatial optimization feature map into windows to obtain a plurality of spatial optimization sub-feature maps; Using the space-channel dimension exchange module to transpose each of the space optimization sub-feature graphs, respectively, to obtain a channel optimization sub-feature graph corresponding to each of the space optimization sub-feature graphs; All the channel optimized sub-feature maps are superimposed and the global channel information based on the Transformer model is learned to obtain an initial channel feature map.
7. The deep learning image compression method based on spatial-channel hybrid attention according to claim 1, characterized in that: The method of sequentially performing arithmetic coding and arithmetic decoding on the compressed high-dimensional feature map using a preset entropy model to obtain a reconstructed high-dimensional feature map includes: Calculating the mean of the compressed high-dimensional feature map using the entropy model, and subtracting the mean from the compressed high-dimensional feature map to obtain a residual feature map; Quantizing the residual feature map to obtain a quantized residual feature map; Calculate the quantization error using a preset entropy model to obtain a compensation feature map; The entropy model is used to calculate the probability of each character appearing in the quantized residual feature map, and arithmetic coding is performed based on the probability of each character appearing to obtain a transmittable bit stream, and the transmittable bit stream is arithmetically decoded to restore the quantized residual feature map; The restored quantized residual feature map is added to the compensated feature map to obtain a reconstructed residual feature map, and the reconstructed residual feature map is added to the mean value of the compressed high-dimensional feature map to obtain a reconstructed high-dimensional feature map.
8. A deep learning image compression system based on spatial-channel hybrid attention, characterized in that: The system comprises: A data acquisition module, used for acquiring images to be processed; A compression module, used to perform spatial and channel optimization and dimensionality reduction processing on the image to be processed by using multiple groups of alternately arranged hybrid attention modules and residual blocks in a preset feature encoder to obtain a compressed high-dimensional feature map, and the hybrid attention module includes a window-based spatial attention module for learning local spatial information of the image to be processed and a window-based channel attention module for learning global channel information of the image to be processed; A coding and decoding module, used for sequentially performing arithmetic coding and arithmetic decoding on the compressed high-dimensional feature map using a preset entropy model to obtain a reconstructed high-dimensional feature map; The decompression module is used to use multiple groups of alternately arranged residual blocks and hybrid attention modules in a preset feature decoder to perform dimensionality increase and spatial and channel inverse optimization processing on the reconstructed high-dimensional feature map to obtain a reconstructed image.
9. Intelligent terminal, characterized in that: The intelligent terminal includes a memory, a processor, and a deep learning image compression program based on space-channel mixed attention stored in the memory and executable on the processor. When the deep learning image compression program based on space-channel mixed attention is executed by the processor, the steps of the deep learning image compression method based on space-channel mixed attention as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a deep learning image compression program based on space-channel mixed attention. When the deep learning image compression program based on space-channel mixed attention is executed by a processor, the steps of the deep learning image compression method based on space-channel mixed attention as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Cuff-free continuous blood pressure signal reconstruction method and system
CN119586991A
A cuffless continuous blood pressure signal reconstruction method and system
CN119586991B
End-to-end image compression method based on mixed attention and SwinV2 entropy model
CN119946271A
Stereoscopic video compression method with double-branch attention
CN120050431A
Video compression method based on deep learning
CN120455721A
