Deep learning image compression method and apparatus for automatic control of bit rate and uniform coding depth
By uniformly grouping the feature channels of the variational autoencoder compression model and dynamically controlling the bit rate, the problems of uncontrollable bit rate and uneven sub-packet distribution in image compression algorithms are solved, thereby improving transmission efficiency and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TRANSPORT PLANNING & RES INST MINIST OF TRANSPORT
- Filing Date
- 2025-06-26
- Publication Date
- 2026-05-08
AI Technical Summary
Existing image compression algorithms cannot precisely control the bit rate, resulting in low transmission efficiency in bandwidth-limited transmission scenarios. Furthermore, the compressed sub-packet sizes are uneven, which can easily lead to transmission failures or resource waste.
A variational autoencoder compression model is adopted. By uniformly grouping feature channels and dynamically controlling the bit rate, the number of bytes in each sub-packet is consistent. The hyperparameters are adjusted by the loss function to stabilize the bit rate within a specified range.
It achieves precise control over compressed image bytes, ensuring stable bandwidth utilization during transmission, reducing transmission interruptions, and improving the reliability and efficiency of satellite image transmission.
Smart Images

Figure CN120639976B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a deep learning image compression method with automatic bit rate control and uniform coding, a deep learning image compression apparatus with automatic bit rate control and uniform coding, an electronic device, and a computer-readable medium. Background Technology
[0002] Traditional progressive image compression algorithms are mainly based on wavelet transform and bit-plane coding. Wavelet transform-based progressive image compression algorithms decompose the image into wavelet coefficients of different scales and orientations. However, this method may produce artifacts such as ringing when dealing with complex image structures and textures, affecting image quality. Bit-plane coding methods encode each bit plane of the binary representation of image pixels separately, starting from the most significant bit and transmitting the encoding. However, this method does not fully utilize the correlation between different bit planes, and its compression efficiency needs improvement.
[0003] Deep learning-based image compression algorithms have developed rapidly and can be broadly categorized into variational autoencoders (VAEs), generative adversarial networks (GANs), and self-supervised learning methods. VAEs map images onto a probability distribution in a latent space for encoding and decoding. They offer advantages in progressive compression, processing the main parts of the latent space first to obtain a rough image, then gradually processing other parts to improve image quality. However, their training and computational complexity are high. GANs consist of a generator and a discriminator. In progressive image compression, the generator reconstructs a high-quality image from the compressed representation, while the discriminator judges the similarity between the reconstructed image and the original image. Adversarial training optimizes the generator's reconstruction capabilities; however, its training process is unstable and prone to crashes. Self-supervised learning methods allow the model to learn useful feature representations from the data itself. In progressive image compression, features obtained through self-supervised learning are used to construct a preliminary image representation before further refining the image quality. However, their adaptability in large-scale image data applications needs improvement.
[0004] The existing traditional and deep learning-based image compression algorithms mentioned above all use a fixed bitrate, which cannot precisely control the bitrate within a specified range. Furthermore, the size difference between sub-packets in progressive decompression is significant. This makes it difficult to maximize transmission efficiency in satellite or Internet transmission scenarios with limited bandwidth. Summary of the Invention
[0005] In view of the above problems, the present invention is proposed to provide a deep learning image compression method with automatic bit rate control and uniform coding that overcomes or at least partially solves the above problems, and a corresponding deep learning image compression apparatus with automatic bit rate control and uniform coding, an electronic device, and a computer-readable medium.
[0006] This invention discloses a deep learning-based image compression method that automatically controls bit rate and uniform coding, the method comprising:
[0007] Input images or features into a pre-trained compressed model containing a variational autoencoder;
[0008] The compression model optimizes the input image or features by implementing uniform grouping of feature channels and dynamic control of the bit rate, and then outputs the compressed image or features.
[0009] Optionally, the compression model optimizes the input image or features by implementing uniform grouping of feature channels and dynamic bit rate control, and outputs a compressed image or features, including:
[0010] The compression model evenly groups the model channels into equal-width sub-channels based on the total number of model channels and the number of sub-packets; each equal-width sub-channel contains the same number of feature channels.
[0011] Each equal-width sub-channel is encoded to generate an independent compressed sub-packet.
[0012] Optionally, the training of a feature channel uniform grouping strategy to balance sub-packet volume includes:
[0013] Calculate the standard deviation of the number of bits between sub-packets and add it as a penalty term to the loss function. Then, automatically correct the sub-packet volume deviation through gradient descent.
[0014] Optionally, training the dynamic bitrate control of the compression model includes:
[0015] Pre-set the target bitrate range;
[0016] The model is warmed up using fixed hyperparameters during the first preset number of training cycles;
[0017] At the start of the next training cycle after completing the preset number of training cycles, the current bitrate is monitored in real time. When the current bitrate exceeds the target bitrate range, the hyperparameters are automatically adjusted and the updated hyperparameters are injected into the loss function in real time.
[0018] The bitrate is stabilized within the target bitrate range through iterative adjustments.
[0019] Alternatively, the expression for the loss function is as follows:
[0020]
[0021] In the above formula, D is the mean squared error loss between the original image and the reconstructed image, which measures the quality of the compressed image; R is the compression bitrate, which is generally measured by the number of bits occupied by a single pixel after bpp compression; std represents the standard deviation operation. , ,..., Represents the individual compression bitrate of 1 to n channels; the hyperparameter λ controls the balance between compression bitrate and image quality.
[0022] Optionally, the adjustment method of the dynamic bitrate control is as follows:
[0023] When the current bitrate is detected to be lower than the lower limit of the target bitrate range, the hyperparameters are increased;
[0024] When the current bitrate is detected to be higher than the upper limit of the target bitrate range, decrease the hyperparameters;
[0025] The parameter adjustment range is dynamically calculated based on the bit rate deviation ratio.
[0026] Optionally, training the dynamic bitrate control of the compression model also includes:
[0027] Set the range of hyperparameter values. When the adjusted hyperparameter value exceeds the range, it will be truncated according to the nearest boundary value.
[0028] The present invention also discloses a deep learning image compression apparatus for automatically controlling bit rate and uniform coding, the apparatus comprising:
[0029] The image feature input module is used to input images or features into the constructed, trained compression model containing a variational autoencoder;
[0030] The compression output module is used by the compression model to compress and optimize the input image or features by implementing uniform grouping of feature channels and dynamic control of the bit rate, and then outputting the compressed image or features.
[0031] The present invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0032] The memory is used to store computer programs;
[0033] When the processor executes the program stored in the memory, it implements the deep learning image compression method with automatic bit rate control and uniform coding as described in this invention.
[0034] The present invention also discloses one or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform a deep learning image compression method with automatic bit rate control and uniform coding as described in the present invention.
[0035] This invention has the following advantages:
[0036] This invention discloses a deep learning image compression method with automatic bitrate control and uniform coding. The input image or features are fed into a pre-trained compression model incorporating a variational autoencoder. The compression model optimizes the input image or features by implementing uniform grouping of feature channels and dynamic bitrate control, outputting a compressed image or features. This method ensures uniform byte distribution in sub-packets through uniform coding and controls the total number of bytes in sub-packets within a specified range through automatic bitrate control. The combination of these two methods enables precise control over the byte usage in compressed data, adapting to the special limitations of bandwidth and transmission rate in bandwidth-constrained satellite or internet transmission scenarios, thus maximizing transmission efficiency. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of the ELIC image compression algorithm network structure;
[0038] Figure 2 This is a flowchart of the steps of a deep learning image compression method with automatic bit rate control and uniform coding provided in an embodiment of the present invention;
[0039] Figure 3 This is a schematic diagram of the byte occupancy distribution before and after uniform encoding provided in an embodiment of the present invention;
[0040] Figure 4 This is a structural block diagram of a deep learning image compression device that automatically controls bit rate and uniform coding, provided in an embodiment of the present invention.
[0041] Figure 5 This is a block diagram of an electronic device provided in an embodiment of the present invention;
[0042] Figure 6 This is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. Detailed Implementation
[0043] Introduction to basic technical content:
[0044] Since the establishment of the Variational Autoencoder (VAE) architecture, lossy image compression techniques based on deep learning have largely adopted its main structure, including an autoencoder for extracting latent representations and a module for auxiliary entropy coding. Given a source image vector x, the autoencoder contains a parametric analysis transform network. To obtain the latent representation y of x and a parametric synthesis transformation network To reconstruct x, y is then quantized to obtain storable discrete encoded symbols. The quantization process introduces errors, but these are tolerable for lossy compression. The probability distribution is modeled using a factorization density model.
[0045] In order to obtain more effectively The internal dependencies were used to obtain an accurate factorization model. Much subsequent work revolved around context-based autoregressive entropy models, the most representative of which is the channel context-based entropy model. In the channel context-based entropy model, discrete encoded symbols... Grouped by channel dimension and decoded sequentially.
[0046] The channel-context-based autoregressive entropy model, without introducing additional information flow costs, fully utilizes already decoded information to ensure more efficient encoding and decoding of subsequent information. Due to the channel-regressive nature of the autoregressive entropy model, decoding must be performed sequentially by channel, achieving a progressive decompression effect.
[0047] The non-uniform grouping strategy was initially proposed in the ELIC paper. They discovered that information is not uniformly distributed among the latent variables learned by the model; a large amount of information is concentrated in a few channels. However, when a channel context model is introduced, this information further exhibits a certain order. Channel groups encoded and decoded earlier contain more information, allowing the context model to more accurately predict the latent variables of subsequent channel groups. To address this, a non-uniform channel grouping strategy is proposed. This strategy reduces the grouping granularity of earlier channels, making them more frequently used to predict later channels, while simultaneously increasing the grouping granularity of later channels, increasing parallelism and reducing computational cost, thereby effectively improving the computational efficiency of the channel context model.
[0048] However, this also directly leads to significant differences in the byte size of compressed packets generated by different channels; in practice, the byte size of the largest and smallest compressed packets differs by more than tenfold. This uneven distribution causes considerable problems in satellite image transmission. Due to bandwidth limitations, satellite transmission chooses to send multiple sub-packets to transmit single image information, but if the byte size of individual sub-packets is too large, exceeding the transmission bandwidth limit, transmission will fail. Furthermore, if only a single compressed packet is sent at a time, uneven storage distribution will also lead to a waste of transmission resources.
[0049] ELIC (Efficient Learned Image Compression) is an end-to-end image compression algorithm based on deep learning. Its core idea is to automatically learn an efficient representation of an image through a neural network, thereby achieving high compression ratios and high-quality reconstruction. In the compression stage, the input image first undergoes feature extraction through an encoder network. The encoder typically consists of convolutional layers, downsampling layers, and nonlinear activation functions (such as GELU or ReLU), progressively converting the image into a low-resolution, high-channel-count latent representation. This latent representation is then quantized, i.e., discretized into integers by rounding or adding uniform noise for subsequent entropy encoding. The quantized latent representation is then used by an entropy model (such as a super-prior network) to estimate its probability distribution. The super-prior network further compresses the statistical information (such as mean and variance) of the latent representation, generating side information. Finally, an arithmetic encoder (such as ANS or RangeCoding) performs lossless compression on the quantized values according to the probability distribution, generating a compact bitstream.
[0050] During the decompression phase, the bitstream first recovers the quantized latent representation and prior information through an arithmetic decoder. The entropy model uses the prior information to reconstruct the probability distribution of the latent representation, thus guiding the decoding process. The quantized values are then dequantized into continuous values (usually treated as floating-point numbers) as input to the decoder. The decoder network structure is symmetrical to the encoder, typically containing upsampling layers and convolutional layers, progressively reconstructing the latent representation into an image. See [link to network structure details] for more information. Figure 1 .
[0051] This invention aims to effectively solve the problem of low transmission efficiency caused by the inability to accurately control the bit rate and the unevenness of the compressed sub-packets in existing algorithms by automatically controlling the bit rate and uniform coding strategy, thereby maximizing the utilization of transmission resources.
[0052] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0053] Reference Figure 2 The diagram illustrates a flowchart of a deep learning image compression method for automatically controlling bit rate and uniform coding, provided in an embodiment of the present invention. Specifically, it may include the following steps:
[0054] Step 201: Input the image or features into the constructed, trained compression model containing a variational autoencoder;
[0055] Step 202: The compression model optimizes the input image or features by implementing uniform grouping of feature channels and dynamic control of the bit rate, and then outputs the compressed image or features.
[0056] First, the input image or features are fed into a pre-trained compression model, whose core architecture includes a variational autoencoder (VAE). The VAE maps the input data to a probability distribution in the latent space through an encoder network, which is then reconstructed by a decoder. Its training objective is to minimize the reconstruction error while constraining the distribution characteristics of the latent representation. In this embodiment, the model receives the original image or intermediate features as the processing object, performs feature extraction and dimensionality reduction through the encoder, and forms an initial compressed representation. It should be noted that this model has undergone end-to-end training using a loss function optimized for rate distortion, ensuring a balance between compression efficiency and reconstruction quality.
[0057] Secondly, the compression model optimizes the compression process through uniform grouping of feature channels and dynamic bitrate control mechanisms. By using a preset uniform grouping strategy, the encoded feature channels are divided into several equal-sized subgroups, forcing each subgroup to generate encoded sub-packets with exactly the same number of bytes, thereby eliminating output fluctuations caused by local differences in features and ensuring byte uniformity between sub-packets after compression; Figure 3 This diagram illustrates the byte distribution before and after uniform encoding. Furthermore, based on transmission scenario requirements, global compression parameters are dynamically adjusted to ensure the total number of bytes in the final output data strictly matches the target value, achieving precise constraints on the overall bitrate. Finally, the compressed representation, after the above optimization process, is reconstructed by the decoder into an image or feature output.
[0058] This method uses a dynamic bitrate control mechanism to ensure the overall byte occupancy of the compressed image, while a uniform coding strategy ensures the uniformity of bytes among the compressed sub-packets. Through the cooperation of the two, the compressed image bytes can be precisely controlled to adapt to the special limitations of bandwidth and transmission rate in satellite or Internet transmission scenarios with limited bandwidth, thereby improving transmission efficiency.
[0059] In an optional embodiment of the present invention, the compression model optimizes the input image or features by implementing uniform grouping of feature channels and dynamic control of the bit rate, and outputs a compressed image or features, including:
[0060] The compression model evenly groups the model channels into equal-width sub-channels based on the total number of model channels and the number of sub-packets; each equal-width sub-channel contains the same number of feature channels.
[0061] Each equal-width sub-channel is encoded to generate an independent compressed sub-packet.
[0062] In an optional embodiment of the present invention, the training of the feature channel uniform grouping strategy to balance the sub-packet volume includes:
[0063] Calculate the standard deviation of the number of bits between sub-packets and add it as a penalty term to the loss function. Then, automatically correct the sub-packet volume deviation through gradient descent.
[0064] The specific measure of the uniform coding strategy proposed in this embodiment is to replace all non-uniform grouping with a uniform number of channels. This ensures that the theoretical information capacity of each channel is the same, significantly alleviating the problem of excessive differences in information capacity between channels. Specifically, the feature channels are divided into equal-width sub-channels according to the principle of uniform grouping (e.g., each group is fixed as C / N channels, where N is the number of sub-packets and C is the total number of model channels). Each sub-channel is assigned the same quantization bit width to ensure consistency in theoretical information capacity. Each group of channels independently generates encoded sub-packets, and the output length of each sub-packet is controlled through a uniform quantization strategy to ensure that the number of bytes in all sub-packets is strictly consistent after compression. This design eliminates byte fluctuations caused by differences in local feature complexity in traditional coding, meeting the rigid requirements for data packet uniformity in transmission scenarios.
[0065] Furthermore, to further ensure a uniform distribution of byte size across different compressed packets, a loss function is introduced that addresses the BPP standard deviation between different compressed sub-packets. During model training, this loss is applied through backpropagation to continuously penalize compressed packets with significant differences in byte size, gradually bringing the sizes of the compressed packets closer together and ultimately achieving uniform encoding.
[0066] Loss function enhancement: Introduce a sub-package bpp standard deviation penalty term into the base loss (D+λR):
[0067] In the above formula, D is the mean squared error loss between the original image and the reconstructed image, which measures the quality of the compressed image; R is the compression bitrate, which is generally measured in bpp (the number of bits occupied by a single pixel after compression); std represents the standard deviation operation. , ,..., Represents the individual compression bitrate of 1 to n channels; the hyperparameter λ controls the balance between compression bitrate and image quality. A larger λ results in better compression but generally worse image quality, and vice versa. Gradient descent automatically corrects sub-packet volume deviations, forcing each sub-packet's bitrate (BPP) to converge towards the mean.
[0068] The uniform coding strategy effectively improves the uneven byte occupancy of compressed packets, making the bandwidth utilization more stable during transmission, reducing the risk of transmission interruption or delay caused by some data packets being too large, and improving the reliability and efficiency of satellite image transmission.
[0069] In an optional embodiment of the present invention, training the dynamic bitrate control of the compression model includes:
[0070] Pre-set the target bitrate range;
[0071] The model is warmed up using fixed hyperparameters during the first preset number of training cycles;
[0072] At the start of the next training cycle after completing the preset number of training cycles, the current bitrate is monitored in real time. When the current bitrate exceeds the target bitrate range, the hyperparameters are automatically adjusted and the updated hyperparameters are injected into the loss function in real time.
[0073] The bitrate is stabilized within the target bitrate range through iterative adjustments.
[0074] In an optional embodiment of the present invention, the adjustment method of the dynamic bitrate control is as follows:
[0075] When the current bitrate is detected to be lower than the lower limit of the target bitrate range, the hyperparameters are increased;
[0076] When the current bitrate is detected to be higher than the upper limit of the target bitrate range, decrease the hyperparameters;
[0077] The parameter adjustment range is dynamically calculated based on the bit rate deviation ratio.
[0078] In an optional embodiment of the present invention, training the dynamic bitrate control of the compression model further includes:
[0079] Set the range of hyperparameter values. When the adjusted hyperparameter value exceeds the range, it will be truncated according to the nearest boundary value.
[0080] Although uniform coding can achieve an average byte occupancy among sub-packets, excessively large total byte occupancy may cause transmission problems. Therefore, this invention further proposes a method for automatically controlling the bit rate.
[0081] For deep learning image compression algorithms, in the base loss (D+λR), D is the mean squared error loss, used to ensure image compression quality, and R is the bitrate loss, used to ensure bitrate. These two are balanced by the hyperparameter λ. When λ is larger, image quality improves, but the bitrate also increases, resulting in a larger compressed file size; conversely, when λ is smaller, image quality deteriorates, but the bitrate decreases, resulting in a smaller compressed file size.
[0082] Conventional deep learning-based image compression methods pre-set fixed hyperparameters before training to control the ratio between bitrate (bpp) and image quality metrics such as PSNR, achieving a balance between bitrate and compression quality. However, the automatic bitrate control method proposed in this paper can precisely adjust the bitrate within a specified range directly during training.
[0083] The specific process is as follows:
[0084] 1) Adaptive λ regulator
[0085] Initialization settings: Preset target bitrate range [ , ]
[0086] Delayed triggering: The model is warmed up using a fixed λ for the first 5 epochs of training, and the control is started from the 6th epoch.
[0087] Automatic bitrate control pseudocode:
[0088] initialization:
[0089] Set the bpp limit:
[0090] Set the lower limit of bpp:
[0091] When epoch > 5:
[0092] If max_bpp < :
[0093] λ ← Take the minimum value
[0094]
[0095] Update the loss function λ
[0096] If max_bpp> :
[0097] λ ← Take the minimum value
[0098]
[0099] Update the loss function λ
[0100] Furthermore, boundary protection is set for the hyperparameter λ to prevent gradient explosion, for example: setting λ∈[1e-3,100].
[0101] 2) Dynamic reconstruction of the loss function
[0102] The updated λ is injected into the loss function in real time: Loss = D + λR, and the encoder and entropy model parameters are optimized synchronously through chained differentiation.
[0103] This invention addresses the issue that deep learning-based image compression algorithms cannot precisely control bitrate. It introduces an automatic bitrate control strategy, which automatically adjusts the hyperparameter ratio of the loss function based on the bitrate results on the test set during training, thereby achieving precise control over the final bitrate.
[0104] Model training example:
[0105] The training set consists of a maximum of 8000 images selected from the ImageNet dataset. All models are set with N=192 channels and M=320 channels. Each model is trained using the Adam optimizer (β1=0.9, β2=0.999). The initial learning rate is set to 10. −4 The batch size is set to 16.
[0106] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0107] Reference Figure 4 The diagram illustrates a structural block diagram of a deep learning image compression device for automatically controlling bit rate and uniform coding, provided in an embodiment of the present invention. Specifically, it may include the following modules:
[0108] Image feature input module 401 is used to input images or features into a pre-trained compression model containing a variational autoencoder.
[0109] The compression output module 402 is used to compress and optimize the input image or features by implementing uniform grouping of feature channels and dynamic control of the bit rate, and then output the compressed image or features.
[0110] In an optional embodiment of the present invention, the compression output module includes:
[0111] The feature channel uniform grouping submodule is used to compress the model by uniformly grouping the model channels into equal-width subchannels based on the total number of model channels and the number of sub-packets; each equal-width subchannel contains the same number of feature channels.
[0112] The encoding submodule is used to encode each equal-width subchannel to generate an independent compressed sub-packet.
[0113] In an optional embodiment of the present invention, the apparatus further includes a uniform coding training module, which is used for:
[0114] Calculate the standard deviation of the number of bits between sub-packets and add it as a penalty term to the loss function. Then, automatically correct the sub-packet volume deviation through gradient descent.
[0115] In an optional embodiment of the present invention, the apparatus further includes a dynamic bitrate control training module, which is used for:
[0116] Pre-set the target bitrate range;
[0117] The model is warmed up using fixed hyperparameters during the first preset number of training cycles;
[0118] At the start of the next training cycle after completing the preset number of training cycles, the current bitrate is monitored in real time. When the current bitrate exceeds the target bitrate range, the hyperparameters are automatically adjusted and the updated hyperparameters are injected into the loss function in real time.
[0119] The bitrate is stabilized within the target bitrate range through iterative adjustments.
[0120] In an optional embodiment of the present invention, the expression for the loss function is as follows:
[0121]
[0122] In the above formula, D is the mean squared error loss between the original image and the reconstructed image, which measures the quality of the compressed image; R is the compression bitrate, which is generally measured by the number of bits occupied by a single pixel after bpp compression; std represents the standard deviation operation. , ,..., Represents the individual compression bitrate of 1 to n channels; the hyperparameter λ controls the balance between compression bitrate and image quality.
[0123] In an optional embodiment of the present invention, the dynamic bitrate control training module is further configured to:
[0124] When the current bitrate is detected to be lower than the lower limit of the target bitrate range, the hyperparameters are increased;
[0125] When the current bitrate is detected to be higher than the upper limit of the target bitrate range, decrease the hyperparameters;
[0126] The parameter adjustment range is dynamically calculated based on the bit rate deviation ratio.
[0127] In an optional embodiment of the present invention, the dynamic bitrate control training module is further configured to:
[0128] Set the range of hyperparameter values. When the adjusted hyperparameter value exceeds the range, it will be truncated according to the nearest boundary value.
[0129] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0130] In addition, embodiments of the present invention also provide an electronic device, such as... Figure 5As shown, it includes a processor 501, a communication interface 502, a memory 503, and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.
[0131] Memory 503 is used to store computer programs;
[0132] When the processor 501 executes the program stored in the memory 503, it implements the deep learning image compression method with automatic bit rate control and uniform coding as described in the above embodiments.
[0133] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0134] The communication interface is used for communication between the aforementioned terminal and other devices.
[0135] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0136] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0137] like Figure 6As shown, in another embodiment of the present invention, a computer-readable storage medium 601 is also provided, which stores instructions that, when executed on a computer, cause the computer to perform the deep learning image compression method with automatic bit rate control and uniform coding described in the above embodiments.
[0138] In another embodiment of the present invention, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute the deep learning image compression method with automatic bit rate control and uniform coding described in the above embodiments.
[0139] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0140] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0141] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0142] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.
Claims
1. A deep learning-based image compression method with automatic bit rate control and uniform coding, characterized in that, The method includes: Input images or features into a pre-trained compressed model containing a variational autoencoder; The compression model optimizes the input image or features by implementing uniform grouping of feature channels and dynamic bit rate control, and outputs a compressed image or features, including: The compression model evenly groups the model channels into equal-width sub-channels based on the total number of model channels and the number of sub-packets; each equal-width sub-channel contains the same number of feature channels. Each equal-width sub-channel is encoded to generate an independent compressed sub-packet; Calculate the standard deviation of the number of bits between sub-packets and add it as a penalty term to the loss function. Then, automatically correct the sub-packet volume deviation through gradient descent. Training the dynamic bitrate control of the compression model includes: Pre-set the target bitrate range; The model is warmed up using fixed hyperparameters during the first preset number of training cycles; At the start of the next training cycle after completing the preset number of training cycles, the current bitrate is monitored in real time. When the current bitrate exceeds the target bitrate range, the hyperparameters are automatically adjusted and the updated hyperparameters are injected into the loss function in real time. The bitrate is stabilized within the target bitrate range through iterative adjustments. The expression for the loss function is as follows: In the above formula, D is the mean squared error loss between the original image and the reconstructed image, which measures the quality of the compressed image; R is the compression bitrate, which is generally measured by the number of bits occupied by a single pixel after bpp compression; std represents the standard deviation operation. , ,..., Represents the individual compression bitrate of 1 to n channels; the hyperparameter λ controls the balance between compression bitrate and image quality.
2. The method according to claim 1, characterized in that, The adjustment method for the dynamic bitrate control is as follows: When the current bitrate is detected to be lower than the lower limit of the target bitrate range, the hyperparameters are increased; When the current bitrate is detected to be higher than the upper limit of the target bitrate range, decrease the hyperparameters; The parameter adjustment range is dynamically calculated based on the bit rate deviation ratio.
3. The method according to claim 1, characterized in that, Training for dynamic bitrate control of the compression model also includes: Set the range of hyperparameter values. When the adjusted hyperparameter value exceeds the range, it will be truncated according to the nearest boundary value.
4. A deep learning image compression device for automatically controlling bit rate and uniform coding, characterized in that, The device includes: The image feature input module is used to input images or features into the constructed, trained compression model containing a variational autoencoder; The compression output module is used to compress and optimize the input image or features by implementing uniform grouping of feature channels and dynamic control of the bit rate, and then output the compressed image or features. The compression output module includes: The feature channel uniform grouping submodule is used to compress the model by uniformly grouping the model channels into equal-width subchannels based on the total number of model channels and the number of sub-packets; each equal-width subchannel contains the same number of feature channels. The encoding submodule is used to encode each equal-width subchannel to generate an independent compressed sub-packet; The device further includes a uniform coding training module, which is used for: Calculate the standard deviation of the number of bits between sub-packets and add it as a penalty term to the loss function. Then, automatically correct the sub-packet volume deviation through gradient descent. The device further includes a dynamic bitrate control training module, which is used for: Pre-set the target bitrate range; The model is warmed up using fixed hyperparameters during the first preset number of training cycles; At the start of the next training cycle after completing the preset number of training cycles, the current bitrate is monitored in real time. When the current bitrate exceeds the target bitrate range, the hyperparameters are automatically adjusted and the updated hyperparameters are injected into the loss function in real time. The bitrate is stabilized within the target bitrate range through iterative adjustments. The expression for the loss function is as follows: In the above formula, D is the mean squared error loss between the original image and the reconstructed image, which measures the quality of the compressed image; R is the compression bitrate, which is generally measured by the number of bits occupied by a single pixel after bpp compression; std represents the standard deviation operation. , ,..., Represents the individual compression bitrate of 1 to n channels; the hyperparameter λ controls the balance between compression bitrate and image quality.
5. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes the program stored in the memory, it implements the deep learning image compression method with automatic bit rate control and uniform coding as described in any one of claims 1-3.
6. One or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the deep learning image compression method of automatically controlling bit rate and uniform coding as described in any one of claims 1-3.
Citation Information
Patent Citations
Multichannel video image balanced coding method and device suitable for carrier rocket
CN112565762A
Variable code rate image compression method and system
CN115439567A