Image lossless compression method and system based on pre-trained large language model

By performing lossy compression on the image, predicting the residual distribution using a pre-trained large language model, and combining it with arithmetic coding, the problem of limited performance in lossless image compression in existing technologies is solved, and efficient lossless image compression is achieved.

CN119364005BActive Publication Date: 2025-10-21SHANGHAI JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411398599.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-10-21
Estimated Expiration
2044-10-09

AI Technical Summary

Technical Problem

Existing lossless image compression methods fail to fully utilize the potential of large language models, especially when dealing with the correlation of image pixels and global semantic information, resulting in limited compression performance.

Method used

After the image to be compressed is processed by the lossy compressor BPG, the probability distribution of the residual is predicted by a pre-trained large language model, and then compressed and decoded by an arithmetic encoder. Global and local information cues are used to improve the prediction accuracy, and a Gaussian mixture model is used to model the residual distribution.

Benefits of technology

It achieves efficient lossless image compression, improves compression performance, and approaches or surpasses existing complex lossless compression algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119364005B_ABST
    Figure CN119364005B_ABST
Patent Text Reader

Abstract

The application discloses an image lossless compression method and system based on a pre-trained large language model, which comprises the following steps: obtaining a lossy image by compressing a to-be-compressed image through BPG compression and saving the lossy image into a bitstream; obtaining a residual error; obtaining a probability distribution of the residual error through a large language model under the condition of the lossy image; compressing and encoding the residual error based on the probability distribution and saving the residual error into the bitstream; when decoding, extracting a lossy image part from the bitstream and performing BPG decoding to obtain the lossy image; obtaining the probability distribution of the residual error through the large language model under the condition of the lossy image; decoding and restoring the residual error by using the residual error part in the bitstream and the probability distribution of the residual error; and restoring the image based on the lossy image and the restored residual error. The application combines the framework of lossy compression residual error distribution with the large language model and performs end-to-end joint optimization. By using the strong self-recurrence capability of the large language model, the purpose of efficiently compressing an image is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image lossless compression, and in particular to a method and system for image lossless compression based on a pre-trained large language model. Background Art

[0002] With the rapid advancement of modern imaging technology, the resolution of images and videos continues to increase, accompanied by an increase in storage costs. Therefore, effectively compressing the raw data of these high-resolution images and videos is extremely important. In some consumer applications, users may accept a certain degree of signal-level compression distortion. However, in fields such as medical imaging, remote sensing, precision engineering, and scientific research, achieving lossless compression of digital images is crucial. Shannon's first law provides the theoretical foundation for lossless compression, stating that the true probability distribution of an image is a lower bound on the expected code length. A predictor based on historical values ​​can be effectively converted into a compressor, a concept widely used in encoding text, images, and audio data. In current lossless compression algorithms, the combination of an excellent predictor and an arithmetic encoder is a key factor affecting compression performance. By accurately predicting the true distribution of image data, these algorithms can significantly improve compression efficiency. Therefore, in the design of lossless compression encoders, optimizing the effectiveness of the predictor and coding strategy is a key task in improving algorithm performance. Traditional lossless compressors, such as PNG, WebP, FLIF, and JPEG-XL, rely on complex, manually designed entropy coding algorithms. Despite years of research, their typical compression ratios remain limited to between 2:1 and 3:1. Deep learning-based lossless image compressors, such as L3C, RC, and DLPR, achieve even better compression performance by optimizing learnable predictors.

[0003] The success of large language models (LLMs) has spurred numerous new research trends. The core task of large language models is to predict the next token as accurately as possible, a goal inherently consistent with the need for lossless image compression. Recent research from DeepMind demonstrates that prediction can be essentially considered compression, and that large language models demonstrate excellent performance in text compression (LLMzip). This research also attempts to apply large language models to lossless image and audio compression, demonstrating their potential in this area. However, DeepMind's approach is trained solely on text data, without any image data, and its processing of image pixels is limited to using them as indices. In text processing, the tokenizer constructed using the Byte Pair Encoding (BPE) method does not exhibit strong correlation between adjacent indices; the model does not clearly determine the relationship between indices 128, 127, or 129. However, for images, similar pixel values ​​exhibit strong similarity, and this prior information is crucial in image processing. Furthermore, it only converts image data into grayscale when processing it, failing to effectively utilize information between pixel channels. Furthermore, it compresses images by dividing them into blocks, failing to leverage global semantic information and lacking a deep understanding of the spatial significance of pixels. Consequently, its 7-parameter model exhibits compression performance only slightly better than PNG. This phenomenon demonstrates the potential of large language models in image compression tasks, but also points out that performance improvements after specialized training for specific image compression tasks are still urgently needed. Currently, further improving the performance of lossless image compression faces significant challenges, and existing methods such as DLPR have already constructed sufficiently complex entropy models. Notably, the transferability and powerful contextual understanding capabilities of large language models can achieve state-of-the-art performance in multiple computer vision tasks with simple fine-tuning. Therefore, investigating whether large language models can achieve performance similar to current complex approaches in lossless image compression with simple fine-tuning is crucial for pushing the boundaries of image compression performance. Summary of the Invention

[0004] In view of the defects in the prior art, the purpose of the present invention is to provide a method and system for lossless image compression based on a pre-trained large language model.

[0005] According to a first aspect of the present invention, a method for lossless image compression based on a pre-trained large language model is provided, comprising:

[0006] The image to be compressed x is losslessly compressed using the lossy compressor BPG to obtain the lossy image x l , save it to the bitstream;

[0007] Based on the lossy image x l , and obtain the residual r = xx l ;

[0008] Take the lossy image x l As a condition, the probability distribution p(r|x l );

[0009] With the help of an arithmetic encoder, based on the residual r and the probability distribution p(r|x l ), compress and encode the residual r and save it into a bit stream;

[0010] During decoding, the lossy image part is extracted from the bit stream and the lossy image x is obtained by BPG decoding. l ;

[0011] To obtain the lossy image x l As a condition, the probability distribution of r p(r|x l );

[0012] With the help of the arithmetic coding decoder, the probability distribution p(r|x l ) Decoding and restoring the residual error based on the decoded lossy image x l and the residual r obtained by restoration, and the image x=x l +r.

[0013] Preferably, the image to be compressed is divided into several image blocks for compression, and the compression process of each image block is independent and parallel.

[0014] Preferably, the lossy image x l As a condition, the probability distribution p(r|x l ),include:

[0015] Get the lossy image x l The global information and local information of the retrieval system are used as prompt words;

[0016] Based on the prompt word, autoregressively output the potential features of the residual r based on the pre-trained large language model;

[0017] The potential features are passed through a linear layer to predict the parameters of the Gaussian mixture model to obtain a probability distribution of residual values.

[0018] Preferably, the acquisition of the lossy image x l The global information and local information of the cipher are used as prompt words, including:

[0019] The lossy image x is processed by a convolutional neural network l Extract global information from image blocks;

[0020] The lossy image x is embedded in the l Extracting local information; the embedding layer maps discrete high-dimensional data to a continuous low-dimensional vector space to capture the potential relationship of the original data;

[0021] The global features and the local features are combined to form prompt words based on a pre-trained large language model.

[0022] Preferably, the step of autoregressively outputting the potential features of the residual r based on the prompt word and the pre-trained large language model comprises:

[0023] The residual r is passed through the embedding layer to extract the embedded feature z; the lossy image x l There are J pixels in total, and the embedded feature corresponding to the j-th residual value is represented as z j .

[0024] Predict the potential feature f corresponding to the residual value at position j j , the embedded feature z of the residual value of the previous j-1 positions is used as the conditional input, specifically:

[0025] f j =F(z prompt ,z0,…,z j-1 )

[0026] F(·) is a calculation function based on the pre-trained large language model.

[0027] Preferably, the step of predicting Gaussian mixture model parameters using a linear layer to obtain a probability distribution of residual values ​​comprises:

[0028] Use Gaussian mixture model to model the residual distribution probability model;

[0029] The potential features are input into the residual distribution probability model, and the parameters w of k Gaussian models are output. k , μ k ,

[0030] Based on the parameters of the k Gaussian models, the probability distribution of the residual value is obtained:

[0031]

[0032] Preferably, the entire image lossless compression model uses a bit rate estimation function as a loss function, and the loss function is derived from cross entropy, specifically:

[0033]

[0034] c k (·) is the mean μ k and variance The cumulative distribution function of the Gaussian function is defined as p(r), p(r) is the predicted distribution, is the true distribution. H(·) represents the cross entropy calculation formula, E represents the expected formula, r j Represents the residual value at position j.

[0035] According to a second aspect of the present invention, there is provided an image lossless compression system based on a pre-trained large language model, comprising:

[0036] Encoding module: For the image to be compressed x, x is lossily compressed using BPG to obtain the lossy image x l , save it to the bit stream; based on the lossy image x l , and obtain the residual r = xx l ; Take the lossy image x l As a condition, the global embedding module and the local embedding layer are used to extract the global embedding and the local embedding; the residual r is passed through the residual embedding layer to extract the residual embedding; the global embedding, the local embedding and the residual embedding are used as input, and the corresponding potential feature f of the residual r is obtained through the large language model, and f is mapped to the parameter w of the Gaussian mixture model through the linear layer. k , μ k , The probability distribution of the final modeling residual r is p(r|x l ), with the help of arithmetic encoder, given r and p(r|x l ), the residual r can be compressed and encoded and saved in the bit stream;

[0037] Decoding module: extracts the lossy image part from the bit stream and uses BPG decoding to obtain the lossy image x l , the same lossy image x l As a condition, the global embedding module and the local embedding layer are used to extract the global embedding and the local embedding; the decoded residual r <j The residual embedding is extracted through the residual embedding layer; the residual embedding corresponding to the global embedding, local embedding, and decoded residual value is used as input, and the residual value r is obtained through the large language model. j The corresponding latent feature f j , through the linear layer to f j Mapped to the parameters of the Gaussian mixture model, the model is obtained r j The probability distribution p(r j |x l ), with the help of arithmetic coding decoder, using the residual part of the bit stream and r j The probability distribution p(r j|x l ) Decoding restores the residual r j Repeat the above process until all residual values ​​are decoded and the lossy image x is obtained l And the residual r can be restored to the image x = x l +r.

[0038] According to a third aspect of the present invention, a terminal is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor can be used to execute the method described, or to run the system described, when executing the program.

[0039] According to a fourth aspect of the present invention, there is provided a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can be used to execute the method described, or to run the system described.

[0040] Compared with the prior art, the embodiments of the present invention have at least one of the following beneficial effects:

[0041] The lossless image compression method and system based on a pretrained large language model in this embodiment combines the framework for lossy compression prediction residual distribution with the large language model and performs end-to-end joint optimization. Leveraging the powerful autoregressive capabilities of the large language model, this method achieves efficient lossless image compression. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 Schematic diagram of a flow chart of a method for lossless image compression based on a pre-trained large language model according to an embodiment of the present invention;

[0043] Figure 2 The figure is a flow chart of estimating residual distribution probability based on a large language model according to a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0044] The present invention will be described in detail below with reference to specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several variations and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.

[0045] The present invention compresses an image through BPG compression to obtain a lossy reconstruction, and compresses and encodes the residual. The lossy image is used as a prompt for a large language model, and global and local prompts are introduced to improve the large language model's prediction accuracy for the residual distribution. A Gaussian mixture model is introduced to model the distribution of the residual.

[0046] Based on the above basic concept, in one embodiment of the present invention, a method for image lossless compression based on a pre-trained large language model is provided. Figure 1 , the main steps are as follows:

[0047] Step 1: For the image to be compressed x, perform lossy compression on x using BPG to obtain the lossy image x. l , save it to the bitstream;

[0048] Step 2, based on the lossy image x in step 1 l , and obtain the residual r = xx l ;

[0049] Step 3: Take the lossy image x obtained in step 1 l As a condition, the probability distribution p(r|x l );

[0050] Step 4: With the help of arithmetic encoder, based on the residual r of step 2 and the probability distribution p(r|x l ), compress and encode the residual r, and save the encoded compression result to the bit stream;

[0051] Step 5: During decoding, extract the lossy image part from the bitstream and use BPG decoding to obtain the lossy image x l ;

[0052] Step 6: Take the lossy image x obtained in step 5 l As a condition, the probability distribution of r p(r|x l );

[0053] Step 7: With the help of the arithmetic coding decoder, the residual part stored in the bit stream is used to encode the compression result and the probability distribution p(r|x l ) Decoding and restoring the residual r;

[0054] Step 8, based on the lossy image x in step 5 l And the residual r obtained in step 7 is restored to the image x = x l +r.

[0055] The above embodiment combines the framework of lossy compression prediction residual distribution with a large language model and performs end-to-end joint optimization. Leveraging the powerful autoregressive capabilities of the large language model, the goal of efficient lossless image compression is achieved.

[0056] In a preferred embodiment of the present invention, the image to be compressed, x, is divided into several image blocks for compression. The compression process for each image block is independent and parallel. Dividing the image into several image blocks for compression, and compressing each image block simultaneously, effectively reduces the total compression time.

[0057] In order to obtain a more accurate residual probability distribution, in a preferred embodiment of the present invention, a pre-trained large language model is used to estimate the probability distribution of the residual r. The specific process is as follows:

[0058] S100, obtain lossy image x l The global information and local information of the retrieval system are used as prompt words;

[0059] S200, based on S200, obtains the prompt word and autoregressively outputs the potential features of the residual r based on the pre-trained large language model;

[0060] S300, the S00 potential features are used to predict the Gaussian mixture model parameters through a linear layer to obtain the probability distribution of the residual value.

[0061] The primary goal of a large language model is to accurately predict the next word. More advanced large language models more accurately model the data distribution. Similarly, lossless compression seeks a more accurate data distribution to minimize the encoding bitrate. Therefore, a large language model can serve as a powerful entropy coding tool to estimate the probability distribution of the residual r.

[0062] In a preferred embodiment, a preferred solution for accurately obtaining global information and local information is provided. Figure 2 As shown, for the complete image x l A convolutional neural network is used to extract global information, while an embedding layer is used to extract local information from lossy image patches. Simultaneously, the residual r is passed through an embedding layer to extract embedded information. The local and global information are then combined to produce the cue word for the large prediction model.

[0063] Based on the information of the large prediction model hint words and residual embedding, a preferred embodiment provides a preferred solution for calculating the potential features of the residual r, specifically: predicting the potential feature f at position j j Then the embedded feature z of the residual value of the first j-1 positions is required as the conditional input, and its formula can be expressed as:

[0064] f j =F(z prompt ,z0,…,z j-1 )

[0065] F(·) is the calculation function of the large language model.

[0066] Using the above expression to calculate the latent features can make full use of the prompt words to guide the large language model to make accurate predictions. At the same time, as the autoregressive process proceeds, the amount of available information gradually increases, which can lead to more accurate data distribution modeling. The parameters w of the Gaussian mixture model are obtained through linear layer mapping k , μ k ,

[0067] In another preferred embodiment, the residual distribution is modeled using a Gaussian mixture model, and the probability prediction model outputs k parameters w of the Gaussian model. k , μ k , The probability of the residual value can be expressed as follows:

[0068]

[0069] Of course, the Gaussian mixture model is not mandatory. In some other embodiments, other models, such as the Laplace model, can be used instead, or a probability distribution can be directly output without applying model modeling. Compared to directly outputting a probability distribution, the use of the Gaussian mixture model can provide prior information about the pixel and enhance the correlation between adjacent pixel values. Compared to other models, the Gaussian mixture model is the most common model and has general applicability.

[0070] In order to ensure the compression effect, in a preferred embodiment of the present invention, a rate estimation function is used as the loss function, which is derived from the cross entropy:

[0071]

[0072] c k (·) is the mean μ k and variance The cumulative distribution function of the Gaussian function is defined as p(r). p(r) is the predicted distribution, is the true distribution.

[0073] Based on the same inventive concept, another embodiment of the present invention provides an image lossless compression system based on a pre-trained large language model, comprising:

[0074] Encoding module: For the image to be compressed x, x is lossily compressed using BPG to obtain the lossy image x l , save it to the bit stream; based on the lossy image x l , and obtain the residual r = xx l ; Take the lossy image x lAs a condition, the global embedding module and the local embedding layer are used to extract the global embedding and the local embedding; the residual r is passed through the residual embedding layer to extract the residual embedding; the global embedding, the local embedding and the residual embedding are used as input, and the corresponding potential feature f of the residual r is obtained through the large language model, and f is mapped to the parameter w of the Gaussian mixture model through the linear layer. k , μ k , The probability distribution of the final modeling residual r is p(r|x l ), with the help of arithmetic encoder, given r and p(r|x l ), the residual r can be compressed and encoded and saved in the bit stream;

[0075] Decoding module: extracts the lossy image part from the bit stream and uses BPG decoding to obtain the lossy image x l , the same lossy image x l As a condition, the global embedding module and the local embedding layer are used to extract the global embedding and the local embedding; the decoded residual r <j The residual embedding is extracted through the residual embedding layer; the residual embedding corresponding to the global embedding, local embedding, and decoded residual value is used as input, and the residual value r is obtained through the large language model. j The corresponding latent feature f j , through the linear layer to f j Mapped to the parameters of the Gaussian mixture model, the model is obtained r j The probability distribution p(r j |x l ), with the help of arithmetic coding decoder, using the residual part of the bit stream and r j The probability distribution p(r j |x l ) Decoding restores the residual r j Repeat the above process until all residual values ​​are decoded and the lossy image x is obtained l And the residual r can be restored to the image x = x l +r.

[0076] The specific implementation techniques of the modules / units in the above examples of the present invention may refer to the corresponding steps of the image lossless compression method based on the pre-trained large language model in the above embodiments, which will not be repeated here.

[0077] Based on the same inventive concept, in other embodiments of the present invention, a terminal is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the terminal can be used to execute the above-mentioned method, or to run the above-mentioned system.

[0078] Optionally, the memory is used to store programs; the memory may include volatile memory (English: volatile memory), such as random-access memory (English: random-access memory, abbreviated: RAM), such as static random-access memory (English: static random-access memory, abbreviated: SRAM), double data rate synchronous dynamic random access memory (English: Double Data Rate Synchronous Dynamic Random Access Memory, abbreviated: DDR SDRAM), etc.; the memory may also include non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory). The memory is used to store computer programs (such as applications, functional modules, etc. that implement the above-mentioned methods), computer instructions, etc., and the above-mentioned computer programs, computer instructions, etc. can be partitioned and stored in one or more memories.

[0079] The processor is configured to execute the computer program stored in the memory to implement the various steps of the method involved in the above embodiment. For details, please refer to the relevant description in the above method embodiment.

[0080] The processor and memory can be independent structures or integrated structures. When the processor and memory are independent structures, the memory and processor can be coupled via a bus.

[0081] Based on the same inventive concept, in other embodiments of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, it can be used to execute the above method or run the above system.

[0082] Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of computer programs from one location to another. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium can be located in an ASIC. Alternatively, the ASIC can be located in a user device. Of course, the processor and storage medium can also exist as discrete components in a communication device.

[0083] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0084] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, apparatus (system), and computer program products according to the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0085] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0086] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0087] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A method for lossless image compression based on a pre-trained large language model, characterized in that: include: The image to be compressed x is losslessly compressed using the lossy compressor BPG to obtain the lossy image x l , save it to the bitstream; Based on the lossy image x l , and obtain the residual r = xx l ; Take the lossy image x l As a condition, the probability distribution p(r|x l ); With the help of an arithmetic encoder, based on the residual r and the probability distribution p(r|x l ), compress and encode the residual r and save it into a bit stream; During decoding, the lossy image part is extracted from the bit stream and the lossy image x is obtained by BPG decoding. l ; To obtain the lossy image x l As a condition, the probability distribution of r p(r|x l ); With the help of the arithmetic coding decoder, the probability distribution p(r|x l ) Decoding and restoring the residual error based on the decoded lossy image x l and the residual r obtained by restoration, and the image x=x l +r; The lossy image x l As a condition, the probability distribution p(r|x l ),include: Get the lossy image x l The global information and local information of the retrieval system are used as prompt words; Based on the prompt word, autoregressively output the potential features of the residual r based on the pre-trained large language model; The potential features are passed through a linear layer to predict the parameters of the Gaussian mixture model to obtain a probability distribution of residual values.

2. The image lossless compression method based on a pre-trained large language model according to claim 1, characterized in that: The image to be compressed is divided into a number of image blocks for compression, and the compression process of each image block is independent and parallel.

3. The image lossless compression method based on a pre-trained large language model according to claim 1, characterized in that: The lossy image x is obtained l The global information and local information of the cipher are used as prompt words, including: The lossy image x is processed by a convolutional neural network l Extract global information from image blocks; The lossy image x is embedded in the l Extracting local information; the embedding layer maps discrete high-dimensional data to a continuous low-dimensional vector space to capture the potential relationship of the original data; The global information and the local information are combined to form prompt words based on a pre-trained large language model.

4. The image lossless compression method based on a pre-trained large language model according to claim 1, characterized in that: The method of outputting the potential features of the residual r based on the prompt word and autoregressively based on the pre-trained large language model includes: The residual r is passed through the embedding layer to extract the embedded feature z; the lossy image x l There are J pixels in total, and the embedded feature corresponding to the j-th residual value is represented as z j ; Predict the potential feature f corresponding to the residual value at position j j , the embedded feature z of the residual value of the previous j-1 positions is used as the conditional input, specifically: f j =F(z prompt ,z0,…,z j-1 ) F(·) is a calculation function based on the pre-trained large language model.

5. The image lossless compression method based on a pre-trained large language model according to claim 1, characterized in that: The method of predicting the parameters of the Gaussian mixture model using the potential features through a linear layer to obtain a probability distribution of the residual value includes: Use Gaussian mixture model to model the residual distribution probability model; The potential features are input into the residual distribution probability model, and the parameters w of k Gaussian models are output. k , μ k , Based on the parameters of the k Gaussian models, the probability distribution of the residual value is obtained:

6. The image lossless compression method based on a pre-trained large language model according to claim 1, characterized in that: The entire image lossless compression model uses a rate estimation function as the loss function, which is derived from the cross entropy, specifically: c k (·) is the mean μ k and variance The cumulative distribution function of the Gaussian function is defined as p(r), p(r) is the predicted distribution, is the true distribution; H(·) represents the cross entropy calculation formula, E represents the expected formula, r j Represents the residual value at position j.

7. An image lossless compression system based on a pre-trained large language model, characterized in that: include: Encoding module: For the image to be compressed x, x is lossily compressed using BPG to obtain the lossy image x l , save it to the bit stream; based on the lossy image x l , and obtain the residual r = xx l ; Take the lossy image x l As a condition, the probability distribution p(r|x l ), with the help of arithmetic encoder, given r and p(r|x l ), the residual r can be compressed and encoded and saved in the bit stream; Decoding module: extracts the lossy image part from the bit stream and uses BPG decoding to obtain the lossy image x l , the same lossy image x l As a condition, the probability distribution of r is obtained through the probability estimation model p(r|x l ), with the help of the decoder of arithmetic coding, the residual part of the bit stream and the probability distribution of r p(r|x l ) Decode and restore the residual r; get the lossy image x l And the residual r can be restored to the image x = x l +r; The lossy image x l As a condition, the probability distribution p(r|x l ),include: Get the lossy image x l The global information and local information of the retrieval system are used as prompt words; Based on the prompt word, autoregressively output the potential features of the residual r based on the pre-trained large language model; The potential features are passed through a linear layer to predict the parameters of the Gaussian mixture model to obtain a probability distribution of residual values.

8. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it can be used to perform the method according to any one of claims 1 to 6, or run the system according to claim 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it can be used to perform the method according to any one of claims 1 to 6, or to run the system according to claim 7.

Citation Information

Patent Citations

  • Image lossless / near lossless compression method based on deep learning

    CN114359422A

  • Image coding method, image decompression method and device

    CN115022637A