TL;DR
Modern medical AI can map over a hundred organs and bones in a CT scan, turning routine checkups into treasure troves of preventive health data—except doing so takes minutes per scan, creating a massive computational bottleneck at hospital scales. FlashSegmentator overhauls the software pipeline around the popular TotalSegmentator model, speeding up CT processing by up to 58x (and MRI by 94x) without changing a single model weight or losing a shred of accuracy. It drops the cloud computing bill for 10,000 scans from nearly $1,000 to under $30.
What Problem Does This Paper Address?
Every day, hospitals acquire thousands of CT and MRI scans. Recently, an open-source deep learning tool called TotalSegmentator revolutionized radiology research by automatically outlining (segmenting) 117 different anatomical structures in 3D CT volumes. This enables "opportunistic screening"—say, checking a patient's bone density or muscle mass from a scan ordered for a stomach ache, with zero extra radiation.
The catch? Scale. The standard TotalSegmentator pipeline takes 1 to 4 minutes per scan. Analyzing a hospital archive of 100,000 scans occupies a GPU for months. Previously, if you wanted to go faster, you either ran TotalSegmentator in lower-resolution modes (which turns delicate structures like ribs into jagged, fragmented blocks) or used FastSegmentator, a GPU-accelerated rewrite that still leaves massive amounts of GPU compute sitting idle because it processes scans one patch at a time, sequentially.
Methods
Instead of training a new neural network or pruning weights, the authors treated this purely as a systems engineering puzzle. Keeping the exact same pretrained neural networks (five 3D nnU-Net models for CT; two for MRI), they built FlashSegmentator on top of FastSegmentator by introducing six inference-level optimizations:
- Static-shape compilation: Compiling the networks once via PyTorch 2 (
torch.compile) with fixed input shapes (zero-padding incomplete batches) to fuse GPU operations. - cuDNN autotuning: Benchmarking and locking in the fastest convolution algorithms at runtime.
- CPU–GPU Pipelining: Processing scans in groups of four across three overlapping stages—while the GPU runs inference on group $k$, background CPU threads load/resample group $k+1$ and write outputs for group $k-1$.
- Batched sliding-window inference: Pooling 3D image patches across the four scans in a group and feeding them to the GPU in batches rather than one by one.
- Full GPU postprocessing: Converting network probabilities to labels and merging the ensemble's five 3D maps entirely on the GPU to avoid sluggish CPU-GPU memory transfers.
- Smarter output writing: Reusing input image headers (instead of re-reading files) and saving compact 8-bit label files.
They also tested an optional body cropping step that trims empty air around the patient before inference, cutting patch counts by ~25%.
Datasets
No models were trained in this study. Evaluation relied on four public, de-identified datasets (no new benchmarks were introduced):
- TotalSegmentator CT (v2.0.1): 73 test scans (117 structures) for throughput and accuracy, plus 512 training scans to test multi-process scaling. (Note: 16 of the original 89 test scans were excluded from baseline comparisons because slightly non-orthonormal header matrices caused the reference tools—though not FlashSegmentator—to crash).
- Beyond the Cranial Vault (BTCV): 30 abdominal CT scans with manual human annotations (13 structures) as an external accuracy check.
- TotalSegmentator MRI (v2.0.0): 55 test MRI scans (50 structures; 49 used for accuracy after excluding 6 with empty reference masks).
Key Insights and Ideas
- The GPU was starving, not slow: On an NVIDIA A100, standard TotalSegmentator uses an average of just 7% of the GPU; compiled FastSegmentator hits 48%. By overlapping I/O with batched execution, a single FlashSegmentator process achieves 93% GPU utilization.
- Brute-force parallelization hits a wall: A common trick to fill an idle GPU is spawning dozens of parallel jobs (
xargs -P). Even with 32 concurrent processes on an A100, the reference tool maxed out at 482 scans/hour before bottlenecking—still nearly 4x slower than a single FlashSegmentator process. - PyTorch compilation beat specialized engines: Static-shape
torch.compiledelivered the single biggest speedup. Surprisingly, exporting to TensorRT, ONNX Runtime, or fusing the five networks into grouped convolutions didn't beat compiled PyTorch. - You don't have to trade accuracy for speed: TotalSegmentator's built-in
--fastand--fastestmodes drop accuracy (Dice score) by 11.6% and 24.1%, severely degrading thin bones and vessels. FlashSegmentator preserves full-resolution accuracy while running 8 to 10 times faster than those degraded modes.
Key Results
Tested across data-center (NVIDIA GH200, A100) and entry-level (T4) GPUs:
- CT Throughput: Processed 3,782 (GH200), 1,810 (A100), and 270 (T4) scans/hour—representing 57.7x, 33.9x, and 6.4x speedups over the reference tool, and 3.2x, 2.5x, and 1.22x over compiled FastSegmentator. Optional body cropping pushed GH200 throughput to 4,695 scans/hour (71.7x).
- MRI Throughput: Achieved a 94x speedup on A100 (0.27s vs. 25.8s per scan).
- Accuracy Equivalence: Using statistical equivalence testing (margin $\pm 0.01$ Dice), FlashSegmentator matched the reference implementation across all 117 CT structures on all GPUs (mean Dice difference $\le 1.2 \times 10^{-5}$) and all 50 MRI structures. On BTCV, examination-level scores were equivalent (12/13 structures met the strict margin; portal/splenic veins missed by 0.0005 due to minor resampling differences).
- Cloud Cost: Processing 10,000 CT scans on an Azure A100 VM plummeted from $997** (reference) to **$29 ($22 with body cropping), and to **$20** on a budget T4 VM. Segmented at standard resolution, 100,000 scans would take ~26 hours on one GH200.
Limitations and Future Work
- Real-world hospital bottlenecks: Timing experiments measured file-to-file execution once per condition. In actual clinical deployment, sustaining ~3,800 scans/hour will likely be bottlenecked by hospital PACS network retrieval speeds, disk storage I/O, and DICOM-to-NIfTI file conversion.
- Memory constraints on smaller GPUs: Running concurrent processes wasn't tested on the 16GB T4 GPU due to memory limits, and minor resampling variations can occur on scans not already at 1.5-mm resolution.
- Scope of models: Only TotalSegmentator's primary whole-body CT and MRI tasks were evaluated; extending and verifying these pipeline optimizations on organ-specific sub-tasks or other 3D segmentation architectures remains future work.
Summary updated