High performance variable rate image compression method and apparatus
By dividing the image compression model into low-bitrate and high-bitrate segmented networks and introducing the Swing Transformer and adaptive bitrate gain module, the performance degradation problem of variable bitrate image compression technology at high and low bitrate points is solved, and a more efficient image compression effect is achieved.
Patent Information
- Application Number
- CN202411715314.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Existing variable bitrate image compression techniques may experience a decrease in network performance at higher or lower bitrate points, indicating room for performance optimization.
The main encoder-decoder network in the image compression model is divided into a low bitrate segmentation network and a high bitrate segmentation network. The high bitrate segmentation network is constructed by sequentially connecting an embedding module, two Swing Transformer network modules, and a de-embedding feature module. Combined with a continuous adaptive bitrate gain module and a context-joint autoregressive network, the bitrate is dynamically adjusted.
It improves the performance of variable bitrate image compression, especially at higher or lower bitrate points, significantly improving image quality and compression efficiency, thus compensating for the performance degradation caused by the transformation from a single bitrate point model to a continuously variable bitrate model.
Smart Images

Figure CN119767021B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a high-performance variable bitrate image compression method and apparatus. Background Technology
[0002] The variable bitrate image compression framework based on gain modules is a representative work in this field. This model first achieves discrete variable bitrate by embedding gain units and inverse gain units in the super-prior network architecture. Secondly, it further achieves continuous variable bitrate through interpolation calculation in the evaluation model, while ensuring that the increased computational cost remains low. Finally, it compensates for the reduced performance by introducing an entropy model model with an asymmetric Gaussian model. However, there are still some challenges in improving the traditional single bitrate model to support variable bitrate, especially the potential performance degradation at higher or lower bitrate points. This indicates that although existing variable bitrate image compression techniques have made significant progress, there is still room for performance optimization. Summary of the Invention
[0003] This invention provides a high-performance variable bitrate image compression method and apparatus to address the problem that the performance of existing variable bitrate image compression methods needs further improvement.
[0004] This invention provides a high-performance variable bitrate image compression method, comprising:
[0005] Obtain the image to be compressed;
[0006] Based on the master editor-decoder network in the image compression model, the image to be compressed is coded with variable bit rate to obtain variable bit rate coding features.
[0007] Image compression is performed based on the variable bit rate coding features to obtain a compressed image;
[0008] The main encoding / decoding network is divided into a low bitrate segmentation network and a high bitrate segmentation network; the high bitrate segmentation network is constructed by sequentially connecting an embedding module, two Swing Transformer network modules, and a de-embedding feature module.
[0009] According to the high-performance variable bitrate image compression method provided by the present invention, the low bitrate point segmentation network is constructed by directly stacking multiple residual networks.
[0010] According to the high-performance variable bitrate image compression method provided by the present invention, the stacked residual network is constructed by directly stacking three ResUnit residual units and adding a ReLU activation function.
[0011] According to the present invention, a high-performance variable bitrate image compression method is provided, wherein the image compression model is constructed by embedding a continuous adaptive bitrate gain module into a context joint autoregressive network;
[0012] The continuous adaptive bitrate gain module is used to dynamically adjust the bitrate corresponding to the compressed image.
[0013] According to a high-performance variable bitrate image compression method provided by the present invention, the training steps of the image compression model include:
[0014] Acquire sample image data and an initial image compression model, wherein the initial image compression model includes an initial low bitrate point compression model and an initial high bitrate point compression model;
[0015] Based on the preset training iteration ratio of the first initial image compression model and the sample image data, the initial image compression model is trained iteratively to obtain the image compression model.
[0016] The first initial image compression model is either the initial low bitrate point compression model or the initial high bitrate point compression model.
[0017] According to the present invention, a high-performance variable bitrate image compression method is provided, wherein the initial image compression model is trained iteratively based on a preset training iteration ratio of a first initial image compression model and the sample image data to obtain the image compression model, comprising:
[0018] The current pre-trained image compression model is determined by comparing the preset training count ratio of the first initial image compression model with the cumulative training count of the first initial image compression model.
[0019] The pre-trained image compression model is trained and iterated based on the sample image data to obtain the image compression model.
[0020] The present invention also provides a high-performance variable bitrate image compression device, comprising:
[0021] The acquisition unit acquires the image to be compressed;
[0022] The variable bitrate coding unit, based on the master editor-decoder network in the image compression model, performs variable bitrate coding on the image to be compressed to obtain variable bitrate coding features.
[0023] The compression unit performs image compression based on the variable bit rate coding features to obtain a compressed image;
[0024] The main encoding / decoding network is divided into a low bitrate segmentation network and a high bitrate segmentation network; the high bitrate segmentation network is constructed by sequentially connecting an embedding module, two Swing Transformer network modules, and a de-embedding feature module.
[0025] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the high-performance variable bitrate image compression method as described above.
[0026] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the high-performance variable bitrate image compression method as described above.
[0027] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the high-performance variable bitrate image compression method as described above.
[0028] The high-performance variable bitrate image compression method and apparatus provided by this invention divides the master encoder-decoder network in the image compression model into a low bitrate segmentation network and a high bitrate segmentation network. The high bitrate segmentation network is mainly constructed by concatenating a Swing Transformer network based on a self-attention mechanism. By using the master encoder-decoder network in the image compression model to perform variable bitrate compression on the image to be compressed, a high-quality compressed image that meets actual needs is obtained, thereby improving the performance of the variable bitrate image compression method and compensating for the performance degradation at higher bitrate points caused by transforming a single bitrate model into a continuously variable bitrate model. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0030] Figure 1 This is a flowchart illustrating the high-performance variable bitrate image compression method provided by the present invention;
[0031] Figure 2 This is a schematic diagram showing the comparison of the number of bits in each part of the network after image compression at different bit rates, provided by the present invention.
[0032] Figure 3 This is a schematic diagram of the high bit rate segmentation network provided by the present invention;
[0033] Figure 4 This is a schematic diagram of the low bit rate segmentation network provided by the present invention;
[0034] Figure 5 This is a schematic diagram of the image compression model provided by the present invention;
[0035] Figure 6 This is one of the schematic diagrams of the training process of the image compression model provided by the present invention;
[0036] Figure 7 This is the second schematic diagram of the training process of the image compression model provided by the present invention;
[0037] Figure 8 This is a schematic diagram comparing the PSNR performance of the high-performance variable bitrate image compression method provided by this invention;
[0038] Figure 9 A schematic diagram comparing the reconstructed image effects of different compression frames provided by the present invention;
[0039] Figure 10 This is a schematic diagram of the structure of the high-performance variable bit rate image compression device provided by the present invention;
[0040] Figure 11 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0042] It should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features.
[0043] To address the aforementioned problems, this invention provides a high-performance variable bitrate image compression method to improve the performance of variable bitrate image compression. Figure 1 This is a flowchart illustrating the high-performance variable bitrate image compression method provided by the present invention, as shown below. Figure 1 As shown, the method includes:
[0044] Step 110: Obtain the image to be compressed;
[0045] Step 120: Based on the master editor-decoder network in the image compression model, perform variable bit rate encoding on the image to be compressed to obtain variable bit rate encoding features;
[0046] Step 130: Perform image compression based on the variable bit rate coding features to obtain a compressed image;
[0047] The main encoding / decoding network is divided into a low bitrate segmentation network and a high bitrate segmentation network; the high bitrate segmentation network is constructed by sequentially connecting an embedding module, two Swing Transformer network modules, and a de-embedding feature module.
[0048] Specifically, first, the image to be compressed, input by the user, is obtained; that is, the original image to be compressed. Then, the image to be compressed is input into the image compression model, where the master encoder-decoder network extracts the variable bitrate coding features of the image. Here, variable bitrate coding features refer to image features that use different bitrates to obtain different amounts of encoded data based on actual needs or different image content. Further, image compression is performed on the variable bitrate coding features to obtain a compressed image, thereby optimizing storage and transmission efficiency while maintaining image quality.
[0049] It should be noted that, Figure 2 This is a schematic diagram illustrating the comparison of the number of bits in each part of the network after image compression at different bitrates, as provided by the present invention. Figure 2 As shown, the total number of bits in the image's bitstream after network compression is [number missing]. The number of bits after compression by the main encoder network is The number of bits after compression by the a priori encoder network is The relationship between them can be expressed by the following formula, as shown below:
[0050]
[0051] Depend on Figure 2 It can be seen that after the image to be compressed is compressed using a general image compression model, the total number of bits in the compressed bitstream is... Number of compression bits in the main encoder network Both will gradually increase with the increase of bit rate, but the number of bits in the bitstream after compression by the advanced prior encoder network will be lower. The number of compressed bits in the main encoder network remains essentially unchanged, regardless of the bitrate. Always in the total number of bits of the compressed bitstream It occupies a dominant position. That is, the main network corresponding to the main encoder of the image compression model is the main source of image compression features.
[0052] Therefore, the main encoder-decoder network in the image compression model provided by this invention is divided into a low bitrate segmentation network and a high bitrate segmentation network. The high bitrate segmentation network is mainly constructed by concatenating multiple Swin Transformer networks based on a self-attention mechanism. It should be noted that concatenating multiple Swin Transformer networks can further enhance the image compression model's ability to process image details, thereby achieving better image quality at higher bitrates.
[0053] Figure 3 This is a schematic diagram of the high bitrate segmentation network provided by the present invention, wherein... Figure 3 (a) shows a schematic diagram of the overall structure of a high-bit-rate point segmentation network. Figure 3 (b) shows a schematic diagram of two cascaded Swing Transformer networks. Figure 3 As shown in (a): By adding an embedding module (PatchEmbed) and an unembedding feature module (PatchUnEmbed) before and after the two Swin Transformer network structures respectively, and using residual connections, they are combined to form a high bit rate point segmentation network, namely the Res_STB module.
[0054] like Figure 3 As shown in (b), the Two_SwinT module is constructed by concatenating two Swing Transformer networks based on self-attention mechanisms. For a single Swing Transformer network, the MLP (Multi-Layer Perceptron) module and the Norm (Normalization) module are used to normalize the input image data. Additionally, the W-MSA (Windows Multi-head Self-Attention) module and the SW-MSA (Shifted Windows Multi-head Self-Attention) module are used to reduce the complexity of image processing through window partitioning.
[0055] In one embodiment, the GDN (Generalized Divisive Normalization) layer in the main encoder-decoder network can be replaced with the high bitrate segmentation network proposed in this invention. This network, by introducing a Swing Transformer module with long-range dependency characteristics and considering the correlation between images, is more suitable for learning rich image detail features. Therefore, the addition of the Res_STB module to the high bitrate segmentation network provided in this embodiment further enhances the relational modeling capability based on global relational dependencies of high bitrate points, making it more suitable for model learning at high bitrate points.
[0056] The method provided in this invention divides the master encoder-decoder network in the image compression model into a low bitrate segmentation network and a high bitrate segmentation network. The high bitrate segmentation network is mainly constructed by concatenating a SwinTransformer network based on a self-attention mechanism. By using the master encoder-decoder network in the image compression model to perform variable bitrate compression on the image to be compressed, a high-quality compressed image that meets actual needs is obtained. This improves the performance of variable bitrate image compression methods and compensates for the performance degradation at higher bitrate points caused by transforming a single bitrate model into a continuously variable bitrate model.
[0057] Based on any of the above embodiments, the low bitrate segmentation network is constructed by directly stacking multiple residual networks. The stacked residual network is constructed by directly stacking three ResUnit residual units and adding a ReLU activation function.
[0058] Figure 4 This is a schematic diagram of the low bit-rate segmentation network provided by the present invention, wherein, Figure 4 (a) shows a schematic diagram of the overall structure of a low-bit-rate point segmentation network. Figure 4 (b) shows a schematic diagram of the stacked residual network structure. For example... Figure 4 As shown in (a), the low bitrate segmentation network is obtained by directly stacking three stacked residual networks (ResUnit). Figure 4 As shown in (b), a single stacked residual network consists of: a one-dimensional convolutional layer, a ReLU activation function, a three-dimensional convolutional layer, a ReLU activation function, a one-dimensional convolutional layer, and a ReLU activation function, with residual connections added before the last ReLU activation function.
[0059] It should be noted that in the low bitrate segmentation network, a deep network structure is constructed by directly stacking three ResUnit residual unit modules. This stacking method not only helps the model capture deep features in the image but also effectively prevents degradation problems that occur as the network depth increases. By comprehensively optimizing the network parameters, this structure can achieve efficient and high-quality image reconstruction or encoding. Furthermore, the introduction of the ReLU activation function in each ResUnit module not only increases the nonlinearity of the module but also further enhances the network's expressive power, thereby improving the efficiency and quality of image compression.
[0060] Based on any of the above embodiments, the image compression model is constructed by embedding a continuously adaptive bitrate gain module into a context joint autoregressive network; the continuously adaptive bitrate gain module is used to dynamically adjust the bitrate corresponding to the compressed image.
[0061] Specifically, in one embodiment, Figure 5 This is a schematic diagram of the image compression model provided by the present invention, as shown below. Figure 5 As shown, the model includes: a master encoder-decoder network, a continuous adaptive rate gain unit, a context-joint autoregressive network, a decompression module, and an image reconstruction module. The continuous adaptive bitrate gain unit includes a gain unit and an inverse gain unit. The continuous adaptive bitrate gain module dynamically adjusts the bitrate corresponding to the compressed image, and the context joint autoregressive network is used to implement image compression. During the compression process, the image to be compressed (…) is first… The input is fed into the image compression model. The low-bit-rate segmentation network and high-bit-rate segmentation network in the main encoder of the image compression model perform image encoding on regions with different bit-rate encoding parameters in the image to be compressed, thereby obtaining the corresponding low-bit-rate encoded features. and high code rate coding features These features collectively constitute the variable bitrate coding features. Then, the variable bitrate coding features are input to the continuously adaptive bitrate gain module. This module dynamically adjusts the bitrate setting corresponding to the compressed image to achieve discrete variable bitrate. Next, the encoded image features are further processed using a context-joint autoregressive network to complete image compression and generate the features to be decoded. Finally, the features to be decoded can be input to the inverse gain unit, and after decoding, the final decompressed reconstructed image is obtained. .
[0062] The image compression model provided in this invention compensates for the performance degradation at higher or lower bitrate points caused by transforming a single bitrate point model into a continuously variable bitrate model.
[0063] Based on any of the above embodiments, the training steps of the image compression model include:
[0064] Acquire sample image data and an initial image compression model, wherein the initial image compression model includes an initial low bitrate point compression model and an initial high bitrate point compression model;
[0065] Based on the preset training iteration ratio of the first initial image compression model and the sample image data, the initial image compression model is trained iteratively to obtain the image compression model.
[0066] The first initial image compression model is either the initial low bitrate point compression model or the initial high bitrate point compression model.
[0067] Specifically, each iteration of model training will traverse all batches of data in the training set, with each batch containing a batch-size number of images. At the start of the iteration, the percentage of training iterations is preset, and the number of trained batches of the first initial image compression model is initialized.
[0068] The method provided in this invention can control the proportion of training iterations of another bitrate compression model by controlling the preset training iteration ratio of the initial low bitrate compression model or the initial high bitrate compression model. Furthermore, by customizing the training iteration ratio of different bitrate compression models, the network can select a more suitable ratio to train the overall image compression model, thereby achieving better performance of the trained image compression model without wasting a large amount of computing resources.
[0069] Figure 6 This is one of the schematic diagrams illustrating the training process of the image compression model provided by this invention, showing the training process of the Seg_JGRCN framework, as follows. Figure 6 As shown, during the training phase of the image compression model, initially, s is randomly initialized, where s corresponds to the index of the compression model at different discrete bitrate points. There are a total of n discrete bitrate models. The image is divided into low-bitrate compression models and high-bitrate compression models. Then, a high / low bitrate ratio control module determines whether to train the low-bitrate model based on whether the current training iterations of the low-bitrate model exceed its preset training iterations. If the current training iterations of the low-bitrate model exceed its preset percentage, the high-bitrate segmentation network is trained, i.e., the initial high-bitrate compression model is trained. If the current training iterations of the low-bitrate model do not exceed its preset percentage, the low-bitrate segmentation network is trained, i.e., the initial low-bitrate compression model is trained. Finally, the trained low-bitrate and high-bitrate segmentation networks together form the main encoder / decoder network in the final image compression model.
[0070] Based on any of the above embodiments, the step of training and iterating the initial image compression model based on the preset training iteration ratio of the first initial image compression model and the sample image data to obtain the image compression model includes:
[0071] The current pre-trained image compression model is determined by comparing the preset training count ratio of the first initial image compression model with the cumulative training count of the first initial image compression model.
[0072] The pre-trained image compression model is trained and iterated based on the sample image data to obtain the image compression model.
[0073] Figure 7 This is the second schematic diagram of the training process of the image compression model provided by this invention, as shown below. Figure 7 As shown, the process begins by setting the low bitrate point training ratio, meaning the first initial image compression model is the initial low bitrate point compression model. This low bitrate point training ratio is the preset percentage of training iterations. Then, the number of low bitrate point training iterations is initialized to 0, and the iteration count i = 0. The total number of iterations is then set. The variable s is randomly initialized, with s corresponding to the indices of different discrete bitrate point compression models. There are a total of n discrete bitrate models. Subsequently, the dataset is iterated through. At the beginning of each mini-batch in each iteration, a value is randomly selected from the range [0, n-1], and this value corresponds to the set of weighting factors. The index is defined by different trade-off factors. The set is , The corresponding subscript is used to train the tradeoff factor. The corresponding bitrate compression model aims to achieve the following, where the tradeoff factor takes the values {0.05, 0.03, 0.018, 0.01, 0.007, 0.003, 0.0018, 0.001, 0.0007, 0.0003}. After obtaining a random value s, the following is determined: The check confirms whether the model being trained in the current batch is a low-bitrate model. If it is, the number of low-bitrate model training batches is incremented by one, and it is determined whether the number of low-bitrate batches exceeds the set proportion. If it does not exceed the low-bitrate training proportion, model training proceeds; if it exceeds the low-bitrate proportion, high-bitrate model training is switched to. s is reset to [0, ...]. The random number 's' is used to determine if the current training session is a high bitrate point. If 's' indicates that the current training session is a high bitrate point, then training is performed directly, and this process is repeated until all datasets for that iteration have been traversed, at which point the iteration ends.
[0074] It should be noted that, Figure 8This is a comparative diagram of the PSNR performance of the high-performance variable bitrate image compression method provided by this invention. It shows a comparison of the PSNR (Peak Signal-to-Noise Ratio) performance between existing methods and the variable bitrate image compression method provided by this invention. Figure 8 As shown in the figure, using PSNR as the evaluation metric, the rate-distortion results at different bitrates are presented, particularly the performance at higher and lower bitrate segments. The Seg_JGRCN framework (i.e., the variable bitrate image compression method provided in this invention) achieves better performance results than traditional image compression frameworks and end-to-end image compression frameworks. In particular, the method provided in this invention effectively addresses the performance degradation at higher or lower bitrate points caused by the transformation from a single bitrate model to a continuous variable bitrate model. Except for higher or lower bitrate points, the variable bitrate image compression method provided in this invention significantly improves the performance of all bitrate segments.
[0075] in addition, Figure 9 This is a schematic diagram comparing the reconstructed image effects of different compression frameworks provided by the present invention, showing the reconstructed image visualizations based on kodim06 using different image compression methods, such as... Figure 9 As shown, Figure 9 The paper showcases the reconstructed images based on the kodim06 image at a bitrate of approximately 0.2 bpp using five different compression frameworks. The reconstructed images reveal that the Seg_JGRCN framework proposed in this invention, based on a low bitrate model, does not confuse line details with information from images in similar color gamuts. Its details are clearer compared to other image compression methods, which tend to ignore fine lines and areas with similar colors.
[0076] Based on any of the above embodiments Figure 10 This is a schematic diagram of the high-performance variable bitrate image compression device provided by the present invention, as shown below. Figure 10 As shown, the device includes:
[0077] Acquisition unit 1010 acquires the image to be compressed;
[0078] The variable bit rate coding unit 1020 performs variable bit rate coding on the image to be compressed based on the master editor-decoder network in the image compression model to obtain variable bit rate coding features.
[0079] Compression unit 1030 performs image compression based on the variable bit rate coding features to obtain a compressed image;
[0080] The main encoding / decoding network is divided into a low bitrate segmentation network and a high bitrate segmentation network; the high bitrate segmentation network is constructed by sequentially connecting an embedding module, two Swing Transformer network modules, and a de-embedding feature module.
[0081] The apparatus provided in this invention divides the master encoder-decoder network in the image compression model into a low bitrate segmentation network and a high bitrate segmentation network; the high bitrate segmentation network is mainly constructed by cascading two Swing Transformer networks. By using the master encoder-decoder network in the image compression model to perform variable bitrate compression on the image to be compressed, a high-quality compressed image that meets actual needs is obtained, thereby improving the performance of variable bitrate image compression methods and compensating for the performance degradation at higher bitrate points caused by transforming a single bitrate model into a continuously variable bitrate model.
[0082] Based on any of the above embodiments, the low bit rate segmentation network is constructed by directly stacking multiple residual networks.
[0083] Based on any of the above embodiments, the stacked residual network is constructed by directly stacking three ResUnit residual units and adding a ReLU activation function.
[0084] Based on any of the above embodiments, the image compression model is constructed by embedding a continuous adaptive bit rate gain module into a context joint autoregressive network;
[0085] The continuous adaptive bitrate gain module is used to dynamically adjust the bitrate corresponding to the compressed image.
[0086] Based on any of the above embodiments, the device further includes a training unit, which is specifically used for:
[0087] Acquire sample image data and an initial image compression model, wherein the initial image compression model includes an initial low bitrate point compression model and an initial high bitrate point compression model;
[0088] Based on the preset training iteration ratio of the first initial image compression model and the sample image data, the initial image compression model is trained iteratively to obtain the image compression model.
[0089] The first initial image compression model is either the initial low bitrate point compression model or the initial high bitrate point compression model.
[0090] Based on any of the above embodiments, the training unit is further specifically used for:
[0091] The current pre-trained image compression model is determined by comparing the preset training count ratio of the first initial image compression model with the cumulative training count of the first initial image compression model.
[0092] The pre-trained image compression model is trained and iterated based on the sample image data to obtain the image compression model.
[0093] Figure 11 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 11 As shown, the electronic device may include: a processor 1110, a communications interface 1120, a memory 1130, and a communication bus 1140, wherein the processor 1110, the communications interface 1120, and the memory 1130 communicate with each other through the communication bus 1140. The processor 1110 can call logical instructions in the memory 1130 to execute a high-performance variable bitrate image compression method. The method includes: acquiring an image to be compressed; performing variable bitrate encoding on the image to be compressed based on the master encoder-decoder network in the image compression model to obtain variable bitrate encoding features; and performing image compression based on the variable bitrate encoding features to obtain a compressed image. The master encoder-decoder network is divided into a low bitrate segmentation network and a high bitrate segmentation network. The high bitrate segmentation network is constructed by sequentially connecting an embedding module, two Swin Transformer network modules, and a de-embedding feature module.
[0094] Furthermore, the logical instructions in the aforementioned memory 1130 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0095] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the high-performance variable bitrate image compression method provided by the above methods. The method includes: acquiring an image to be compressed; performing variable bitrate encoding on the image to be compressed based on the master encoder-decoder network in the image compression model to obtain variable bitrate encoding features; performing image compression based on the variable bitrate encoding features to obtain a compressed image; the master encoder-decoder network is divided into a low bitrate segmentation network and a high bitrate segmentation network; the high bitrate segmentation network is constructed by sequentially connecting an embedding module, two Swing Transformer network modules, and a de-embedding feature module.
[0096] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a high-performance variable bitrate image compression method provided by the methods described above. The method includes: acquiring an image to be compressed; performing variable bitrate encoding on the image to be compressed based on a master encoder-decoder network in an image compression model to obtain variable bitrate encoding features; and performing image compression based on the variable bitrate encoding features to obtain a compressed image. The master encoder-decoder network is divided into a low bitrate segmentation network and a high bitrate segmentation network. The high bitrate segmentation network is constructed by sequentially connecting an embedding module, two Swing Transformer network modules, and a de-embedding feature module.
[0097] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0098] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A high performance variable rate image compression method, characterized by, The method comprises the steps of: acquiring an image to be compressed; performing variable bit rate coding on the image to be compressed based on a main coding-decoding network in an image compression model to obtain variable bit rate coding features; performing image compression based on the variable bit rate coding features to obtain a compressed image; the main coding-decoding network is divided into a low bit rate point segmentation network and a high bit rate point segmentation network; the high bit rate point segmentation network is constructed by sequentially connecting an embedding module, two Swin Transformer network modules and a de-embedding feature module; the low bit rate point segmentation network is obtained by directly stacking three ResUnit residual units; the ResUnit residual unit comprises a ReLu activation function; the main coding-decoding network in the image compression model is used to perform variable bit rate coding on the image to be compressed to obtain variable bit rate coding features, which comprises: based on the low bit rate point segmentation network and the high bit rate point segmentation network, image coding is performed on regions with different coding parameters in the image to be compressed to obtain low bit rate coding features and high bit rate coding features; the variable bit rate coding features comprise the low bit rate coding features and the high bit rate coding features; the image compression model further comprises a continuous adaptive bit rate gain unit and a context joint autoregressive network; the continuous adaptive bit rate gain unit comprises a gain unit and an inverse gain unit; the variable bit rate coding features are input into the gain unit, the gain unit is used to dynamically adjust the bit rate corresponding to the image to be compressed, and the context joint autoregressive network is used to process the variable bit rate coding features to generate decoded image features; the decoded image features are input into the inverse gain unit for decoding processing to obtain a reconstructed image.
2. The high performance variable bit rate image compression method of claim 1, wherein, The training steps of the image compression model comprise the steps of: acquiring sample image data and an initial image compression model; the initial image compression model comprises an initial low bit rate point compression model and an initial high bit rate point compression model; training the initial image compression model based on a preset training frequency ratio of the first initial image compression model and the sample image data to obtain the image compression model; the first initial image compression model is the initial low bit rate point compression model or the initial high bit rate point compression model.
3. The high performance variable bit rate image compression method of claim 2, wherein, The training steps of the image compression model comprise the steps of: comparing the preset training frequency ratio of the first initial image compression model with the cumulative training frequency of the first initial image compression model to determine a current pre-training image compression model; training the pre-training image compression model based on the sample image data to obtain the image compression model.
4. A high performance variable rate image compression apparatus, characterized by comprising: The method comprises the steps of: an acquisition unit acquires an image to be compressed; a variable bit rate coding unit performs variable bit rate coding on the image to be compressed based on a main coding-decoding network in an image compression model to obtain variable bit rate coding features; a compression unit performs image compression based on the variable bit rate coding features to obtain a compressed image; The main decoding network is divided into a low code rate point segmentation network and a high code rate point segmentation network; the high code rate point segmentation network is constructed by sequentially connecting an embedding module, two Swin Transformer network modules, and a de-embedding feature module; the low code rate point segmentation network is obtained by directly stacking three ResUnit residual units; the ResUnit residual unit includes a ReLu activation function; The variable code rate encoding unit is specifically configured to: based on the low code rate point segmentation network and the high code rate point segmentation network, respectively perform image encoding on regions with different code rate encoding parameters in the image to be compressed to obtain low code rate encoding features and high code rate encoding features; The variable code rate encoding features include low code rate encoding features and the high code rate encoding features; The image compression model further includes a continuous adaptive code rate gain unit and a context joint autoregressive network; the continuous adaptive code rate gain unit includes a gain unit and an inverse gain unit; The variable code rate encoding features are input into the gain unit, the code rate corresponding to the image to be compressed is dynamically adjusted based on the gain unit, and the variable code rate encoding features are processed based on the context joint autoregressive network to generate image features to be decoded; The image features to be decoded are input into the inverse gain unit for decoding processing to obtain a reconstructed image.
5. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the high-performance variable code rate image compression method of any one of claims 1 to 3.
6. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the high-performance variable code rate image compression method of any one of claims 1 to 3.
7. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the high-performance variable code rate image compression method of any one of claims 1 to 3.
Citation Information
Patent Citations
Multi-rate neural image compression method and apparatus with stackable nested model structure
CN114450938A
Variable code rate image compression method, system and device, terminal and storage medium
CN115988215A