3D Gaussian Mixtures for Microscopy Volume Compression
Compact Neural Representations for Large-Scale Biological Imaging Data
Modern light-sheet and confocal microscopy generates terabyte-scale volumetric datasets that pose severe challenges for storage, transmission, and analysis. VolMicro is a compression framework based on 3D Gaussian mixture models that achieves extreme compression ratios (>100Γ) while preserving the fine structural details critical for biological analysis.
Our method represents microscopy volumes as sparse collections of anisotropic 3D Gaussians, where each Gaussian encodes local intensity with learnable position, scale, orientation, and amplitude.
- π― Sparse Occupancy Gating: Restricts computation to biologically relevant regions (typically <15% of volume), achieving 10-20Γ training speedup
- π¬ Edge-Aware Loss Weighting: Preserves dendrite boundaries and fine neurite structures
- π Adaptive Densification: Automatically places more Gaussians in regions of high structural complexity
- β‘ CUDA-Accelerated KNN Evaluation: Enables real-time decompression
Benchmark on neuron microscopy volume (100 Γ 647 Γ 813 voxels, 16-bit):
| Metric | Result |
|---|---|
| PSNR | 36.56 dB |
| SSIM | 0.932 |
| LPIPS | 0.278 |
| Compression Ratio | 231Γ |
| bpp | 0.073 |
| Model Size | 0.46 MB (20,693 Gaussians) |
| Training Time | 7 min (10K epochs) |
We represent the volume as a finite mixture of anisotropic 3D Gaussian primitives:
where:
-
$w_i \in \mathbb{R}$ is the scalar amplitude (intensity) -
$\mu_i \in \Omega$ is the Gaussian center position -
$\Sigma_i \in \mathbb{R}^{3\times3}$ is the covariance matrix (size and orientation)
The Gaussian kernel is:
Microscopy volumes are background-dominant. We exploit this by restricting training to an occupied set
This reduces unnecessary modeling of empty background and improves rate-distortion efficiency.
- Weighted Reconstruction Loss: Edge-aware intensity loss with higher penalty near high-frequency content
- Gradient Consistency: Matches spatial derivatives to preserve topology-relevant edges
- Regularization: Prevents degenerate primitives and encourages parsimonious representations
git clone https://github.com/asheibanifard/VolMicro.git
cd VolMicro
pip install -r requirements.txt- Python β₯ 3.8
- PyTorch β₯ 2.0
- CUDA β₯ 11.0 (for GPU acceleration)
- FAISS (for KNN acceleration)
- NumPy, tifffile, PyYAML
Download pretrained models from HuggingFace:
# Install huggingface-hub if needed
pip install huggingface-hub
# Download all pretrained models
huggingface-cli download Arminshfard/volmicro-checkpoints --local-dir ./pretrained_modelsOr download directly from: π€ Arminshfard/volmicro-checkpoints
| Model | Gaussians | PSNR | Compression | Description |
|---|---|---|---|---|
v019 |
20,693 | 36.56 dB | 231Γ | Best quality, 10K epochs |
v014 |
-- | -- | -- | Ablation study |
from load_model import load_checkpoint
# Load pretrained model
model = load_checkpoint('pretrained_models/v019/checkpoints/checkpoint_epoch_010000.pt')
# Reconstruct volume
volume = model.forward_knn_volume(k=32)
print(f"Reconstructed: {volume.shape}") # (100, 647, 813)First, train the sparse occupancy gate on your volume:
python train_gate.py --volume path/to/volume.tif --output outputs/TOPS_GATEpython train.py \
--volume path/to/volume.tif \
--gate_checkpoint outputs/TOPS_GATE/tops_gate_step_020000.pt \
--gate_tau 0.5 \
--num_gaussians 15000 \
--epochs 5000 \
--lr 0.01 \
--output_dir outputs/compressed \
--densify \
--max_gaussians 50000 \
--use_sampling \
--num_samples 300000 \
--grad_threshold 0.00002from load_model import load_checkpoint
# Load compressed representation
model = load_checkpoint('outputs/compressed/checkpoints/checkpoint_epoch_005000.pt')
# Reconstruct full volume
reconstructed = model.forward() # (D, H, W) tensor
# Region-of-interest query (efficient!)
roi = model.forward_knn(query_points, k=32)The compressed representation stores per-Gaussian parameters:
| Parameter | Size |
|---|---|
| Position | 3 Γ float16 = 6 bytes |
| Scale | 3 Γ float16 = 6 bytes |
| Rotation | 4 Γ float16 = 8 bytes |
| Intensity | 1 Γ float16 = 2 bytes |
| Total | 22 bytes per Gaussian |
Example: Neuron microscopy volume (100 Γ 647 Γ 813, 105 MB at 16-bit) with 20,693 Gaussians:
Benchmark on neuron microscopy volume (100 Γ 647 Γ 813 voxels, 16-bit, 105 MB):
| Method | PSNR β | SSIM β | LPIPS β | bpp β | Ratio β | Size | Time |
|---|---|---|---|---|---|---|---|
| JPEG2000-3D | 41.09 dB | 0.935 | 0.204 | 0.333 | 101Γ | 2.09 MB | 0.06 min |
| HEVC (x265) | 41.62 dB | 0.943 | 0.015 | 0.316 | 106Γ | 1.98 MB | 0.04 min |
| ZFP (Ξ΅=10β»Β³) | 87.45 dB | 1.000 | 0.000 | 10.23 | 3.3Γ | 64.12 MB | 0.03 min |
| SIREN | 33.1 dB | 0.931 | -- | 0.209 | 80Γ | 1.31 MB | 25 min |
| Dense Gaussian | 34.8 dB | 0.958 | -- | 0.177 | 95Γ | 1.11 MB | 42 min |
| VolMicro (Ours) | 36.56 dB | 0.932 | 0.278 | 0.073 | 231Γ | 0.46 MB | 7 min |
Note: PSNR/SSIM computed on gated (foreground) region. ZFP achieves near-lossless quality but at 70Γ larger size than VolMicro. Traditional codecs (JPEG2000, HEVC) have higher PSNR but worse compression ratios.
VolMicro/
βββ train.py # Main training script (sparse gate-guided)
βββ train_cuda.py # CUDA-optimized training
βββ gaussian_model_cuda.py # CUDA Gaussian model with KNN
βββ gaussian_model.py # CPU Gaussian model
βββ losses.py # Loss functions & regularization
βββ trainer.py # Training utilities
βββ load_model.py # Checkpoint loading
βββ export_to_splat.py # Export to .splat format
βββ config.yml # Default configuration
βββ gs_utils/
β βββ Compute_intensity.py # CUDA intensity computation
β βββ discretize_grid.cu # CUDA kernel
β βββ general_utils.py # Utilities
βββ docs/
βββ paper.pdf # Technical paper
Automatically splits and clones Gaussians based on gradient magnitude:
--densify # Enable densification
--grad_threshold 0.00002 # Gradient threshold for clone/split
--max_gaussians 50000 # Maximum GaussiansPreserves thin neurite structures by weighting loss higher on edges:
--edge_boost 3.0 # Edge weight multiplier
--no_edge_weights # Disable edge weightingExploits background sparsity for 6-9Γ speedup:
--gate_checkpoint path.pt # TOPS-Gate checkpoint
--gate_tau 0.5 # Occupancy thresholdThe continuous Gaussian representation enables multi-resolution queries. Quickly preview low-resolution reconstructions before loading full detail.
Unlike block-based codecs, our representation supports efficient spatial queries. Extracting a subvolume requires evaluating only nearby Gaussians.
Gaussians naturally align with biological structures. Elongated Gaussians follow dendrite axes; spherical Gaussians capture somata.
@article{volmicro2026,
title={3D Gaussian Mixtures for Microscopy Volume Compression:
Compact Neural Representations for Large-Scale Biological Imaging Data},
author={Sheibanifard, Armin},
year={2026}
}MIT License - see LICENSE for details.
This work builds upon advances in 3D Gaussian Splatting for novel-view synthesis and extends them to the domain of volumetric microscopy compression.