Segment Everything, Materialize Nothing: Exact Streaming Inference for Many-Class 3D Segmentation

Fabian Isensee, Jakob Wasserthal, Lalith Kumar Shiyam Sundar, Maximilian Rokuss, Moritz Langenberg, Constantin Ulrich Harsy, Stefan Michael Happold, Klaus H. Maier-HeinarXiv 2026

Imagine you’re trying to paint a detailed map of a massive city. Standard procedure says you must first create a separate, full-sized layer for every single type of landmark: one for every house, one for every tree, one for every fire hydrant. By the time you’re tracking 125 different types of objects across a 3D volume, your "canvas" has become so heavy it would crush a normal desk.

In the world of 3D medical imaging (like CT scans), this is known as the Memory Wall. To segment 100+ organs and structures, researchers have historically been forced to split the task across five or six different AI models just to keep the computer from running out of memory.

The authors of "Segment Everything, Materialize Nothing" have found a way to tear down that wall. By rethinking the math of how AI "sees," they’ve reduced the memory footprint of many-class segmentation by over 50x—without losing a single bit of accuracy.

TL;DR

This paper introduces "Exact Streaming Inference," a method that allows a single AI model to segment hundreds of 3D structures (like organs and bones) on a standard consumer GPU. By mathematically reordering the inference pipeline, they cut memory usage from a staggering 76 GB down to just 1.3 GB, making high-end medical AI accessible to clinicians without supercomputers.

What Problem Does This Paper Address?

When an AI segments a 3D image, it doesn't just output a final label. It first generates "logits"—raw scores for every possible class (organ) at every single voxel (3D pixel).

For a typical whole-body CT scan with 125 classes, these intermediate scores occupy about 76 GB of RAM. Most high-end consumer GPUs only have 8 to 24 GB. To bypass this, current state-of-the-art tools like TotalSegmentator split the body into subsets (e.g., one model for the chest, one for the abdomen). This "specialist" approach is slow, clunky, and often leads to "staircase" artifacts where the different models' outputs don't quite line up (see Figure 4).

Figure 4. Nearest-neighbor export (right) produces jagged "staircase" edges compared to the authors' exact export (middle).

Methods

The authors realized that the memory wall isn't inherent to the task; it's a byproduct of how we calculate the results. They introduced two key innovations:

  1. Spatial Streaming: Instead of processing the whole 3D volume at once, they process it in "slabs." Because most operations in the pipeline are local, they can stream the data through a "ring buffer" that is only one patch thick.
  2. Algebraic Reordering: This is the "aha!" moment. In a standard network, the "classification head" (the part that turns abstract features into organ scores) happens early. The authors proved that this head "commutes" with the subsequent steps of blending and resampling.

Mathematically, if $H$ is your classification head and $B$ is your blending operation, $B(H(features)) = H(B(features))$.

Since the number of features (usually ~32) is much smaller than the number of classes (125+), they can perform all the heavy lifting (blending and resampling) on the small feature set and only "expand" to the full class list at the very last millisecond.

Figure 2. Our pipeline computes the same label map as the canonical one, with 1.3 instead of 76 GB of buffers. Example: the median ENHANCE.PET CT of Fig. 1, with C = 125 and F = 32. Top row: canonical inference applies the affine head H per window; blending B (Gaussian-weighted averaging) and linear resampling R hold C logits per voxel on the working (N) and scanner (M) grids. Bottom row: ours blends F features in a ring (here r = 193), applies H per completed slice, and uses two slices of logits for R, then argmax, fused. Dashed arrow: B commutes with H (Proposition 1). Stack depth denotes channels. Equivalence holds in exact arithmetic (Sec. 3.4).

Datasets

The team evaluated their method on two massive, high-class-count datasets:

  • TotalSegmentator v3: 1,939 CT scans with 117 anatomical classes.
  • ENHANCE.PET: 1,683 whole-body PET/CT studies with 125 classes.
  • They also used BTCV and AMOS datasets to test how their "exact" export compared to the common "nearest-neighbor" approximation.

Key Insights and Ideas

  • The Memory Wall is Optional: We’ve been "materializing" (storing in RAM) massive tensors that we don't actually need to keep. By streaming, we can "segment everything" while "materializing nothing."
  • Unified Models > Specialists: A single model that sees the whole body at once can learn the spatial relationships between organs better than six separate models that only see parts.
  • Exactness Matters: Most current tools use a shortcut (nearest-neighbor upsampling) to save memory, which creates jagged edges. This method provides the exact mathematical result of the full pipeline but at a fraction of the cost.

Key Results

The numbers are, frankly, startling:

  • Memory Reduction: Peak RAM dropped from 76 GB to 1.3 GB for a 125-class scan.
  • Speedup: The end-to-end process is 5.8x to 15x faster than the current industry standards. A whole-body segmentation that used to take minutes now takes about 10 seconds.
  • Hardware Accessibility: The entire 117-class model now runs comfortably on a GPU with under 8 GB of VRAM, meaning it can run on a standard gaming laptop.
  • Performance: The single unified model matched or slightly outperformed the ensembles of six specialist models in segmentation quality (Dice score).
Figure 1. Many-class 3D segmentation does not need image- sized logits. Top: the standard (canonical) pipeline holds logits for every class over the whole volume (left). Every step after the net- work is local along one axis, so the logits can be streamed through a ring of slices (middle). The classification head commutes with blending, so the ring can hold features instead of logits (right). All three compute the same label map in exact arithmetic. Bottom: buffer size vs. the number of classes; only the feature ring stays flat. Sizes for a median ENHANCE.PET CT, at 125 classes.

Limitations and Future Work

  • Training Memory: While inference (running the model) is now incredibly lean, training these massive unified models still requires significant hardware (though the authors did introduce tricks to make it 12% faster and fit on a 48 GB GPU).
  • Architecture Specificity: The "commuting" trick requires a pointwise affine head (like a 1x1x1 convolution). While this covers almost all modern U-Net and Transformer architectures, it wouldn't work for decoders that take the class as an input (like VoxTell).
  • Broader Application: The authors focused on medical CT/PET, but suggest this could be applied to any dense 3D prediction task, such as volumetric microscopy or 3D scene understanding.

Summary updated

Abstract

Whole-body segmentation tools such as TotalSegmentator and MOOSE split more than 100 classes across five or six networks. The reason is memory. Standard 3D inference, as implemented in nnU-Net and MONAI, holds a logit for every class and voxel, on the working grid and again on the scanner's grid. For a median whole-body CT at 125 classes, that is 76 GB. We show that this memory wall lies in what inference materializes, not in the task, and remove it without approximation. Every step after the network is local along one axis, so its outputs can be streamed through a ring one patch thick. The classification head commutes with blending and resampling, so the ring carries the network's features instead of the class logits. Memory thus no longer grows with classes times volume, and the label map on the scanner's grid stays exact. This holds for any model with a pointwise affine head, without retraining. Many-class models, previously impractical, become deployable. One model trained on all classes matches or slightly exceeds the toolkits' five or six specialists in segmentation quality and runs 5.8-15x faster end to end, with 3.2-7.6x less RAM and under 8 GB of VRAM. We provide the method as a drop-in for nnU-Net, TotalSegmentator and MOOSE. The code is part of nnU-Net (https://github.com/MIC-DKFZ/nnUNet), and unified models for both toolkits will be released.
BibTeX
@misc{isensee2026segment,
  author = {Fabian Isensee and Jakob Wasserthal and Lalith Kumar Shiyam Sundar and Maximilian Rokuss and Moritz Langenberg and Constantin Ulrich Harsy and Stefan Michael Happold and Klaus H. Maier-Hein},
  title = {{Segment Everything, Materialize Nothing: Exact Streaming Inference for Many-Class 3D Segmentation}},
  year = {2026},
  eprint = {2611.27630},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.27630},
}
Figure