Medical image lossless compression method and system based on transform coding and deep learning

By combining transform coding and deep learning, DCT transform and autoregressive probability modeling are performed on medical images, which solves the problem of insufficient lossless compression rate of medical images and achieves efficient lossless compression effect.

CN119653110BActive Publication Date: 2025-09-19HUNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411852910.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-09-19
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

Existing technologies make it difficult to achieve efficient lossless compression of medical images, especially medical images of different modalities, and general encoders cannot be effectively migrated to medical images, resulting in insufficient compression rate.

Method used

A method based on transform coding and deep learning is used to perform DCT transform and quantization on medical images, decomposing them into DC coefficients and AC coefficients. The AC coefficients are further decomposed into structural layers and texture layers. Convolutional neural networks are used for autoregressive probability density modeling, combined with an entropy arithmetic encoder for lossless encoding and decoding.

Benefits of technology

A significant improvement in lossless compression rate is achieved, especially on 2D grayscale medical images of X-Ray and ultrasound modalities, ensuring no information loss, and with fewer neural network parameters and encoding and decoding time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119653110B_ABST
    Figure CN119653110B_ABST
Patent Text Reader

Abstract

The present invention discloses a medical image lossless compression method and system based on transform coding and deep learning. The method includes the following steps: performing a DCT transform and round quantization on an input 2D medical image to split it into DC coefficients and AC coefficients; compressing the loss R caused by the DC coefficients and round quantization; decomposing the AC coefficients into structure layer MSBs and texture layer LSBs; decomposing the texture layer LSBs into multiple sub-coefficient blocks; constructing a deep probability estimation model based on a convolutional neural network, performing group-based autoregressive probability density modeling, inputting multiple sub-coefficient blocks, and outputting a probability distribution matrix for each sub-coefficient block; and performing lossless encoding and decoding on each sub-coefficient block by combining an entropy arithmetic encoder and the probability distribution matrix. The present invention has the advantages of high compression efficiency and lossless compression.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention mainly relates to the field of image compression technology, and specifically to a medical image lossless compression method and system based on transform coding and deep learning. Background Art

[0002] Medical images are widely used in clinical diagnosis and are usually multimodal, high-resolution, and have large data volumes. The storage space and transmission bandwidth required are both very high. In addition, their importance in clinical treatment and telemedicine requires lossless compression.

[0003] Since the emergence of end-to-end learning compressors based on VAEs, deep learning-based lossy and lossless compression technologies have developed rapidly, achieving compression performance comparable to or exceeding that of state-of-the-art classical methods. During the implementation of this invention, the applicants of this patent discovered that the existing methods have at least the following technical problems:

[0004] Lossy compression can achieve compression ratios up to 50 times, while practical lossless image codecs typically achieve ratios between 2:1 and 3:1. Limited by the Shannon source coding theorem, further improving the lossless compression ratio for medical images is extremely challenging. Most learning-based lossless compressors are general-purpose encoders designed for natural images and cannot be effectively transferred to specialized image types such as medical images. Furthermore, due to the varying imaging characteristics of different modalities, medical images have different characteristics, making the design of a universal compressor difficult. Therefore, modality-specific medical image compressors are needed. Summary of the Invention

[0005] In response to the technical problems existing in the prior art, the present invention provides a medical image lossless compression method and system based on transform coding and deep learning with high compression efficiency.

[0006] In order to solve the above technical problems, the technical solution proposed by the present invention is:

[0007] A medical image lossless compression method based on transform coding and deep learning, comprising the steps of:

[0008] Step 1: Perform DCT transformation and Round quantization on the input 2D medical image to split it into DC coefficients and AC coefficients;

[0009] Step 2: compress the DC coefficient and the loss R caused by Round quantization;

[0010] Step 3, decompose the AC coefficient into structure layer MSB and texture layer LSB;

[0011] Step 4, decompose the texture layer LSB into multiple sub-coefficient blocks;

[0012] Step 5: Build a deep probability estimation model based on convolutional neural network, perform group-based autoregressive probability density modeling, input multiple sub-coefficient blocks, and output the probability distribution matrix of each sub-coefficient block;

[0013] Step 6: Combine the entropy arithmetic encoder and the probability distribution matrix to perform lossless encoding and decoding on each sub-coefficient block.

[0014] Preferably, the specific process of step 1 is:

[0015] Step 1.1: Perform 8x8 floating-point DCT transform on the input 2D medical image X to obtain DCT frequency domain coefficients, and then perform hard quantization on the floating-point coefficients to obtain integer quantized DCT coefficients X′.

[0016] In step 1.2, the integer quantized DCT coefficients X′ are split into DC coefficients and AC coefficients according to the zigzag scanning order.

[0017] Preferably, in step 2, the DC coefficient is compressed by the traditional encoder JPEGXL; the loss R caused by Round quantization is compressed by run-length coding.

[0018] Preferably, in step 3, the AC coefficients are decomposed into structure layer MSB and texture layer LSB by a linear mapping-decomposition model;

[0019] Specifically, the linear mapping-decomposition model includes a linear mapping model and a linear decomposition model. The linear mapping model is:

[0020]

[0021] Where C(i,j)) represents the AC coefficient at the spatial coordinate (i,j);

[0022] The linear decomposition model is:

[0023]

[0024] X LSB =C(i,j)mod256.

[0025] Preferably, the specific process of step 4 is: decomposing the texture layer LSB into multiple sub-coefficient blocks through a row-column grouping strategy;

[0026] Step 4.1, row grouping: except for the DC coefficient, the texture detail part LSB of the 63 AC coefficients at the horizontal, vertical and diagonal positions is recorded as {ch i |i∈[1,63]}, grouped and rearranged according to the direction of texture change, divided into 21 groups, each with 3 coefficients;

[0027] The coefficients in the horizontal direction are divided into group G1 = {ch1, ch5, ch6}, the coefficients in the vertical direction are divided into group G2 = {ch2, ch3, ch9}, and the coefficients in the oblique direction are divided into group G3 = {ch4, ch8, ch9}. 11};

[0028] Step 4.2, column grouping: On the basis of row grouping, a coefficient component in each group is further divided into 4 sub-coefficient blocks in terms of spatial position; specifically, a 2x2 sliding window is used, and a sliding step of 2 is performed, and the coefficient points that fall in the same position in the sliding window are packed into a sub-coefficient block each time. Thus, each sub-coefficient block is represented as S g,r,c =S n , where g∈[1,21],r∈[1,3],c∈[1,4],n∈[1,252], the three-dimensional coordinates (g,r,c) are group coordinates, row coordinates, and column coordinates respectively, and n is the corresponding one-dimensional index after flattening.

[0029] Preferably, in step 5, the depth probability estimation model Φ based on the convolutional neural network is composed of a 3x3 convolution layer and a ReLu activation function, including a context feature fusion module CFM and a probability density distribution prediction module PMF; wherein CFM is composed of a 64-channel convolution layer and 3 residual convolution blocks, and its input has two branches, namely the frequency domain context C f and spatial context C s , output the fused context features;

[0030] The probability density distribution prediction module PMF consists of two 128-channel convolutional layers and ReLu activation functions, one 256-channel convolutional layer and a Softmax layer. Its input is the contextual features fused by CFM, and it outputs the probability distribution matrix p′ of the current sub-coefficient block. θ (S g,r,c ).

[0031] Preferably, the frequency domain context C of the current sub-coefficient block f =Concat(G g<i , G i,r< ) is designed by row grouping; G g<i is the sub-coefficient block preceding the current group, G i,r< For blocks whose row coordinates in the current group are smaller than the current block, the frequency domain context C f The impact of probability modeling on the current sub-coefficient block is expressed as:

[0032] p′ θ (G i,1 ,G i,2 G i,3 |G g<i ) = p′ θ(G i,1 |G g<i )·p′(G i,2 |G i,1 ,G g<i )·p′ θ (G i,3 |G i,1 ,G i,2 ,G g<i );

[0033] The spatial context C of the current sub-coefficient block s =G i,r,c< Designed by column grouping; G i,r,c< is the sub-coefficient block in the current group whose row coordinates are equal to the current block but whose column coordinates are smaller than the current block, denoted as G i,r,c< ;

[0034] Combined with frequency domain context C f and spatial context C s , the complete probability modeling of the current sub-coefficient block is expressed as:

[0035] p′ θ (G i,r,c ) = p′ θ (G i,r,c |G i,r,c<, G i,r< ,G g<i )

[0036] It outputs the probability that each point of the current sub-coefficient block is within the range of [0,255]. The probability matrix p′ and the true value of the current sub-coefficient block are used to calculate the cross entropy loss, which is expressed as:

[0037] L θ = Cross_entroopy(p′(S g,r,c, ),S g,r,c )

[0038] Among them, the parameters θ of the probability estimation model Φ are updated by optimizing the above loss function through the Adam optimizer; the probability estimation model Φ outputs the probability matrix p′ of each possible symbol of the current sub-coefficient block, and p′ is combined with the arithmetic encoder to encode each coefficient into a 01 bit stream.

[0039] Preferably, in step 6, during decoding, the bitstream is decoded losslessly by using the probability distribution matrix M predicted by the probability estimation model Φ in combination with an arithmetic decoder to decode each sub-coefficient block. All sub-coefficient blocks are then transformed into the original AC coefficients by the inverse linear transform and merging module at the decoding end, specifically including:

[0040] The DC coefficient is obtained by JPEGXL decoding, and the run-length encoding decodes the error R and the MSB part of the AC coefficient;

[0041] The DC coefficient is input into the probability estimation model Φ to predict the probability distribution matrix p′0 of the first sub-coefficient S0, and p′0 is input into the arithmetic decoder torchac to decode the first sub-coefficient block S0;

[0042] S0 is used as the prior for the subsequent sub-coefficient blocks, and the probability estimation model Φ is input to predict the probability distribution matrix p′1 of the second sub-coefficient S1. Gradually, all 252 sub-coefficient blocks are decoded sequentially according to the predefined dependency relationship;

[0043] The sub-coefficient blocks are inversely operated and merged into the original LSB in the order of row-column grouping;

[0044] The LSB and the MSB of the run-length decoding are combined into AC coefficients through linear mapping and inverse operation of the decomposition module;

[0045] The AC coefficients and DC coefficients are recombined and rearranged, and transformed back to the pixel domain through I-DCT, denoted as X′. The final decoded lossless reconstruction is: Rec=X′+R.

[0046] The present invention further discloses a medical image lossless compression system based on transform coding and deep learning, comprising an interconnected memory and a processor, wherein a computer program is stored on the memory, and when the computer program is run by the processor, the steps of the above method are executed.

[0047] Compared with the prior art, the advantages of the present invention are:

[0048] The present invention combines the characteristics of 2D medical images, and combines traditional DCT-based transform coding with deep learning probabilistic modeling to achieve mathematical lossless compression of medical images; the present invention achieves significant compression rates on 2D grayscale medical image data in X-Ray and ultrasound modalities, and ensures no information loss; the present invention utilizes the good decorrelation of discrete cosine transform to transform the pixel domain into the frequency domain, further designs the similarity and redundancy characteristics of different components of frequency domain coefficients, and designs a group-based autoregressive context probability estimation network to predict the probability distribution of coefficients within each group; the predicted probability distribution is combined with an arithmetic encoder to compress the data into a compact bit stream, achieving a lossless compression ratio that is significantly better than existing methods, and requires fewer neural network parameters and encoding and decoding time. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 This is a flowchart of an embodiment of the medical image lossless compression method based on transform coding and deep learning of the present invention.

[0050] Figure 2 This is a topological diagram of an embodiment of the medical image lossless compression system based on transform coding and deep learning of the present invention.

[0051] Figure 3 FIG. 4 is a structural diagram of the probability estimation model Φ in an embodiment of the present invention.

[0052] Figure 4 FIG. 4 is a schematic diagram of the multi-directionality of the AC coefficient in an embodiment of the present invention.

[0053] Figure 5 Schematic diagram of the row-column grouping method in the present invention; (a) is row grouping; (b) is column grouping. DETAILED DESCRIPTION

[0054] The present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0055] like Figure 1 As shown, the medical image lossless compression method based on transform coding and deep learning provided by the embodiment of the present invention includes the following steps:

[0056] Step 1: Input 2D medical image X∈R H×W Perform 8x8 floating point DCT transform and round quantize it into an integer to obtain the DCT coefficient X′∈R H×W =Round(DCT(X), then split into DC coefficients and AC coefficients; the specific process is:

[0057] Step 1.1: Perform 8x8 floating-point DCT transform on the input 2D medical image X to obtain DCT frequency domain coefficients, and then perform hard quantization on the floating-point coefficients to obtain integer quantized DCT coefficients X′.

[0058] In step 1.2, the integer quantized DCT coefficients X′ are split into DC coefficients and AC coefficients according to the zigzag scanning order.

[0059] Step 2: Run-length coding is used to additionally encode the error R between the inverse DCT transform of the quantized integer coefficients and the original pixel value. The information loss R is expressed as:

[0060] R=X-IDCT(Round(DCT(X))=X-IDCT(X′)

[0061] X is the input image, DCT and IDCT represent the 2D discrete cosine transform and inverse discrete cosine transform of the 8x8 block respectively, and Round is the rounding operation;

[0062] The DC coefficient is compressed by the traditional encoder JPEGXL.

[0063] Step 3, the AC coefficient is decomposed into structure layer MSB and texture layer LSB by linear mapping-decomposition model;

[0064] Specifically, the linear mapping-decomposition model includes a linear mapping model and a linear decomposition model. The linear mapping model is:

[0065]

[0066] Where C(i,j)) represents the AC coefficient at the spatial coordinate (i,j);

[0067] The formula maps the negative AC coefficients to a position closer to the positive number, and the dynamic transformation range of the coefficient amplitude is further reduced.

[0068] The linear decomposition model is:

[0069]

[0070] X LSB =C(i,j)mod256

[0071] That is, the AC coefficients are decomposed into two parts, the structure layer MSB and the texture layer LSB; the MSB part represents the sparse structure and uses run-length coding lossless encoding and decoding; the LSB represents the texture details and is compressed by the neural network encoder in the present invention.

[0072] The above linear mapping-decomposition model consists of two linear functions and does not require neural network training. It is simple and efficient.

[0073] Step 4: For the LSB part of the texture layer decomposed in the above step, since it contains the main high-frequency texture, the present invention further applies a row-column grouping strategy to it and uses a subsequent neural network method to perform entropy coding;

[0074] The row and column grouping strategy is developed based on the distribution and texture characteristics of different components in the DCT frequency domain. The 63 AC components are grouped in a refined manner, including:

[0075] Step 4.1, row grouping: except for the DC coefficient, the texture detail part LSB of the 63 AC coefficients at the horizontal, vertical and diagonal positions is recorded as {ch i |i∈[1,63]}, are grouped and rearranged according to their texture change direction, and are divided into 21 groups, with 3 coefficients in each group.

[0076] The coefficients in the horizontal direction are divided into group G1 = {ch1, ch5, ch6}, the coefficients in the vertical direction are divided into group G2 = {ch2, ch3, ch9}, and the coefficients in the oblique direction are divided into group G3 = {ch4, ch8, ch9}. 11}, the specific division method is shown in Table 1:

[0077] Table 1 Row-column grouping of medical image lossless compressor based on transform coding and deep learning

[0078] G1 G2 G3 G4 G5 G6 G7 (1,5,6) (2,3,9) (4,8,11) (7,12,13) (17,18,24) (10,20,21) (14,15,16) G8 G9 G10 G11 G12 G13 G14 (19,22,23) (25,26,27) (28,29,30) (31,32,33) (34,35,36) (37,38,39) (40,41,42) G15 G16 G17 G18 G19 G20 G21 (43,44,45) (46,47,48) (49,50,51) (52,53,54) (55,56,57) (58,59,60) (61,62,63)

[0079] Step 4.2, column grouping: Based on the row grouping, further divide the coefficient component in each group into 4 sub-coefficient blocks in terms of spatial position. Specifically, use a 2x2 sliding window with a step size of 2 to slide the coefficient points that fall in the same position in the sliding window each time into a sub-coefficient block, such as Figure 5 As shown, each sub-coefficient block is represented as S g,r,c =S n , where g∈[1,21],r∈[1,3],c∈[1,4],n∈[1,252], the three-dimensional coordinates (g,r,c) are group coordinates, row coordinates, and column coordinates, respectively, and n is the corresponding one-dimensional index after flattening.

[0080] Step 5: Combine frequency domain context C f and spatial context C s , construct a group-based autoregressive contextual deep probability model Φ, and perform probability distribution modeling on each sub-coefficient after the step using the formula:

[0081] p′(S g,r,c )=Φ(C f ,C s ) = p′ θ (G i,r,c |G i,r,c<, G i,r< ,G g<i )

[0082] p′ is the probability distribution matrix output by the neural network probability model Φ, and θ is the learnable parameter of the deep probability model Φ. The autoregressive context deep probability model receives the frequency domain context C of each sub-coefficient block. f and spatial context C s As input, output the probability distribution p'(S g,r,c ).

[0083] like Figure 3 As shown in the figure, the deep probability estimation model Φ based on the convolutional neural network is composed entirely of 3x3 convolution layers and ReLu activation functions, including the context feature fusion module CFM and the probability density distribution prediction module PMF. The CFM consists of a 64-channel convolution layer and three residual convolution blocks. Its input has two branches, namely frequency domain context and spatial context, and outputs the fused context features.

[0084] The probability density distribution prediction module PMF consists of two 128-channel convolutional layers and ReLu activation functions, one 256-channel convolutional layer and a Softmax layer. Its input is the contextual features after CFM fusion, and the output is the current sub-coefficient block S g,r,c The probability distribution matrix p′ θ (S g,r,c ).

[0085] The frequency domain context C f and spatial context C s , is designed after the row and column grouping strategy. After the coefficients are grouped by rows, the coefficients of the same group are similar in the frequency domain, and visually manifested as the same texture direction after visualizing each corresponding coefficient channel; after the coefficients are grouped by columns, the sub-coefficient blocks have spatial correlation due to their adjacent spatial positions; the frequency domain context and spatial context respectively use the above two correlations to artificially construct the chronological dependency relationship between the 12 sub-coefficient blocks in the group, so the sub-coefficient block encoded and decoded first can be used as the frequency domain context and spatial context of the subsequent sub-coefficient block.

[0086] Specifically, the frequency domain context C f Designed by row grouping, since the coefficient channels of each group have similar textures and are correlated in the frequency domain, the sub-coefficient blocks preceding the current group in each group of sub-coefficient blocks can be used as the context of each block in the current group, denoted by G g<i ; The block G whose row coordinates in the current group are smaller than the current block i,r< Can be used as the frequency domain context of the current block, so the frequency domain context C of the current sub-coefficient block f =Concat(G g<i ,G i,r< );

[0087] Similarly extended to spatial correlation, the column coordinates are smaller than the column coordinates of the current sub-coefficient block, and the block belongs to the same row as the current block, denoted as G i,r,c< Can be used as the spatial context of the current block, so C s =G i,r,c< ;

[0088] Since the linear mapping-decomposition model maps the amplitude range of the coefficients to [0, 255], the last layer of the probability density distribution prediction module is a 256-channel convolution layer, which outputs the probability of each point in the current sub-coefficient block being in the range of [0, 255]. This probability matrix p′ and the true value of the current sub-coefficient block are used to calculate the cross entropy loss L θ , expressed as:

[0089] L θ = Cross_entroopy(p′(S g,r,c, ),Sg,r,c )

[0090] Among them, the parameters θ of the probability estimation model Φ are updated by optimizing the above loss function through the Adam optimizer using the gradient descent method; the probability estimation model Φ outputs the probability matrix p′ of each possible symbol of the current sub-coefficient block, and p′ is combined with the arithmetic encoder to encode each coefficient into a 01 bit stream.

[0091] Step 6: During decoding, the bitstream is passed through the probability distribution matrix p′ that can be predicted by the probability estimation model Φ. Combined with the arithmetic decoder, each sub-coefficient block can be losslessly decoded. All sub-coefficient blocks are then transformed into the original AC coefficients by the linear inverse transform and merging module at the decoding end, specifically including:

[0092] The DC coefficient is obtained by JPEGXL decoding, and the run-length encoding decodes the error R and the MSB part of the AC coefficient;

[0093] The DC coefficient is input into the probability estimation model Φ to predict the probability distribution matrix p′0 of the first sub-coefficient S0, and p′0 is input into the arithmetic decoder torchac to decode the first sub-coefficient block S0;

[0094] S0 is used as the prior for the subsequent sub-coefficient blocks, and the probability estimation model Φ is input to predict the probability distribution matrix p′1 of the second sub-coefficient S1. Gradually, all 252 sub-coefficient blocks are decoded sequentially according to the predefined dependency relationship;

[0095] The sub-coefficient blocks are inversely operated and merged into the original LSB in the order of row-column grouping;

[0096] The LSB and the MSB of the run-length decoding are combined into AC coefficients through linear mapping and inverse operation of the decomposition module;

[0097] The AC coefficients and DC coefficients are recombined and rearranged, and transformed back to the pixel domain through I-DCT, denoted as X′. The final decoded lossless reconstruction is: Rec=X′+R.

[0098] On the training data, first transform the data in steps 1 to 4, and then input the transformed coefficient sliding context into the group-based autoregressive context probability model Φ constructed in step 5. The loss function optimized for training is: the cross entropy loss between the output probability distribution matrix p′ and the true coefficient distribution p is the objective function, denoted as:

[0099]

[0100] Where n is the subscript of the coefficient block; the objective function L θ Perform gradient descent training until the network converges and save the network weights.

[0101] Only steps 1 to 5 are executed in the training phase. In the inference and encoding phase, steps 1 to 4 are executed first, and then steps 5 and 6 are iteratively executed in the order of the sub-coefficient blocks. That is, the context of the current sub-coefficient block is input into the corresponding trained deep probability model, and the probability distribution matrix of the current sub-coefficient block image is output. The sub-coefficient block is encoded into a bit stream in combination with the arithmetic encoder, and the iterative execution is carried out until all sub-coefficient blocks are encoded.

[0102] The model loads the weights trained in the above steps for inference, performs the transformations of steps 1 to 4 on the test image in sequence, and outputs the probability distribution matrix of each group of coefficients. At this time, there is no need to calculate the cross entropy loss. The probability distribution matrix p′ is directly used to perform arithmetic coding on each coefficient, output the final bit stream, and calculate the bit rate.

[0103] While the upper limit of lossless compression is limited by Shannon's theorem, medical images possess certain desirable properties and prior information, such as similarity, both mutual and self-similarity, which facilitates their compression. For example, scans of the same part of a person, such as the lungs or legs, are similar. Different parts of the same person also exhibit similarities.

[0104] The present invention combines the characteristics of 2D medical images, and combines traditional DCT-based transform coding with deep learning probabilistic modeling to achieve mathematical lossless compression of medical images; the present invention achieves significant compression rates on 2D grayscale medical image data in X-Ray and ultrasound modalities, and ensures no information loss; the present invention utilizes the good decorrelation of discrete cosine transform to transform the pixel domain into the frequency domain, further designs the similarity and redundancy characteristics of different components of frequency domain coefficients, and designs a group-based autoregressive context probability estimation network to predict the probability distribution of coefficients within each group; the predicted probability distribution is combined with an arithmetic encoder to compress the data into a compact bit stream, achieving a lossless compression ratio that is significantly better than existing methods, and requires fewer neural network parameters and encoding and decoding time.

[0105] Specifically, the present invention improves the lossless compression ratio from two perspectives: First, reducing the entropy of the original signal source. According to Shannon's information entropy theory, the average number of bits per symbol, L, is defined as:

[0106]

[0107] where p(x) is the probability density function of a given symbol set X and l(x) is the code length of each symbol.

[0108] Its lower bound is the entropy of the information source, as follows:

[0109]

[0110] This method uses traditional DCT to reduce the entropy of the original data, then performs entropy coding on the new variables. Entropy coding requires more accurate probability estimates, so this method uses convolutional neural networks to build a deep probability distribution model, making the probability distribution estimate more accurate, thereby allowing the original information to be represented with a shorter bit stream.

[0111] Figure 2 FIG shows a coding framework diagram of a lossless compression method for 2D medical images according to an embodiment of the present application. Figure 2 , the specific steps of the compression method of this application are:

[0112] Given an input original image X∈R H×W , where H and W are the height and width of the image. Since most medical images in this invention are 2D grayscale images, the number of channels is 1;

[0113] First, a floating-point DCT transform is performed on the grayscale image X using an 8x8 window, and a hard quantization rounding operation is performed to obtain an integer DCT coefficient X′. The rounding results in an error R=X-IDCT(Round(DCT(X)) between the value of the coefficient X′ after inverse DCT transformation and the original pixel value. The present invention performs a separate run-length encoding RLE on the error R to ensure lossless reconstruction of the medical image.

[0114] Combine the corresponding frequency positions of different 8x8 sub-blocks of X′ into one channel Where C∈[0,63] represents the channel index. H×W×1 Converted into frequency coefficients with 64 channels

[0115] The DC channel X′0 is compressed using the traditional compression algorithm JPEGXL; the remaining AC channels X′ 1-63 It is decomposed into MSB and LSB by the linear mapping decomposition model Split; then row-column grouping is applied to the LSB to obtain 252 sub-coefficient blocks. Each sub-coefficient block is uniquely identified by group, row, and column coordinates. The current sub-coefficient block uses the decoded sub-coefficient block as context input and performs conditional probability modeling through the constructed deep probability estimation model Φ.

[0116] Row and column grouping

[0117] The row-column grouping strategy decomposes the AC sparse texture part LSB into 252 sub-coefficient blocks.

[0118] Row Grouping

[0119] DCT coefficients have uneven energy distribution and multi-directional characteristics, that is, a certain area of ​​the transform coefficients represents the spectral components in a certain direction, which enables DCT coefficients to classify texture images. Figure 4 As shown, region Ω0 is the DC component, region Ω1 represents the horizontal frequency variation (vertical texture) in the DCT domain, region Ω2 focuses on the diagonal frequency variation (diagonal texture), and region Ω3 captures the vertical frequency variation (horizontal texture). The present invention rearranges the 63 AC channels according to the multi-directionality and energy of each channel so that adjacent channels with high correlation share the same texture direction, that is, the 63 AC channels are divided into 21 groups, each group Gi = {Gi|i∈[1,21]} contains 3 channels, and i represents the index of the group. Detailed grouping is shown in Table 1, where G1 = (1,5,6) indicates that the first group G1 consists of AC coefficients with channel numbers 1, 5, and 6, and G{i,j}, j∈[1,3] represents the jth coefficient channel within the Gi group.

[0120] Column Grouping

[0121] After row grouping, each AC channel G{i,j} is further split into 4 sub-coefficient blocks, as Figure 5 As shown. For G{i,j}, coefficients with the same sign are packed into the same sub-coefficient block S n =G{i,j,l},n∈[1,252],l∈{a,b,c,d}. The sub-coefficient block index n is determined by the three-dimensional coordinates (group, channel, position) and is recorded as (i,j,l). In the present invention, the horizontal AC coefficients representing vertical pixel texture are packed in the order p{0}→p{2}→p{3}→p{1}, because the correlation is stronger in the vertical direction, and so on.

[0122] Arithmetic Coding

[0123] The present invention uses the torchac pytorch library to implement arithmetic coding. It receives the cumulative probability distribution CDF of the current sub-coefficient block derived from the probability distribution matrix p′ and the true value symbol of the sub-coefficient block, and outputs a 0-1 bit stream:

[0124] Bitstream=torchac.encode(cdf,symbol)

[0125] Through this series of operations, the method of the present invention can efficiently transform high-resolution 2D medical images, accurately predict the distribution of coefficients through neural networks, and effectively improve compression performance in combination with arithmetic encoders.

[0126] decoding

[0127] The decoding process is the inverse process of the encoding process, specifically:

[0128] First, JPEGXL decodes the DC coefficient, and run-length encoding decodes the error r and the MSB part of the AC coefficient;

[0129] The DC coefficient is input into the probability estimation model Φ to predict the probability distribution matrix p0 of the first sub-coefficient S0, and p0 is input into the arithmetic decoder torchac to decode the first sub-coefficient block S0;

[0130] S0 is used as the prior for the subsequent sub-coefficient blocks, and the probability estimation model Φ is input to predict the probability distribution matrix p′1 of the second sub-coefficient S1. Gradually, all 252 sub-coefficient blocks are decoded sequentially according to the predefined dependency relationship;

[0131] The sub-coefficient blocks are combined into the original LSB in the reverse order of row and column grouping;

[0132] The LSB and the MSB of the run-length decoding are combined into AC coefficients through linear mapping and inverse operation of the decomposition module;

[0133] The AC coefficients and DC coefficients are recombined and rearranged, and transformed back to the pixel domain through I-DCT, which is recorded as X'. The final decoded lossless reconstruction is: Rec = X' + R.

[0134] Based on the large-scale spatial similarity characteristics of medical images, the present invention uses the traditional discrete cosine DCT transform to transform them into the frequency domain to reduce the spatial redundancy of pixels. The powerful probabilistic modeling ability of deep neural networks is used to estimate the probability distribution of frequency domain coefficients, and combined with an arithmetic encoder to losslessly encode and decode medical images. Ultimately, the method adopted by the present invention obtains a codec with an ultra-high compression ratio compared to similar methods in the prior art, and has comparable performance in terms of the number of model parameters and encoding and decoding speed.

[0135] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program performs the steps of the above-described method. An embodiment of the present invention further discloses a computer device comprising a memory and a processor connected to each other. The memory has a computer program stored thereon. When executed by the processor, the computer program performs the steps of the above-described method.

[0136] The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by hardware related to computer program instructions. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned method embodiment. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable storage media include: any entity or device that can carry computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. The memory is used to store computer programs and / or modules, and the processor implements various functions by running or executing computer programs and / or modules stored in the memory, and calling data stored in the memory. The memory may include high-speed random access memory and non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage device.

[0137] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions based on the principles of the present invention are within the scope of protection of the present invention. It should be noted that for those skilled in the art, various improvements and modifications that do not depart from the principles of the present invention should be considered within the scope of protection of the present invention.

Claims

1. A medical image lossless compression method based on transform coding and deep learning, characterized in that: Including steps: Step 1: Perform DCT transformation and Round quantization on the input 2D medical image to split it into DC coefficients and AC coefficients; Step 2: compress the DC coefficient and the loss R caused by Round quantization; Step 3, decompose the AC coefficient into structure layer MSB and texture layer LSB; Step 4, decompose the texture layer LSB into multiple sub-coefficient blocks; Step 4 specifically includes step 4.1, row grouping is as follows: except for the DC coefficient, the texture detail part LSB of the 63 AC coefficients at the horizontal position, vertical position, and diagonal position is recorded as , grouped and rearranged according to the direction of their texture change; Step 4.2, column grouping: Based on the row grouping, further divide a coefficient component in each group into 4 sub-coefficient blocks in terms of spatial position; Step 5: Build a deep probability estimation model based on convolutional neural network, perform group-based autoregressive probability density modeling, input multiple sub-coefficient blocks, and output the probability distribution matrix of each sub-coefficient block; The depth probability estimation model includes a context feature fusion module CFM and a probability density distribution prediction module PMF, wherein the input of CFM has two branches, namely, frequency domain context and spatial context , output the fused context features, input the context features after CFM fusion into PMF, and output the current sub-coefficient block The probability distribution matrix ; Frequency domain context of the current sub-coefficient block =Concat( , ) is designed by row grouping, is the sub-coefficient block preceding the current group, The blocks in the current group whose row coordinates are smaller than the current block; The spatial context of the current sub-coefficient block = Designed by column grouping, is the sub-coefficient block in the current group whose row coordinates are equal to the current block but whose column coordinates are smaller than the current block, denoted as ; Step 6: Combine the entropy arithmetic encoder and the probability distribution matrix to perform lossless encoding on each sub-coefficient block.

2. The medical image lossless compression method based on transform coding and deep learning according to claim 1, characterized in that: The specific process of step 1 is: Step 1.1: Perform 8x8 floating-point DCT transform on the input 2D medical image X to obtain DCT frequency domain coefficients, and perform hard quantization on the floating-point coefficients to obtain integer quantized DCT coefficients. ; Step 1.2, integer quantized DCT coefficients It is split into DC coefficients and AC coefficients in zigzag scanning order.

3. The medical image lossless compression method based on transform coding and deep learning according to claim 1, characterized in that: In step 2, the DC coefficient is compressed by the traditional encoder JPEGXL; the loss R caused by round quantization is compressed by run-length coding.

4. The medical image lossless compression method based on transform coding and deep learning according to claim 1, 2 or 3, characterized in that: In step 3, the AC coefficients are decomposed into structure layer MSB and texture layer LSB by the linear mapping-decomposition model; Specifically, the linear mapping-decomposition model includes a linear mapping model and a linear decomposition model. The linear mapping model is: in The spatial coordinates are AC coefficient at ; The linear decomposition model is: 。 5. The medical image lossless compression method based on transform coding and deep learning according to claim 1, 2 or 3, characterized in that: The rows are divided into 21 groups through step 4.1, with 3 coefficients in each group; The coefficients in the horizontal direction are divided into groups , The coefficients in the vertical direction are divided into groups The coefficients in the oblique direction are divided into groups , , ; The step 4.2 specifically includes: using a 2x2 sliding window, sliding with a step size of 2, and packing the coefficient points that fall at the same position in the sliding window into a sub-coefficient block, so that each sub-coefficient block is represented as = ,in , the three-dimensional coordinates (g, r, c) are group coordinates, row coordinates, and column coordinates, respectively, and n is the corresponding one-dimensional index after flattening.

6. The medical image lossless compression method based on transform coding and deep learning according to claim 5, characterized in that: In step 5, the deep probability estimation model Φ based on convolutional neural network consists of a 3x3 convolution layer and a ReLu activation function; the CFM consists of a 64-channel convolution layer and three residual convolution blocks; the probability density distribution prediction module PMF consists of two 128-channel convolution layers and a ReLu activation function, a 256-channel convolution layer and a Softmax layer.

7. The medical image lossless compression method based on transform coding and deep learning according to claim 6, characterized in that: Frequency domain context The impact of probability modeling on the current sub-coefficient block is expressed as: 。 8. The medical image lossless compression method based on transform coding and deep learning according to claim 7, characterized in that: The spatial context is combined with the frequency domain context, and the complete probability modeling is expressed as: Output the probability of each point in the current sub-coefficient block within the range of [0,255], probability matrix With the current sub-coefficient block The true value of Calculate the cross entropy loss, expressed as: Among them, the probability estimation model Parameters Update the above loss function by optimizing it with the Adam optimizer; The probability estimation model Output the probability matrix of each possible symbol of the current sub-coefficient block , Combined with the arithmetic coder, each coefficient is encoded into a 01 bit stream.

9. The medical image lossless compression method based on transform coding and deep learning according to claim 6, characterized in that: In step 6, during decoding, the bitstream is passed through a probability estimation model Predicted probability distribution matrix , combined with the arithmetic decoder, losslessly decodes each sub-coefficient block. All sub-coefficient blocks are then transformed into the original AC coefficients by the linear inverse transform and merging module at the decoding end, specifically including: The DC coefficient is obtained by JPEGXL decoding, and the run-length encoding decodes the error R and the MSB part of the AC coefficient; DC coefficient input probability estimation model Predict the probability distribution matrix of the first sub-coefficient S0 ,The input arithmetic decoder torchac decodes the first sub-coefficient block S0; S0 is used as the prior for the subsequent sub-coefficient block and input into the probability estimation model Predict the probability distribution matrix of the second sub-coefficient S1 1. Gradually, according to the predefined dependencies, all 252 sub-coefficient blocks are decoded sequentially; The sub-coefficient blocks are inversely operated and merged into the original LSB in the order of row-column grouping; The LSB and the MSB of the run-length decoding are combined into AC coefficients through linear mapping and inverse operation of the decomposition module; The AC coefficients and DC coefficients are recombined and arranged, and transformed back to the pixel domain through I-DCT, which is recorded as , the final decoded lossless reconstruction is: Rec= +R.

10. A medical image lossless compression system based on transform coding and deep learning, comprising a memory and a processor connected to each other, wherein a computer program is stored on the memory, characterized in that: When the computer program is executed by a processor, the computer program performs the steps of the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • JPEG image lossless compression and decompression method, system and device

    CN113810693A

  • Entropy coding / decoding method and device

    CN114339262A