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

By applying pre -training large -language models to predict the residual probability distribution in image non -destructive compression, combined with arithmetic coding technology, the problem of insufficient imageless compression performance in the existing technology has been solved, and efficient image compression effects are achieved.

CN119364005AActive Publication Date: 2025-01-24SHANGHAI JIAOTONG UNIV

Patent Information

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

AI Technical Summary

Technical Problem

The prior art has problems with limited compression performance in the field of lossless image compression, especially in the fields of medical imaging, remote sensing, precision engineering and scientific research. It is difficult for existing methods to effectively utilize the similarity between the global semantic information of images and the pixel channels. , resulting in insufficient compression ratio.

Method used

An image lossless compression method based on a pre-trained large language model is used. After lossy compression of the image to be compressed, the large language model is used to predict the probability distribution of the residual, and compression encoding and decoding are performed through arithmetic coding, combining global and local information to Improve forecast accuracy.

Benefits of technology

Based on the self -regression capabilities and arithmetic coding techniques of large language models, efficient non -destructive image compression has been achieved, the compression performance is improved, and the effect of approaching or exceeding the complex entropy coding algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119364005A_ABST
    Figure CN119364005A_ABST
Patent Text Reader

Abstract

The invention discloses an image lossless compression method and system based on a pre-trained large language model, and the method comprises the steps: carrying out the BPG compression of a to-be-compressed image, obtaining a lossy image, and storing the lossy image in a bit stream; obtaining a residual error; with a lossy image as a condition, probability distribution of residual errors is obtained through a large language model; carrying out compression coding on the residual error based on probability distribution, and storing the residual error in a bit stream; during decoding, extracting a lossy image part from the bit stream and carrying out BPG decoding to obtain a lossy image; with a lossy image as a condition, probability distribution of residual errors is obtained through a large language model; decoding and restoring the residual error by utilizing the residual error part in the bit stream and the probability distribution of the residual error; and restoring the image based on the lossy image and the restoration residual error. According to the method, a lossy compression prediction residual distribution framework is combined with a large language model, and end-to-end joint optimization is carried out. And the purpose of efficiently and losslessly compressing the image is achieved by utilizing the strong autoregression capability of the large language model.
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 an image lossless compression method and system based on a pre-trained large language model. Background Art

[0002] With the rapid development of modern imaging technology, the resolution of images and videos continues to increase, and the storage cost increases with it. Therefore, it is particularly important to effectively compress the raw data of these high-resolution images and videos. In some consumer applications, users can accept a certain degree of signal-level compression distortion. However, in fields such as medical imaging, remote sensing, precision engineering, and scientific research, it is crucial to achieve lossless compression of digital images. Shannon's first law provides a theoretical basis for lossless compression, indicating that the true probability distribution of an image is the lower bound of the expected code length. Predictors based on historical values ​​can be effectively converted into compressors, and this concept has been widely used in the encoding of text, images, and audio data. In current lossless compression algorithms, the combination of excellent predictors and arithmetic encoders is a key factor affecting compression performance. By predicting the true distribution of image data as accurately as possible, these algorithms can significantly improve compression efficiency. Therefore, in the design of lossless compression encoders, optimizing the effectiveness of predictors and coding strategies is a core task to improve algorithm performance. Traditional lossless compressors include PNG, WebP, FLIF, JPEG-XL, etc., which are manually designed complex entropy coding algorithms. Despite years of research, their typical compression ratios are still limited to between 2:1 and 3:1. Deep learning-based lossless image compressors such as L3C, RC, and DLPR can achieve better compression performance by optimizing learnable predictors.

[0003] The success of large language models (LLMs) has spawned many new research trends. For large language models, the core task is to predict the next token as accurately as possible, which is inherently consistent with the need for lossless image compression. Recently, DeepMind's research has shown that prediction can be essentially regarded as compression, and large language models have shown excellent performance in the field of text compression (LLMzip). The research also attempts to apply large language models to lossless compression of images and audio, showing its potential in this field. However, DeepMind's method is only trained on text data, does not include any image data, and only processes image pixels as indexes. In terms of text processing, in the Tokenizer constructed by the BPE (Byte Pair Encoding) method, there is no strong correlation between adjacent indexes, and the model has no clear judgment on the relationship between index 128 and 127 or 129. However, for images, there is a strong similarity between similar pixel values, and this prior information is crucial in image processing. At the same time, when processing image data, it only converts it into a grayscale image, fails to effectively utilize the information between pixel channels, and compresses the image by dividing it into image blocks, without utilizing the global semantic information of the image. It lacks in-depth consideration of the meaning of pixel space, and its 7B parameter model shows compression performance that is only slightly better than PNG. This phenomenon fully demonstrates the potential of large language models in image compression tasks, but also points out that performance improvement after special training for specific image compression tasks is still in urgent need of exploration. At present, image lossless compression faces great challenges to further improve performance, and existing methods such as DLPR have built sufficiently complex entropy models. It is worth noting that the migration ability of large language models and their powerful context understanding ability can achieve SOTA (state-of-the-art) levels in multiple computer vision tasks through simple fine-tuning. Therefore, it is of great significance to study whether large language models can obtain the ability to approach current complex schemes in the field of image lossless compression through simple fine-tuning, which is of great significance for breaking the limits of image compression performance. Summary of the invention

[0004] In view of the defects in the prior art, the object 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, there is provided a method for lossless compression of an image based on a pre-trained large language model, comprising:

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

[0007] Reconstruct x based on the lossy image 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 in 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 p(r|x l );

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

[0013] Preferably, 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.

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

[0015] Obtain the global information and local information of the lossy image x1 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 used to predict the parameters of the Gaussian mixture model through a linear layer to obtain a probability distribution of residual values.

[0018] Preferably, the step of obtaining global information and local information of the lossy image x1 as prompt words includes:

[0019] Extracting global information from the image block of the lossy image x1 through a convolutional neural network;

[0020] Extracting local information from the lossy image x1 through an embedding layer; 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 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:

[0023] The residual r is passed through the embedding layer to extract the embedded feature z; the lossy image x1 contains a total of J pixels, and the embedded feature corresponding to the jth residual value is expressed 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 predicting of Gaussian mixture model parameters of the latent features through a linear layer to obtain a probability distribution of residual values ​​includes:

[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 the 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 expectation 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] Coding module: For the image to be compressed x, x is losslessly compressed through BPG to obtain the lossy image reconstruction x l , save it to the bit stream; reconstruct x based on the lossy image 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, the corresponding latent 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: extract the lossy image part from the bit stream and use BPG decoding to get 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. <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 transform f j Mapped to the parameters of the Gaussian mixture model, the model is obtained j The probability distribution p(r j |x l ), with the help of the 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 jRepeat the above process until all residual values ​​are decoded and the lossy image reconstruction 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, there is provided a terminal, 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 image lossless compression method and system based on the pre-trained large language model in the embodiment of the present invention combines the framework of lossy compression prediction residual distribution with the large language model and performs end-to-end joint optimization. The powerful autoregressive ability of the large language model is utilized to achieve the purpose of efficient lossless image compression. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] Figure 2 The figure is a schematic diagram of 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 is described in detail below in conjunction with 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 of ordinary skill in the art, several variations and improvements may be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.

[0045] The present invention obtains lossy reconstruction after BPG compression of the image and compresses and encodes the residual; uses the lossy image reconstruction as a prompt of the large language model, introduces global prompts and local prompts to improve the prediction accuracy of the large language model for the residual distribution; and introduces a Gaussian mixture model to model the distribution of the residual.

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

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

[0048] Step 2: Reconstruct x based on the lossy image 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 an arithmetic encoder, based on the residual r from step 2 and the probability distribution p(r|x l ), compress and encode the residual r, and save the encoded compression result into the bit stream;

[0051] Step 5: During decoding, the lossy image part is extracted from the bit stream and the lossy image x is obtained by decoding with BPG. l ;

[0052] Step 6: Take the lossy image x obtained in step 5 l As a condition, the probability distribution 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 restores 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 the large language model and performs end-to-end joint optimization. The powerful autoregressive capability of the large language model is utilized to achieve the purpose of efficient lossless image compression.

[0056] In a preferred embodiment of the present invention, the image x to be compressed is divided into several image blocks for compression, and the compression process of each image block is independent and parallel. The image is divided into several image blocks for compression, and each image block is compressed at the same time, which 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, and the specific process is as follows:

[0058] S100, obtaining global information and local information of the lossy image x1 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 latent features are used to predict the Gaussian mixture model parameters through a linear layer to obtain the residual value probability distribution.

[0061] The primary goal of a large language model is to accurately predict the next word. More advanced large language models have more accurate data distribution modeling. Similarly, lossless compression seeks more accurate data distribution to minimize the encoding bit rate. Therefore, a large language model can be used 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 in the figure, the complete image x1 is used to extract global information through a convolutional neural network, and the lossy image block is used to extract local information through an embedding layer. At the same time, the residual r is passed through an embedding layer to extract embedded information. Then, the local information and the global information are combined to obtain the prompt word of the large prediction model.

[0063] Based on the large prediction model hint words and residual embedding information, in a preferred embodiment, a preferred solution for calculating the potential features of the residual r is provided, 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, it is not necessary to use the Gaussian mixture model. In some other embodiments, other models can be used instead, such as the Laplace model, or the probability distribution can be directly output without modeling. Compared with directly outputting the probability distribution, the use of the Gaussian mixture model can bring prior information about the pixel and enhance the correlation between adjacent pixel values. Compared with other models, the Gaussian mixture model is the most common model and has generality.

[0070] In order to ensure the compression effect, in a preferred embodiment of the present invention, a bit rate estimation function is used as a 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, including:

[0074] Coding module: for the image to be compressed x, perform lossy compression on x through BPG to obtain lossy image reconstruction x1, and save it in the bitstream; based on the lossy image reconstruction x1, obtain the residual r = x-x1; with the lossy image x1 as a condition, extract the global embedding and local embedding through the global embedding module and the local embedding layer; extract the residual embedding of the residual r through the residual embedding layer; take the global embedding, local embedding and residual embedding as input, obtain the corresponding potential feature f of the residual r through the large language model, and map f to the parameter w of the Gaussian mixture model through the linear layer k , μ k , Finally, the probability distribution p(r|x1) of the modeled residual r is obtained. With the help of an arithmetic encoder, given r and p(r|x1), the residual r can be compressed and encoded and saved in the bitstream.

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

[0076] The modules / units in the above examples of the present invention may specifically refer to the implementation techniques of 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, including 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 above-mentioned method or to run the above-mentioned system when executing the program.

[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 method), 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 used to execute the computer program stored in the memory to implement the various steps in the method involved in the above embodiment. For details, please refer to the relevant description in the above method embodiment.

[0080] The processor and the memory may be independent structures or integrated structures. When the processor and the memory are independent structures, the memory and the processor may be coupled and connected 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] Among them, computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of computer programs from one place to another. The storage medium can be any available medium that can be accessed by a general or special-purpose computer. An exemplary storage medium is coupled to the 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 the storage medium can be located in an ASIC. In addition, the ASIC can be located in a user device. Of course, the processor and the storage medium can also be present in a communication device as discrete components.

[0083] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, 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 disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0084] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, 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 flowchart and / or block diagram. 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 capable of directing a computer or other programmable data processing device to operate 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 A 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 operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

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

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 lossily compressed by the lossy compressor BPG to obtain the lossy image x l , save it to the bitstream; Reconstruct x based on the lossy image 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 in 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 p(r|x l ); With the help of the arithmetic coding decoder, the residual part of the bit stream and the probability distribution of r p(r|x l ) Decoding and restoring the residual based on the decoded lossy image x l The residual r obtained by the restoration is restored to the image x=x l +r.

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 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 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 used to predict the parameters of the Gaussian mixture model through a linear layer to obtain a probability distribution of residual values.

4. The image lossless compression method based on a pre-trained large language model according to claim 3, characterized in that: The lossy image x is obtained l The global information and local information of the are used as prompt words, including: The lossy image x is processed by a convolutional neural network l Extract global information from image blocks; Through the embedding layer, the lossy image x 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 features and the local features are combined to form prompt words based on a pre-trained large language model.

5. The image lossless compression method based on a pre-trained large language model according to claim 3, characterized in that: The method of outputting the potential features of the residual r based on the prompt word and the pre-trained large language model in an autoregressive manner includes: The residual r is passed through the embedding layer to extract the embedded feature z; the lossy image x1 contains a total of J pixels, and the embedded feature corresponding to the jth residual value is expressed 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.

6. The image lossless compression method based on a pre-trained large language model according to claim 3, 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:

7. The image lossless compression method based on a pre-trained large language model according to claim 3, characterized in that: The entire image lossless compression model uses the bit rate estimation function as the loss function, which is derived from the cross entropy, specifically: ck(·) is composed of the mean μk and the 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.

8. An image lossless compression system based on a pre-trained large language model, characterized in that: include: Coding module: for the image x to be compressed, x is lossily compressed through BPG to obtain a lossy image reconstruction x1, which is saved in the bitstream; based on the lossy image reconstruction x1, a residual r=x-x1 is obtained; with the lossy image x1 as a condition, the probability distribution p(r|x1) of the residual r is obtained through the model, and with the help of an arithmetic encoder, given r and p(r|x1), the residual r can be compressed and encoded and saved in the bitstream; Decoding module: extract the lossy image part from the bitstream, use BPG decoding to get the lossy image x1, and use the lossy image x1 as a condition to get the probability distribution p(r|x1) of r through the probability estimation model. With the help of the arithmetic coding decoder, use the residual part in the bitstream and the probability distribution p(r|x1) of r to decode and restore the residual r; get the lossy image reconstruction x1 and the residual r, and restore the image x=x l +r.

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

10. 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 execute the method described in any one of claims 1 to 7, or to run the system described in claim 8.

Citation Information

Patent Citations

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

    CN114359422A

  • Image coding method, image decompression method and device

    CN115022637A

  • Multi-modal scene risk judgment method based on generative AI large language model

    CN118094331A

  • A composition for the prevention, improvement, or treatment of skeletal muscle atrophy or sarcopenia, containing Stellaria dichotoma Linne var. lanceolata Bunge extract or compounds isolated therefrom

    KR1020240175734A

  • Entropy Coding Method For Coding Video Prediction Residual Coefficients

    US20070200737A1

Cited By

  • A lossless image transcoding method and system based on large language model ranking coding

    CN122871006A