Compression system for wsi microscope medical images
By employing a collaborative encoder module, byte encoding/decoding module, and decoder module, the problems of poor decoding quality and slow speed in WSI image compression were solved, achieving efficient multi-resolution hierarchical joint compression and reconstruction, and improving the decoding quality and speed of images.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-10
- Publication Date
- 2026-03-27
AI Technical Summary
Existing WSI image compression algorithms suffer from poor image quality when the compression ratio is high. The multi-layer VAE structure of deep learning algorithms is prone to overfitting, the encoder cannot effectively extract global features, and the compression and decompression speeds are slow.
The encoder module, byte encoding/decoding module, and decoder module work together to extract, fuse, and compress features at multiple resolution levels of WSI images through downsampling, upsampling, and vector quantization paths. The latent representation is generated using ResBlock network and vector quantization technology, and the compression and decompression are accelerated by the byte encoding/decoding module. The decoder module reconstructs the image layer by layer.
It improves the compression efficiency and reconstruction quality of WSI images, and enhances the encoding and decoding speed, especially in the low-resolution image decoding quality, which is superior to other algorithms.
Smart Images

Figure CN121078227B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to a compression system for WSI microscope medical images. BACKGROUND
[0002] The currently widely used WSI (Whole Slide Image) image compression algorithm is JPEG2000. In order to facilitate the retrieval, analysis, zoom viewing of large resolution images, WSI images are stored in a pyramid structure, that is, the original resolution image is located at the bottom layer, and each layer above is the result of down-sampling of the next layer. JPEG2000 compresses each layer separately, first cuts the large resolution picture into fixed-size slices, then performs color transformation, wavelet transformation, and quantization of wavelet coefficients, and discards part of the precision according to the set parameters for lossy compression. Since the bottom layer resolution of the WSI image is very large, an uncompressed WSI image can reach more than 20GB, so a larger compression rate is generally selected, between 20-80.
[0003] Some VAE (Variation autoencoder) based algorithms have been applied to WSI image compression in a small range. These algorithms can make full use of the prior knowledge of WSI images, such as VQVAE-2.
[0004] The main defects of the prior art are:
[0005] When the compression rate is large, the decoded image quality of JPEG2000 is inferior to some deep learning algorithms, because it is only based on the current image and cannot learn the prior of the WSI image. Experiments show that JPEG performs poorly on the compression reconstruction of low-resolution layer images obtained by down-sampling from the bottom layer.
[0006] Existing deep learning algorithms such as VQVAE-2 require separate compression of each layer of the WSI image, which results in slow compression and decompression speed. The existing multi-layer VAE structure introduces multiple down-sampling layers in the encoder part, which is prone to overfitting. This causes the upper convolutional network of the encoder to not be able to extract the global features of the picture well. SUMMARY
[0007] The present application provides a compression system for WSI microscope medical images to solve the technical problem of the above-mentioned traditional early warning means being not accurate enough, specifically adopting the following technical solutions:
[0008] A compression system for WSI microscope medical images, comprising an encoder module, a byte encoding and decoding module, and a decoder module, wherein:
[0009] The encoder module is configured to receive a plurality of resolution level images of a WSI image pyramid structure, and perform feature extraction and fusion processing on each resolution level image, the encoder module comprising a down-sampling path, an up-sampling path and a vector quantization path, the down-sampling path being configured to perform convolutional down-sampling and residual network feature extraction on a current resolution level image, the up-sampling path being configured to up-sample latent features of a previous layer low-resolution image and splice and fuse the latent features with latent features of a current layer, and the vector quantization path being configured to perform vector quantization processing on the fused latent features to generate latent representations;
[0010] The byte encoding and decoding module is configured to compress the latent representations into a byte stream form, and support reverse decoding to restore the latent representations into indexes;
[0011] The decoder module is configured to receive the quantized latent representations, and reconstruct a plurality of resolution level images through a multi-layer up-sampling and splicing mechanism;
[0012] The encoder module, the byte encoding and decoding module and the decoder module work cooperatively to realize joint compression and reconstruction of the WSI images at multiple resolution levels, and improve compression efficiency, reconstruction quality and speed.
[0013] Further, the encoder module supports simultaneous input of a plurality of resolution level images, and is adapted to the WSI image pyramid structure, wherein a length and a width of each layer of images are half of a length and a width of a previous layer of images, and a size of an image block of a bottom layer is 256x256, and a size of an image block of a top layer is 16x16.
[0014] Further, the down-sampling path comprises two convolutional neural networks with a step of 2 and a 16-layer ResBlock network, and is configured to extract key features of the images and reduce redundant information, and expand a number of channels to enhance feature expression capability.
[0015] Further, the up-sampling path up-samples latent features of a previous layer low-resolution image to a same size as latent features of a current layer through a 16-layer ResBlock network and a deconvolutional layer, splices the latent features of the previous layer low-resolution image with the latent features of the current layer, and realizes fusion of global and local features.
[0016] Further, the vector quantization path compresses channels through a 1x1 convolution, maps each latent vector to a nearest cluster center in a codebook composed of N cluster centers in a latent space according to a K-nearest neighbor clustering principle, and replaces the original vector with a corresponding index; in a training stage, cluster center vectors are optimized jointly by using a codebook loss and a commitment loss, and are updated online by using an exponential moving average; in a compression stage, a codebook vector most similar to the original vector is found by searching the codebook to replace the original vector, and a codebook index is given to the byte encoding and decoding module to be further encoded into a byte stream.
[0017] Further, the byte codec module further encodes the latent representation output by the vector quantization path into a tightly connected byte stream: using CUDA parallelism, the starting bit position and the required number of shifts of each element in the total bit stream are calculated, the elements are sequentially written into a continuous bit stream through atomic or operations and shift operations, and the bit stream is compressed into a byte stream using a zlib encoder; when decompressing, the bit stream is first decoded by the zlib decoder, the elements are extracted in reverse according to the same starting bit position and shift number, and the original latent representation is recovered. Except for the zlib encoding and decoding process, the whole process is completed by GPU parallelism, realizing byte-level compression and decompression acceleration.
[0018] Further, the decoder module reconstructs the image layer by layer from the bottom layer to the top layer: first, the inverse convolution upsampling of the previous layer latent representation to the current layer resolution is performed, then the current layer latent representation is spliced in the channel dimension, the global and detail features are fused through the 16-layer ResBlock network, and finally the 3-channel reconstructed image is output by two-level 2 times inverse convolution enlargement by 4 times; the quantized latent representation is directly used as the input of the bottom layer, and the reconstructed lower layer latent representation is used to continue upsampling and splicing for the middle layer and the top layer in turn, until all resolution level images are generated.
[0019] Further, the decoder module simultaneously outputs all resolution level reconstructed images in one forward propagation, without repeated inference layer by layer; the detail information of the lower layer latent representation is transmitted layer by layer upwards through upsampling and splicing to improve the image detail of the upper layer, and the global information of the upper layer latent representation is transmitted layer by layer downwards through the inverse convolution network to constrain the overall structure of the lower layer image, so as to ensure the reconstruction quality while significantly improving the decompression speed and reducing the memory occupation.
[0020] Further, the encoder module and the decoder module adopt a hierarchical training strategy during training: first, train the encoder and the bottom layer decoder layer by layer, then replace the decoder structure and jointly train the remaining layers, to avoid training difficulties caused by inter-layer dependence.
[0021] Further, the total loss function of the encoder module and the decoder module is:
[0022]
[0023] wherein L represents the total number of layers of the model, is the MSE error loss of the i-th layer, is the codebook loss of the i-th layer, is the commitment loss of the i-th layer, and β represents the trade-off parameter between the codebook loss and the commitment loss.
[0024] The WSI microscope medical image compression system provided by the application can input multiple resolution images at one time, greatly accelerating the encoding and decoding speed. The global features extracted in the decoding of the upper image improve the coding quality of the lower image, so that the compression quality of the bottom layer of the algorithm of the system is better than that of other algorithms; the detail features extracted in the decoding process of the lower image improve the decoding quality of the upper image, so that the image decoding quality of the algorithm of the system at the low resolution level is better than that of other algorithms. BRIEF DESCRIPTION OF DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0026] Figure 1 is a schematic diagram of a WSI microscope medical image compression system of the present application;
[0027] Figure 2 is a network structure schematic diagram of the encoder module of the present application;
[0028] Figure 3 is a data path and latent variable shape schematic diagram of the encoder module of the present application;
[0029] Figure 4 is a network structure schematic diagram of the decoder module of the present application;
[0030] Figure 5 is a data path and latent variable shape schematic diagram of the decoder module of the present application;
[0031] Figure 6 is a compression / decompression full flowchart of a WSI microscope medical image compression system of the present application;
[0032] Figure 7 is a schematic diagram of image maximum resolution layer compression reconstruction test PSNR score under different bit rates of the present application;
[0033] Figure 8 is a schematic diagram of image maximum resolution layer compression reconstruction test SSIM score under different bit rates of the present application;
[0034] Figure 9 is an encoding and decoding speed result schematic diagram of the compression speed test under the same bit rate of the present application;
[0035] Figure 10is a schematic diagram of reconstructed test PSNR scores of the second resolution layer of the image at different bit rates of the present application;
[0036] Figure 11 is a schematic diagram of reconstructed test PSNR scores of the third resolution layer of the image at different bit rates of the present application;
[0037] Figure 12 is a schematic diagram of reconstructed test PSNR scores of the fourth resolution layer of the image at different bit rates of the present application. DETAILED DESCRIPTION
[0038] Embodiments of the present application are described in detail below with reference to examples illustrated in the accompanying drawings, in which the same or similar elements or elements having the same or similar functions are denoted by the same or similar reference numerals throughout. The embodiments described below by reference to the accompanying drawings are exemplary and are intended to explain the present application, and cannot be understood as limiting the present application.
[0039] As shown in Figure 1 The present application discloses a compression system for WSI microscope medical images, comprising an encoder module, a byte encoding and decoding module, and a decoder module, wherein:
[0040] The encoder module is used to receive multiple resolution level images of the WSI image pyramid structure, and to perform feature extraction and fusion processing on each resolution level image. The encoder module includes a downsampling path, an upsampling path, and a vector quantization path. The downsampling path is used to perform convolution downsampling and residual network feature extraction on the current resolution level image. The upsampling path is used to upsample the latent features of the previous layer of low resolution image and splice and fuse with the current layer latent features. The vector quantization path is used to perform vector quantization processing on the fused latent features to generate latent representation. The byte encoding and decoding module is used to compress the latent representation into a byte stream form, and supports reverse decoding to restore to index. The decoder module is used to receive the quantized latent representation, and reconstruct multiple resolution level images through a multi-layer upsampling and splicing mechanism. The encoder module, the byte encoding and decoding module, and the decoder module work cooperatively to realize joint compression and reconstruction of multiple resolution levels of WSI images, and improve compression efficiency, reconstruction quality and speed.
[0041] As shown in Figure 2The network structure of the encoder module is shown. The encoder module supports the simultaneous input of multiple resolution level images, which adapts to the WSI image pyramid structure, wherein the size of each layer of image is half of the previous layer, and the size of the image block of the bottom layer is 256x256, and the size of the image block of the top layer is 16x16. Specifically, the encoder module can be divided into multiple layers, mainly depending on how many layers the WSI image can be divided into. Taking five layers as an example, the input size of the bottom layer is 256x256, that is, the WSI image of the bottom layer needs to be segmented into 256x256 blocks and input into the network. The length and width of each layer above are half of the next layer, that is, the input size of the top layer is 16x16, which can adapt to the pyramid structure of the WSI image, so that the model can simultaneously accept images of all levels of resolution. The encoder includes three data paths, namely the up-sampling path (Up convolution path), the down-sampling path (Down convolution path), and the vector quantization path (Vector quantize path). The encoding process of each layer of image is shown in Figure 3
[0042] The down-sampling path includes two convolutional neural networks with a stride of 2 and a 16-layer ResBlock network, which is used to extract key features of the image and reduce redundant information, while expanding the number of channels to enhance the feature expression ability.
[0043] Specifically, the input image is standardized to form a tensor input with a shape of (batch_size, 3, height, width). Then, the input image is subjected to a convolutional neural network (CNN, Convolution Neural Network) with a stride of 2. The purpose of this layer is to reduce the size of the latent variable, reduce the redundant relationship between adjacent pixels, extract key information, and ensure the compression performance of the model. At the same time, the number of channels is increased, the receptive field is expanded, and higher-level latent information is captured. After down-sampling, the latent variable will pass through a 16-layer ResBlock network, which is composed of multiple stacked CNN layers plus ReLU activation function, combined with the residual mechanism, that is, the addition of network input and output. The purpose is to use the residual mechanism to enhance the accuracy of feature extraction when the depth is deep, and to avoid model overfitting.
[0044] The up-sampling path uses a 16-layer ResBlock network and a deconvolution layer to up-sample the high-resolution latent features of the upper layer to the same size as the current layer, and splices them with the latent features of the current layer to realize the fusion of global and local features. Specifically, after the ResBlock network in the upper layer, the size of the latent variable is changed to the same size as the lower layer through an up-sampling path, and then spliced with the latent variable of the lower layer. The network structure of the up-sampling path is a 16-layer ResBlock and a deconvolution layer, as shown inFigure 3 The purpose of this is to extract the global features of the WSI low-resolution image through the upper model, and to extract the detailed features of the model through the lower network. The two features are spliced to achieve the effect of considering both deep and shallow features. Different levels do not use CNN to extract features from potential variables again, but use the upper low-resolution image of the multi-resolution image to extract potential features through the CNN network and the up-sampling path. The upper layer of the WSI image is generally obtained by downsampling using methods such as Bilinear Interpol during microscope scanning. Using it to obtain potential features reduces the amount of calculation and the possibility of overfitting compared to extracting from potential variables.
[0045] The vector quantization path compresses the channel through a 1x1 convolution, and then maps each potential vector to the nearest cluster center in the codebook composed of N cluster centers in the latent space according to the K-nearest neighbor clustering principle, and replaces the original vector with the corresponding index. In the training stage, the cluster center vector is optimized jointly using the codebook loss and the commitment loss, and an exponential moving average is used for online updating. In the compression stage, the original vector is replaced by the codebook vector closest to the original vector by searching the codebook, and the codebook index is given to the byte encoding and decoding module for further encoding into a byte stream.
[0046] Specifically, after splicing is completed, the potential variable is compressed and adjusted in channel number through a 1x1 convolution layer without changing the shape, facilitating quantization operation. The principle of vector quantization is to select N cluster centers from all vectors of the potential variable, use N cluster centers (called codebook vectors) to represent all vectors, and store codebook vectors instead of codebook vectors to achieve compression. Before training, the codebook vectors are initialized to random values, and then in the training process, the network introduces codebook loss and commitment loss. The former encourages the cluster center of the vector to better represent all represented vectors, so that the codebook vector is close to the potential vector distribution learned by the encoder. The latter makes the output learned by the codebook close to the selected codebook, so that the vector quantization process is more stable. The codebook loss and commitment loss can be represented as:
[0047]
[0048]
[0049] Where sg represents a straight-through operation, indicating that this item does not participate in gradient calculation. E(x) represents the output of the encoder, and e represents the codebook vector. Since training cannot calculate the gradient of the quantization process, an exponential moving average method is used to update the codebook. As follows:
[0050]
[0051]
[0052]
[0053] where, represents the number of times the codebook vector with index i in a batch is used, represents the codebook vector with index i, represents the latent vector output by the jth encoder allocated to the ith codebook vector, is a decay factor between 0 and 1, generally taking the value of 0.99. In the compression process after the training is completed, for each vector of the latent variable, the codebook vector closest to it in the Euclidean distance is found in the codebook, and the index of the codebook vector is used to replace the original vector to form an index vector, at this time the value range of the index vector is 0-N, and its data type is uint16. In order to save storage space, the byte encoding and decoding module needs to further encode the index vector into a tightly connected bit stream.
[0054] The byte encoding and decoding module further encodes the latent representation output by the vector quantization path into a tightly connected bit stream: using the CUDA parallel mode, the starting bit position and the required number of shifts of each element in the total bit stream are calculated, the elements are sequentially written into the continuous bit stream through atomic or operation and shift operation, and the bit stream is compressed into a byte stream by using the zlib encoder. When decompressing, first decode the bit stream by using the zlib decoder, extract the elements in reverse according to the same starting bit position and shift number, and restore the original latent representation. Except for the zlib encoding and decoding process, the whole process is completed by GPU in parallel, realizing the acceleration of byte-level compression and decompression.
[0055] Specifically, after the vector quantization is completed, the shape of the latent representation obtained is (height, width, 1). The last dimension represents the codebook index, which is approximately randomly distributed in an ideal state of training, so the space occupied by the latent representation mainly depends on the codebook size N. The byte encoding module compresses the latent representation into a byte stream for convenient storage. Assuming N = 1024, the index vector can be compressed into a byte stream of 10 bits per unit. This stage is completed by a cuda code for GPU acceleration. First, the index vector is flattened into an array of length M, and each array element is an integer occupying 16 bits. A cuda thread is started for each index in the index array to perform parallel calculation. The main work of the Cuda kernel encoder is to determine the specific position of the total bit stream where the index is located, the number of bits that need to be shifted, and then add the index to the specific position of the total bit stream through atomicOr atomic or operation and shift operation. In order to further reduce the redundancy of the codebook index, the zlib encoder is used to further compress the bit stream to form the final byte stream. The work of the decoder is the opposite. After the zlib decoder decodes the total bit stream, the specific position of the total bit stream where the index is located and the number of shifts are calculated, and the original index is restored by shifting operation.
[0056] The network structure of the decoder module is shown in Figure 4 The decoder module reconstructs the image layer by layer from the bottom layer to the top layer: first, the inverse convolution upsampling is performed on the latent representation of the previous layer to the resolution of the current layer, then the current layer latent representation is spliced in the channel dimension, the global and detail features are fused through the 16-layer ResBlock network, and finally the 3-channel reconstructed image is output by two levels of 2 times deconvolution to enlarge 4 times. The bottom layer directly takes the quantized latent representation as input, and the middle layer and the top layer successively use the reconstructed lower layer latent representation for upsampling and splicing, until all resolution level images are generated. Moreover, the decoder module synchronously outputs all resolution level reconstructed images in one forward propagation, without repeated inference layer by layer. The detail information of the lower layer latent representation is transmitted layer by layer upwards through upsampling and splicing to improve the image detail of the upper layer, and the global information of the upper layer latent representation is transmitted layer by layer downwards through the deconvolution network to constrain the overall structure of the lower layer image, so as to ensure the reconstruction quality while significantly improving the decompression speed and reducing the memory occupation.
[0057] Specifically, as shown in Figure 5As shown, the decoder module accepts the quantized latent variables as input, which can be divided into multiple layers, the number of which is consistent with the encoder. In contrast to the encoder, the data path of the decoder starts from the bottom and goes up. At the bottom layer, the decoder accepts the latent variables of the previous layer and the current layer, upsamples the latent variables of the previous layer to make its size consistent with the current layer, and then splices the two. For the spliced variable, another 4 times upsampling is performed to obtain the reconstructed image. The upsampling layer consists of two parts. The first part contains 16 ResBlocks, which have the same structure as the encoder. The second part consists of two 2 times deconvolution layers, whose purpose is to change the size of the latent variable to be consistent with the input image, while modifying the channel number to 3. The purpose of using the upper layer latent variable is to make full use of the global features provided by the upper layer latent variable to optimize the decoding quality. The difference between the middle layer and the bottom layer decoder is that they use the lower layer spliced latent vector to downsample to obtain a latent variable consistent with the size of the current layer, and then splice it with the current layer latent variable, through ResBlocks, and the upsampling layer to reconstruct an image consistent with the size of the input image. The reason for using the lower layer latent variable is to make full use of the detailed features provided by the lower layer latent variable to effectively improve the image decoding quality. Since the network can infer all levels of reconstructed images in one forward propagation process, the decompression speed of this algorithm is better than most deep learning-based methods. During the training process, the mse error between each layer of reconstructed image and input image is calculated as one of the loss functions, which can be represented as follows:
[0058]
[0059] Where L represents the total number of layers of the model, D(x) represents the decoder output, and E(x) represents the encoder output. This loss represents the reconstruction error of the model, and by optimizing this error, the reconstruction quality of the model is improved. The compression and decompression process flowchart of the whole system is shown in Figure 6 .
[0060] The encoder module and the decoder module use a hierarchical training strategy during the training process. First, train the encoder and the bottom layer decoder layer by layer, then replace the decoder structure and jointly train the remaining layers to avoid training difficulties caused by layer dependence.
[0061] The total loss function of the encoder module and the decoder module of this algorithm is:
[0062]
[0063] where L represents the total number of layers of the model, and β represents the trade-off parameter between the codebook loss and the commitment loss. The hierarchical training is selected during training, which can quickly reach the convergence result. The decoder part of the model is replaced by the decoder model proposed by VQVAE-2, that is, all layers are determined by the latent variables of the layer and the layer above. After upsampling the upper layer latent variables, the reconstructed image is obtained by splicing and upsampling the current layer latent variables. First, the first layer is trained, and the loss function is consistent with the above loss function. Then, the parameters of the first layer are locked, and the next layer is trained one by one. When training the i-th layer, the parameters of the first i-1 layers are locked. After the encoder is trained, the parameters of the encoder part and the bottom layer of the decoder are locked. Then the model of the decoder part is replaced by the structure of the algorithm, and all layers of the decoder except the bottom layer can be trained at the same time. The purpose of this is that the data path direction of the model is opposite during encoding and decoding. The data path flows from the top layer to the bottom layer during encoding, and from the bottom layer to the top layer during decoding. Since the reconstruction quality of all layers depends on the reconstruction loss of the bottom layer decoder, and the reconstruction quality of the bottom layer decoder depends on the encoding quality of the upper layer, this leads to mutual dependence, which increases the training difficulty. The method of replacing the decoder and hierarchical training avoids this dependence and reduces the training difficulty and time.
[0064] Three types of experiments are conducted on the algorithm of the present application to test its compression and reconstruction ability under the same bit rate, compression and decompression speed under the same reconstruction quality, and compression and reconstruction quality of different resolution levels under the same bit rate. The comparison compression algorithms include: OpenJPEG2000, VQVAE-2(5 layers) and MR VQVAE(multi-resolution VQVAE, 5 layers) used in the present system.
[0065] Compression and reconstruction of the bottom layer resolution under different bit rates. For the bottom layer of the WSI image, the PSNR and SSIM scores of the reconstructed image and the original image under different bit rates are compared. The dataset used is CAMELYON16, and 30 WSI images in the test set are selected. The test results are shown in Figure 7-8 It can be seen that the algorithm of the present application is better than the other algorithms compared under a bit rate <0.8. In the case of a larger compression rate, the algorithm has more outstanding performance.
[0066] Compression speed under the same bit rate. For all layers of the WSI image, the average compression and decompression time and the average compression and decompression speed of each image are compared, and the size of one image is 256x256 pixels. In this type of experiment, the comparison of nvJPEG2000 algorithm running on GPU is added. This is to ensure that all algorithms are tested on the same device to ensure fairness, and the test results are as follows: Figure 9The coding and decoding speed of the proposed algorithm is better than most of the other algorithms, and only slower than VQVAE-2, as shown in the table.
[0067] Compression reconstruction of all resolution layers under different bit rates. The PSNR scores of each layer when the resolution hierarchy of the WSI image is 1-3, respectively. The test results are shown in the table. Figure 10-12 The compression reconstruction quality of the proposed algorithm is better than that of the other algorithms for the images of the low resolution layer within the tested bit rate range, as shown in the table.
[0068] The basic principles, main features and advantages of the present application are shown and described above. It should be understood by those skilled in the art that the above examples do not limit the present application in any form, and any technical solutions obtained by equivalent replacement or equivalent transformation fall within the protection scope of the present application.
Claims
1. A compression system for WSI microscope medical images, characterized in that, It includes an encoder module, a byte encoding / decoding module, and a decoder module, among which: The encoder module is used to receive multiple resolution-level images of the WSI image pyramid structure and perform feature extraction and fusion processing on each resolution-level image. The encoder module includes a downsampling path, an upsampling path, and a vector quantization path. The downsampling path is used to perform convolutional downsampling and residual network feature extraction on the current resolution-level image. The upsampling path is used to upsample the latent features of the previous low-resolution image and concatenate and fuse them with the latent features of the current layer. The vector quantization path is used to perform vector quantization processing on the fused latent features to generate a latent representation. The byte encoding / decoding module is used to compress the latent representation into a byte stream and supports reverse decoding to restore it to an index; The decoder module is used to receive the quantized latent representation and reconstruct images at multiple resolution levels through a multi-layer upsampling and stitching mechanism. The encoder module, byte encoding / decoding module, and decoder module work together to achieve multi-resolution hierarchical joint compression and reconstruction of WSI images, thereby improving compression efficiency, reconstruction quality, and speed.
2. The compression system for WSI microscope medical images according to claim 1, characterized in that, The encoder module supports simultaneous input of multiple resolution levels of images, adapting to the WSI image pyramid structure, where the length and width of each layer of the image are half of the previous layer, the bottom layer image block size is 256×256, and the top layer image block size is 16×16.
3. The compression system for WSI microscope medical images according to claim 1, characterized in that, The downsampling path includes two convolutional neural networks with a stride of 2 and a 16-layer ResBlock network, which are used to extract key features of the image and reduce redundant information, while expanding the number of channels to enhance feature representation capabilities.
4. The compression system for WSI microscope medical images according to claim 1, characterized in that, The upsampling path upsamples the low-resolution latent features of the upper layer to the same size as the current layer through a 16-layer ResBlock network and deconvolution layers, and then concatenates them with the latent features of the current layer to achieve the fusion of global and local features.
5. The compression system for WSI microscope medical images according to claim 1, characterized in that, The vector quantization path, after being compressed through a 1×1 convolution channel, maps each latent vector to the nearest cluster center in the codebook consisting of N cluster centers in the latent space according to the K-nearest neighbor clustering principle, and replaces the original vector with the corresponding index. During the training phase, the cluster center vector is jointly optimized using codebook loss and commitment loss, and updated online using exponential moving average. During the compression phase, the codebook vector closest to the original vector is found by searching the codebook to replace the original vector, and the codebook index is handed over to the byte encoding and decoding module for further encoding into a byte stream.
6. The compression system for WSI microscope medical images according to claim 1, characterized in that, The byte encoding / decoding module further encodes the latent representation output by the vector quantization path into a tightly connected bitstream: using CUDA parallel processing, it calculates the starting bit position and required shift number for each element in the total bitstream, and writes the elements sequentially into the continuous bitstream through atomic OR operations and shift operations. Then, the bitstream is compressed into a bytestream using the zlib encoder. During decompression, the bitstream is first decompressed using the zlib decoder, and the elements are extracted in reverse according to the same starting bit position and shift number to recover the original latent representation. Except for the zlib encoding / decoding process, the entire process is completed in parallel by the GPU, achieving byte-level compression and decompression acceleration.
7. The compression system for WSI microscope medical images according to claim 1, characterized in that, The decoder module reconstructs the image layer by layer from the bottom to the top: first, it performs deconvolution on the latent representation of the previous layer to upsample it to the resolution of the current layer, then it concatenates it with the latent representation of the current layer in the channel dimension, then it fuses global and detailed features through a 16-layer ResBlock network, and finally it amplifies the image by 4 times through two levels of 2x deconvolution and outputs a 3-channel reconstructed image; the bottom layer directly takes the quantized latent representation as input, and the middle and top layers successively use the reconstructed latent representation of the lower layer to continue upsampling and concatenation until the image of all resolution levels is generated.
8. The compression system for WSI microscope medical images according to claim 1, characterized in that, The decoder module synchronously outputs reconstructed images at all resolution levels in a single forward propagation, eliminating the need for repeated inference layer by layer. The detailed information of the lower-level latent representation is upsampled and stitched up layer by layer to improve the details of the upper-level image, while the global information of the upper-level latent representation is passed down layer by layer through a deconvolutional network to constrain the overall structure of the lower-level image. This significantly improves the decompression speed and reduces memory usage while ensuring reconstruction quality.
9. The compression system for WSI microscope medical images according to claim 1, characterized in that, The encoder module and the decoder module adopt a hierarchical training strategy during the training process. First, the encoder and the bottom-level decoder are trained layer by layer. Then, the decoder structure is replaced and the remaining layers are trained together to avoid training difficulties caused by inter-layer dependencies.
10. The compression system for WSI microscope medical images according to claim 9, characterized in that, The total loss function of the encoder module and the decoder module is: , Where L represents the total number of layers in the model, For the MSE error loss of layer i, For the codebook loss of layer i, Let β be the commitment loss of layer i, and let β be the trade-off parameter between codebook loss and commitment loss.
Citation Information
Patent Citations
Unsupervised defect detection method based on quantization auto-encoder
CN115375604A
Image processing method and apparatus
GB202308496D0