Practical Lossless Volumetric Medical Image Compression via Tri-plane Context Tree Learning
Authors: Yuanchao Bai, Yifan Zhao, Kai Wang, Yuanbo Du, Jie Cheng, Teng Fang, Xianming Liu, Wen Gao
Organizations: Faculty of Computing, Harbin Institute of Technology, Harbin, 150001, China · Huawei Tech. Company, Ltd. · School of Electronics Engineering and Computer Science, Peking University, Beijing, 100871, China, and Pengcheng Laboratory, Shenzhen, 518055, China
Lossless compression of volumetric medical images is of paramount importance for clinical and research applications where data fidelity is essential. Traditional compression methods are often limited in efficiency due to rigid, handcrafted models. Conversely, deep neural network (DNN)-based compression methods, while effective, demand substantial computational resources, hindering deployment in resource-constrained settings. To address these challenges, we propose a novel tri-plane context tree (TCT)-based method for lossless volumetric medical image compression that delivers high performance without relying on DNNs or external training data. To exploit intra-slice and inter-slice redundancies, we introduce a compact tri-plane context representation that decomposes complex 3D context modeling into efficient 2D modeling on three orthogonal planes. By integrating this representation with a context tree framework, we develop an input-specific TCT model employing an adaptive binary tree structure. At each tree node, the model dynamically selects from a suite of tri-plane based predictors and contextual feature extractors, enabling data-adaptive context modeling tailored to local structural characteristics. Instead of offline training, we sample a subset of the input volume to learn the TCT model by optimizing the minimum description length (MDL) through iterative construction and pruning. With the learned TCT model, each pixel retrieves its corresponding context, computes the prediction residual using the predictor dictated by the context, and performs entropy encoding based on the associated histograms. Experimental results demonstrate that the proposed method achieves compression performance on par with recent DNN-based methods on multiple datasets, while maintaining low computational cost and fast coding speeds, making it highly applicable in practice.
Figures & tables
Notation
Description
I
volumetric medical image
Iidx
pixel set at index idx∈{<i,S,P,…}
Iidx
pixel at index idx∈{i,L[0],L[1],…}
C , Cj
context set C={C1,…,CM} , context Cj∈C
pred , predj
predictor and predictor assigned to Cj
ridx
residual set at index idx
TABLE I: Notations for TCT model and TCT-based compression method.
Fig. 1: Example of a volumetric medical image and its tri-plane representation, including x-y, y-z, x-z planes.
Fig. 2: Illustration of tri-plane context representation for encoding pixel Ii . (a) all previously encoded pixels I<i . (b) x-y context plane. (c) y-z context plane. (c) x-z context plane. Red: the pixel Ii . Blue: the previously encoded pixels. Orange: the pixels in each context plane.
Fig. 3: Diagram of the tri-plane context tree (TCT) model. Each internal node is assigned a feature index k corresponding to the k -th feature fik ’s, which are derived from a combination of pixels (marked with orange) residing on the three context planes. The internal node is also associated with a threshold t for binary partitioning. Each leaf node represents a distinct context. For each pixel, the TCT model is traversed from the root to the leaf based on the pixel’s features, retrieving the corresponding context.
Fig. 4: Block diagram of the TCT-based volumetric medical image compression. The TCT-based compression method requires no offline training. Instead, it learns a customized, input-specific context model T by performing TCT learning on a sample set S of the input 3D volume. During compression, each pixel retrieves its corresponding context from the learned model T to enable adaptive prediction and entropy coding. Finally, both the learned TCT model and the compressed image data are stored into the bitstream to ensure decodablity.
Fig. 5: Labeling of neighboring pixels used in prediction and contextual feature extraction on three context planes. The x-y, y-z and x-z context planes enjoy the same context pattern. The △ denotes the current pixel. The L denotes the left pixel of △ . The LL denotes the left-left pixel of △ . The T denotes the top pixel of △ . The TT denotes the top-top pixel of △ . The LT denotes the left-top pixel of △ . The LLT denotes the left-left-top pixel of △ . The RT denotes the right-top pixel of △ .
Predictor
Sub-predictor
Median-2D
median(IL[0],IL[0]+IT[0]−ILT[0],IT[0])
Median-3D
median(IL[0],IL[0]+IT[0]−ILT[0],IT[0])
median(IL[1],IL[1]+IT[1]−ILT[1],IT[1])
median(IL[2],IL[2]+IT[2]−ILT[2],IT[2])
Blending-3D
IL[0]−IT[0]+IRT[0]
IL[0]+IT[0]−ILT[0]
TABLE II: Tri-plane based predictors and the corresponding sub-predictors
Fig. 6: Quadruple representation (zbit,sbit,msb,lsb) of prediction residual.
Type
Feature Value
Gradient-2D
IL[0]−ILT[0]
ILT[0]−IT[0]
IT[0]−IRT[0]
IT[0]−ITT[0]
IL[0]−ILL[0]
ILL[0]+ILT[0]−ILLT[0]−IL[0]
TABLE III: Tri-plane based features and the corresponding values
Fig. 7: Illustration of the proposed two-step TCT learning algorithm.
Chaos
MosMedData
Trabit
MRNet
Type
Abdomen CT
Lung CT
Brain MRI
Knee MRI
Training Set †
20
125
70
1130
Test Set
20
45
30
120
Bit Depth
16
16
16
8
Slice Count
78 ∼ 294
32 ∼ 72
176
17 ∼ 61
Resolution
512 × 512
512 × 512
176 × 208
256 × 256
TABLE IV: Overview of volumetric medical image datasets in experiments. † Training sets are for DNN-based methods.
Codec
Chaos
MosMedData
Trabit
MRNet
BPP ↓
Compression Ratio ↑
BPP ↓
Compression Ratio ↑
BPP ↓
Compression Ratio ↑
BPP ↓
Compression Ratio ↑
Traditional
PNG
7.09
2.256
7.09
2.257
3.08
5.190
4.56
1.755
JPEG-LS [ 51 ]
5.08
3.148
5.02
3.188
2.22
7.194
4.06
1.971
CALIC [ 54 ]
-
-
-
-
-
-
3.93
2.036
JPEG2000 [ 42 ]
5.05
3.169
5.32
3.009
2.58
6.204
4.17
1.920
TABLE V: Lossless image compression performance of our TCT-based volumetric medical image compression method, compared with other lossless compression methods on Chaos, MosMedData, Trabit and MRNet datasets. The best performance is marked in bold , the second-best is marked with an underline , and the third-best is marked with a double-underline . † Using the released CT compression model trained on MosMedData dataset.
Codec
GPU Max Usage
Chaos
MosMedData
Enc.T.
Dec.T.
Enc.T.
Dec.T.
Traditional (CPU)
JPEG-LS
-
0.02s
0.02s
0.03s
0.03s
JPEG-XL
-
2.18s
0.05s
4.08s
0.07s
JP3D
-
0.04s
0.04s
0.07s
0.07s
HEVC-RExt
-
4.01s
0.02s
5.61s
0.03s
TABLE VI: Average coding time per slice of volumetric medical image compression methods. The DNN-based methods run on GPU with maximum GPU usage reported.
M-2D
M-3D
B-3D
Chaos
MosMedData
Trabit
MRNet
✓
×
×
4.64
4.72
2.00
3.83
✓
✓
×
4.44
4.71
1.97
3.83
✓
✓
✓
4.27
4.64
1.91
3.79
TABLE VII: Effects of Predictors on the compression performance. M-2D, M-3D, B-3D denote Median-2D, Median-3D and Blending-3D.
Fig. 8: The percentage of predictor and feature selections in our TCT-based compression method on the Chaos dataset. (a) predictor selection. (b) feature selection. The M-2D, M-3D and B-3D denote the Median-2D, Median-3D and Blending-3D respectively.
Fig. 9: Visualization of the predictor selection map generated by our TCT-based compression method for a 2D slice of a 3D CT scan. (a) 16-bit CT slice mapped to 8-bit for visualization. (b) predictor selection map. Red: Median-2D. Yellow: Median-3D. Blue: Blending-3D.
G-2D
G-3D
Pred
Chaos
MosMedData
Trabit
MRNet
✓
×
×
4.36
4.67
1.93
3.86
✓
✓
×
4.30
4.66
1.93
3.85
✓
✓
✓
4.27
4.64
1.91
3.79
TABLE VIII: Effects of features on compression performance. G-2D, G-3D, Pred denote Gradient-2D, Gradient-3D and Prediction.
Percentage
Chaos
MosMedData
Trabit
MRNet
Model
0.04%
0.08%
0.11%
0.14%
Image Data
99.96%
99.92%
99.89%
99.86%
TABLE IX: Average proportions of TCT model and compressed image data.
TCT Pruning
Histogram Num.
Comp. Performance
×
✓
×
✓
Chaos
4048
224
4.28
4.27
MosMedData
2552
198
4.67
4.64
Trabit
691
106
1.93
1.91
MRNet
587
111
3.82
3.79
TABLE X: Effects of TCT pruning on average number of histograms and compression performance.
Fig. 10: Effects of (λ,u) on average lossless compression performance (bpp) on random samples from Chaos, MosMedData, Trabit and MRNet datasets. The (50, 224) is selected for all four datasets.
Department of Health Technology and Informatics, The Hong Kong Polytechnic University, Hong Kong · School of Integrated Circuits and Electronics, Beijing Institute of Technology, China · 3Mental Health Research Center, The Hong Kong Polytechnic University, Hong Kong +1