betaFeedback

WorksComputer Science

FlashSegmentator: High-Throughput TotalSegmentator Inference without Loss of Accuracy

Abstract

Purpose: To develop, evaluate, and publicly release FlashSegmentator, an open-source inference pipeline that increases the throughput of TotalSegmentator without retraining or loss of segmentation accuracy. Materials and Methods: This retrospective study used public datasets: 73 CT examinations from the TotalSegmentator test split (median age, 65 years; 37 male, 35 female, one unknown), 30 abdominal CT examinations from the Beyond the Cranial Vault (BTCV) dataset, 512 training-split CT examinations for concurrent-process analysis, and 55 MRI examinations. FlashSegmentator adds static-shape compilation, pipelining, batched sliding-window inference, and GPU postprocessing. Throughput was compared with the reference implementation (including its lower-resolution modes) and FastSegmentator on GH200, A100, and T4 GPUs. Dice agreement was tested with two one-sided tests (margin, +/-0.01). Results: FlashSegmentator processed 3782, 1810, and 270 examinations per hour on the GH200, A100, and T4 (57.7, 33.9, and 6.4 times the reference implementation and 3.20, 2.50, and 1.22 times compiled FastSegmentator). Dice scores were equivalent for all 117 structures on every GPU (mean difference <= 1.2 x 10^-5; P < .001) and at the examination level on BTCV. In contrast, the lower-resolution modes of the reference implementation processed 181 and 213 examinations per hour on the A100 but reduced mean Dice by 0.116 and 0.241. On MRI, throughput increased 94-fold with all 50 structures equivalent. Estimated A100 cloud cost per 10,000 examinations decreased from 997 to 29 US dollars. Conclusion: FlashSegmentator increased the throughput of TotalSegmentator on data center and entry-level GPUs without loss of segmentation accuracy compared with the reference implementation.

Introduction

Automated whole-body CT segmentation has made it possible to extract quantitative imaging biomarkers from routinely acquired CT examinations. TotalSegmentator, a deep learning model based on the nnU-Net framework, segments more than 100 anatomic structures on CT and has been widely adopted in research [1]. Its outputs have been used for the opportunistic assessment of conditions that are not the primary indication for imaging, such as sarcopenia, cardiometabolic risk, osteoporosis, and organ enlargement [2, 3, 4, 5], and automated segmentation has been applied to tens of thousands of CT examinations to establish age- and sex-specific reference charts of organ volumes and attenuation [6, 7, 8, 9].

Because such measurements require no additional radiation exposure or cost, there is growing interest in applying them to all CT examinations in an institution or to entire imaging archives [3, 10].

Applying such tools at this scale, however, is limited by inference time. With the reference implementation, segmenting a single examination takes approximately 1–4 minutes on a high-end consumer GPU [1], so that processing the tens to hundreds of thousands of CT examinations accumulated at one institution can occupy a GPU for weeks to months, particularly with the less powerful GPUs available at many institutions. The same burden recurs whenever a cohort must be reprocessed with an updated model, and prospective use, such as segmenting every examination on the day of acquisition, requires processing that keeps pace with daily scan volume.

Existing approaches to shortening inference either run the model at a coarser resolution, as in the lower-resolution modes of TotalSegmentator, at the cost of segmentation accuracy, or make more efficient use of the GPU. Restricting the task to selected structures is not applicable when whole-body quantification is required. FastSegmentator, an open-source reimplementation of the TotalSegmentator inference pipeline, moves preprocessing and postprocessing to the GPU and reproduces the reference outputs substantially faster [11]; however, like the reference implementation, it processes examinations sequentially, one image patch at a time, so that much of the GPU capacity remains unused.

Whether inference-level optimizations alone, without changing the trained model, can substantially increase throughput has not been systematically evaluated. In general-purpose deep learning, batching, overlapping data loading with computation, and compilation are routinely used to improve GPU utilization [12], but medical image segmentation pipelines involve large three-dimensional volumes, resampling to and from a fixed resolution, and an ensemble of networks, so that the benefit of each optimization may depend on the GPU used. Moreover, because any change to the computation can alter the output at the voxel level, an accelerated pipeline must be shown not to reduce accuracy relative to the reference implementation before it can be used in its place.

The purpose of this study was to develop and evaluate FlashSegmentator, an optimized inference pipeline for TotalSegmentator that increases throughput without loss of segmentation accuracy. We compared its throughput with that of the reference implementation, including its lower-resolution modes, and FastSegmentator on three GPU classes, compared segmentation accuracy with that of the reference implementation on two public datasets, and examined its application to the MRI model.

Materials and Methods

Study design and data

This retrospective study used only publicly available, deidentified datasets; institutional review board approval was therefore not required.

The following datasets were used. (1) TotalSegmentator dataset version 2.0.1 [1, 13]: the 89 CT examinations of the official test split, with reference standard segmentations of the 117 structures of the total task created by the dataset authors with model assistance and human review. Sixteen examinations, whose image headers contained direction cosines that were not exactly orthonormal and for which the reference implementation and FastSegmentator failed when writing the output, were excluded from all comparisons, leaving 73 examinations. (2) Multi-Atlas Labeling Beyond the Cranial Vault (BTCV) abdomen dataset [14]: 30 training CT examinations with manual segmentations of 13 abdominal structures, to which the corresponding TotalSegmentator labels were mapped. (3) For the analysis of concurrent processes only, 512 CT examinations randomly selected from the training split of the TotalSegmentator dataset (after the same exclusion as above); reference standard segmentations were not used. (4) TotalSegmentator MRI dataset version 2.0.0 [15, 16]: the 55 MRI examinations of the official test split (50 structures of the total_mr task); six examinations with empty reference standard masks were excluded from the Dice analysis.

Segmentation model

All implementations used the same pretrained TotalSegmentator total model for CT (five nnU-Net [17] networks at 1.5-mm isotropic resolution) with unchanged weights and identical inference settings (patch size 128×128×128128 \times128 \times128 voxels, step size 0.8, Gaussian weighting, no test-time mirroring, fp16 mixed precision). For MRI, the pretrained total_mr model (two networks) was used in the same way.

Implementations compared

The reference implementation was TotalSegmentator version 2.18.0 (https://github.com/wasserth/TotalSegmentator), run through its command-line interface with one call per examination, as in typical use. Because it has no built-in option for parallel processing, it was also run as multiple concurrent calls (xargs -P). Its lower-resolution modes, --fast (3 mm) and --fastest (6 mm), were also evaluated. FastSegmentator (https://github.com/bowang-lab/FastSegmentator) loads the models once and processes examinations sequentially; it was evaluated with and without its built-in compilation option.

FlashSegmentator (this study) was built on FastSegmentator, with preprocessing, network, and postprocessing semantics unchanged, and incorporated six modifications (Figure 1):

Processing flow of the reference implementation, FastSegmentator, and FlashSegmentator

Figure 1. Processing flow of the reference implementation (TotalSegmentator command-line interface), FastSegmentator, and FlashSegmentator for the CT total task. White boxes indicate CPU steps, green boxes GPU steps, and dashed gray boxes steps performed once per run. FlashSegmentator processes the examinations in groups of four in a three-stage pipeline, in which loading of group k+1k+1, inference on group kk, and resampling back and writing of group k−1k-1 run at the same time. Circled numbers correspond to the modifications listed in Materials and Methods. MRI follows the same flow with two networks.

  1. Static-shape compilation: each network was compiled once with PyTorch 2 (torch.compile) [12], which fuses its operations into optimized GPU code, for a fixed input shape (static shape); incomplete batches were zero-padded.

  2. cuDNN autotuning: the fastest convolution algorithm for each layer was selected by benchmarking at run time.

  3. Pipelining: examinations were processed in groups of four; while the GPU processed the current group, CPU threads read and resampled the next group and wrote the previous one.

  4. Batched sliding window: image patches from all examinations of a group were pooled and passed through each network in batches.

  5. GPU postprocessing: conversion of network outputs to labels and merging of the five label maps were performed on the GPU.

  6. Output writing: the header read with the input was reused instead of re-reading the input image, and 8-bit labels were written.

The batch size was 8 on the GH200 and 4 on the A100 and T4. As an option, FlashSegmentator can crop the image to the bounding box of the body before inference, which reduced the number of patches by approximately 25% but makes the output not identical to that of the reference implementation; it was therefore evaluated separately (details in Supplemental Material).

On the GH200, the contribution of each modification was assessed by adding the modifications cumulatively. Alternatives not adopted (TensorRT, ONNX Runtime, network fusion, channels-last layout) were compared with the compiled PyTorch networks by network forward time on the GH200.

Hardware and software

Three GPU environments were used: an NVIDIA GH200 Grace Hopper Superchip in a node of the Miyabi-G supercomputer (Information Technology Center, The University of Tokyo) and NVIDIA A100 and T4 GPUs in Microsoft Azure virtual machines (Japan East region), all with PyTorch 2.11.0 and CUDA 12.8. One GPU was used for every run, and all implementations on a given machine shared the same weight files. GPU and CPU models, memory, software versions, and the conditions evaluated on each platform are listed in Table S1.

ItemGH200A100T4
PlatformMiyabi-G supercomputer node (Information Technology Center, The University of Tokyo)Microsoft Azure virtual machine, NC24ads_A100_v4 (Japan East)Microsoft Azure virtual machine, NC4as_T4_v3 (Japan East)
GPUNVIDIA GH200 Grace Hopper Superchip (H100-class GPU)NVIDIA A100 PCIeNVIDIA T4
GPU memory96 GB HBM380 GB HBM2e16 GB GDDR6
CPUNVIDIA Grace, 72 Arm Neoverse V2 coresAMD EPYC 7V13, 24 vCPUsAMD EPYC 7V12, 4 vCPUs
System memory120 GB LPDDR5X220 GiB28 GiB
NVIDIA driver615.71.09580.178.04580.178.04
Python3.11.153.11.183.11.18
PyTorch (CUDA)2.11.0 (12.8)2.11.0 (12.8)2.11.0 (12.8)
Data setsTS test (73), BTCV (30), TS train (512)TS test (73), TS MRI test (55), TS train (512)TS test (73)
ImplementationsReference, FastSegmentator (± compilation), FlashSegmentatorReference (standard, --fast, --fastest), FastSegmentator (± compilation), FlashSegmentatorReference, FastSegmentator (± compilation), FlashSegmentator
FlashSegmentator batch size (main analysis)844 (2 with body cropping)
Batch sizes evaluated2, 4, 8, 162, 4, 81, 2, 4
Concurrent processes evaluatedOthers 1–16 (reference not evaluated)Reference 8, 16, 32 calls; others 1, 4, 8Not evaluated
Reference timingPer command-line call, including start-up and model loadingSame as GH200Same as GH200

Table S1. Hardware, Software, and Inference Settings of Each Platform

Timing

Throughput was the number of examinations divided by the wall-clock time from the start of the first to the completion of the last examination, including input reading and output writing. One warm-up examination was processed before timing, and model loading and one-time compilation of FastSegmentator and FlashSegmentator were excluded; reference times included start-up and model loading of each call.

Concurrent processes and cost

Because a single process may not fully use a GPU, each implementation was also run as concurrent processes on one GPU, using the 512 training-split examinations on the GH200 and A100 (the reference implementation on the A100 only, because concurrent calls exceeded the process limit of the GH200 node). For FastSegmentator and FlashSegmentator, the examinations were divided among KK processes, and throughput was the total number of examinations divided by the time of the longest-running process. Processing cost per 10,000 examinations on Azure virtual machines was calculated from throughput and the pay-as-you-go list price.

Application to MRI

On the A100, the reference implementation and FlashSegmentator (batch size 4, without body cropping) were compared on the 55 test MRI examinations.

Statistical analysis

Although designed to be mathematically equivalent, outputs could differ slightly owing to floating-point arithmetic order and resampling; agreement was therefore tested. The Dice similarity coefficient was calculated for each structure present in the reference standard, and per-examination means were averaged. Agreement between implementations was assessed with paired differences of Dice at the examination level and the structure level (structures present in at least three examinations) using two one-sided tests (TOST) [18] with an equivalence margin of ±0.01\pm0.01 (90% CI within the margin). Body cropping was assessed for noninferiority with the same margin. Analyses used Python 3 with NumPy and SciPy.

Results

Dataset characteristics

The 16 excluded examinations (see Materials and Methods) had a shorter scan range (median, 288 vs 429 mm) and included three head CT examinations; FlashSegmentator, which reuses the input header, processed all 16 (mean Dice, 0.9452). All 30 BTCV examinations were processed by every implementation. The 55 MRI test examinations covered various body regions and sequences (spin-echo and gradient-echo; 1.5 and 3 T), with thicker sections and smaller images than the CT examinations (Table S2).

CharacteristicTotalSegmentator test (n = 73)TotalSegmentator train, concurrent-process analysis (n = 512)BTCV (n = 30)TotalSegmentator MRI test (n = 55)
Age (y)*65 (52–74)65 (56–76)NA57 (45–67)
Sex, male/female/unknown37/35/1297/214/1NA20/19/16
Manufacturer, Siemens/GE/Philips/unknown45/9/6/13451/25/36/0NA34/14/5/2
Magnetic field strength, 1.5 T/3 T/unknownNANANA28/25/2
Voxel spacing (mm)1.5 isotropic1.5 isotropic0.6–1.0 in-plane, 2.5–5.0 section0.8 (0.5–1.2) in-plane, 3.3 (3.0–4.8) section*
Number of sections*286 (219–370)240 (156–393)128 (97–148)36 (26–75)
Scan range (mm)*429 (329–555)361 (234–590)445 (421–490)216 (160–278)
Image size (million voxels)*17.7 (11.7–28.1)13.5 (6.4–24.2)33.4 (25.3–38.7)6.7 (3.3–9.3)
Reference standard structures117Not used1350

Table S2. Characteristics of the Datasets

Throughput

FlashSegmentator processed 3782, 1810, and 270 examinations per hour on the GH200, A100, and T4, respectively: 57.7, 33.9, and 6.4 times the reference implementation and 3.20, 2.50, and 1.22 times FastSegmentator with compilation (Table 1). With body cropping, throughput increased to 4695, 2374, and 362 examinations per hour.

GPUImplementationTime per examination (s)Examinations per hourRelative throughput
GH200TotalSegmentator55.065.51.0
GH200FastSegmentator3.26110416.9
GH200FastSegmentator, compiled3.05118218.0
GH200FlashSegmentator (B = 8)0.95378257.7
GH200FlashSegmentator (B = 8), body cropping†0.77469571.7
A100TotalSegmentator67.453.41.0
A100FastSegmentator5.2268912.9
A100FastSegmentator, compiled4.9772413.6
A100FlashSegmentator (B = 4)1.99181033.9
A100FlashSegmentator (B = 4), body cropping†1.52237444.5
T4TotalSegmentator84.842.51.0
T4FastSegmentator18.02004.7
T4FastSegmentator, compiled16.32215.2
T4FlashSegmentator (B = 4)13.32706.4
T4FlashSegmentator (B = 2), body cropping†9.953628.5

Table 1. Throughput on Three GPUs (TotalSegmentator Test Set, n=73n = 73)

Relative throughput is relative to the reference implementation on the same GPU. Reference times include start-up and model loading of each command-line call. † Optional body cropping (Table S5); on the GH200 measured in a separate run in which FlashSegmentator without cropping processed 3723 examinations per hour.

GPUWithout cropping (per hour)With cropping (per hour)RatioDice with croppingDifference vs reference [90% CI]Structures noninferior
GH200 (B = 8)372346951.260.93880+0.0012 [0.0002, 0.0021]106/117
A100 (B = 4)181023741.310.93878+0.0011 [0.0002, 0.0021]106/117
T4 (B = 2)2653621.370.93878+0.0011 [0.0002, 0.0021]106/117

Table S5. Throughput and Noninferiority of FlashSegmentator with Body Cropping (TotalSegmentator Test Set, n=73n = 73). Noninferiority margin −0.01 Dice. Reference implementation mean Dice, 0.93765.

Concurrent processes

On the 512 examinations, FlashSegmentator was fastest with a single process (GH200, 4707 examinations per hour; A100, 2263 per hour), and additional processes decreased its throughput (Figure 2, Table S3). Compiled FastSegmentator was fastest with four processes (GH200, 3079 per hour; A100, 1707 per hour), and the reference implementation reached 482 examinations per hour with 32 concurrent calls on the A100. Mean GPU utilization of the reference implementation, compiled FastSegmentator, and FlashSegmentator was 7%, 48%, and 93% with a single process and 45%, 97%, and 99% with multiple processes (Figure 3). With the best configuration of each implementation, FlashSegmentator was 1.53 (GH200) and 1.33 (A100) times faster than compiled FastSegmentator and 4.7 times faster than the reference implementation on the A100.

Aggregate throughput with concurrent processes on one GPU

Figure 2. Aggregate throughput with concurrent processes on one GPU (512 examinations from the training split of the TotalSegmentator dataset). The reference implementation was run as N concurrent command-line calls, and FastSegmentator (compiled) and FlashSegmentator as K concurrent processes; throughput is the number of examinations divided by the processing time of the longest-running process. Configurations that ran out of GPU memory are not shown. Numerical values, including out-of-memory configurations and smaller batch sizes for FlashSegmentator, are given in Table S3.

GPU utilization during processing of the 512 training-split examinations on the A100

Figure 3. GPU utilization during processing of the 512 training-split examinations on the A100 (10 minutes, starting 2 minutes after the first GPU activity), recorded with nvidia-smi at intervals of approximately 2 seconds. (A) One process; (B) multiple concurrent processes (reference implementation, 32 command-line calls; compiled FastSegmentator, four processes; FlashSegmentator, two processes). Rows show, from top, the reference implementation (command-line calls), compiled FastSegmentator,

GPUImplementation12481632
GH200TotalSegmentatorNENENENENENE
GH200FastSegmentator, compiled1287169630793067OOM—
GH200FlashSegmentator (B = 8)470744302476OOMOOM—
GH200FlashSegmentator (B = 4)——4444———
GH200FlashSegmentator (B = 2)——4260OOM——
GH200FlashSegmentator (B = 1)———OOM——
GH200FlashSegmentator, body cropping (B = 8)602358965872OOM——
A100TotalSegmentator———354471482
A100FastSegmentator, compiled865108817071606——
A100FlashSegmentator (B = 4)226321041580———
A100FlashSegmentator (B = 2)——2096———
A100FlashSegmentator, body cropping (B = 4)293127802456———

Table S3. Aggregate Throughput (Examinations per Hour) with Concurrent Processes on One GPU (512 Training-Split Examinations)

and FlashSegmentator (batch size 4). The mean over the 10 minutes is shown at the upper right of each panel.

Segmentation accuracy

FlashSegmentator was equivalent to the reference implementation on the GH200, A100, and T4, at the examination level and for all 117 structures (Table 2); on the GH200, mean Dice was 0.93765 for the reference implementation, 0.93765 for FastSegmentator, and 0.93766 for FlashSegmentator. The widest structure-level 90% CI bound was 0.0021. Of the 5329 examination–structure pairs on the GH200, the largest absolute Dice difference was 0.026 (99th percentile, 0.0004). On BTCV, whose images are resampled to 1.5 mm before inference, FlashSegmentator was equivalent to the reference implementation at the examination level (mean difference, −0.0015; 90% CI: −0.0026, −0.0004); 12 of 13 structures were equivalent, and the portal and splenic veins narrowly missed the margin (lower 90% CI bound, −0.0105).

Dataset (GPU)ComparisonnMean difference [90% CI]Structures equivalentWidest structure CI bound
TS test (GH200)FastSegmentator vs reference731.3×10−61.3 \times10^{-6} [−1.7×10−6-1.7 \times10^{-6}, 4.4×10−64.4 \times10^{-6}]117/1170.0006
TS test (GH200)FlashSegmentator vs reference739.7×10−69.7 \times10^{-6} [−2.8×10−6-2.8 \times10^{-6}, 2.2×10−52.2 \times10^{-5}]117/1170.0021
TS test (A100)FlashSegmentator vs reference731.1×10−51.1 \times10^{-5} [8.3×10−78.3 \times10^{-7}, 2.1×10−52.1 \times10^{-5}]117/1170.0006
TS test (T4)FlashSegmentator vs reference731.2×10−51.2 \times10^{-5} [1.8×10−61.8 \times10^{-6}, 2.3×10−52.3 \times10^{-5}]117/1170.0013
BTCV (GH200)FlashSegmentator vs reference30−1.5×10−3-1.5 \times10^{-3} [−2.6×10−3-2.6 \times10^{-3}, −4.2×10−4-4.2 \times10^{-4}]12/130.0105

Table 2. Equivalence of Dice Scores between Implementations (TOST, Margin ±0.01)

Body cropping increased throughput by a factor of 1.26–1.37 and was noninferior to the reference implementation at the examination level on each GPU (difference, +0.0011; 90% CI: 0.0002, 0.0021), with 106 of 117 structures noninferior (Table S5). On BTCV, it did not change Dice compared with FlashSegmentator without cropping (difference, +0.0001; 90% CI: −0.0009, 0.0011).

Comparison with the lower-resolution modes

The --fast and --fastest modes of the reference implementation processed 181 and 213 examinations per hour on the A100, compared with 53.4 for the standard mode and 1810 for FlashSegmentator (Table 3). They reduced mean Dice by 0.116 and 0.241, most for thin or small structures (decrease of more than 0.2 in 12 and 74 structures; for example, the sixth cervical vertebra, 0.944 to 0.600 and 0.444), whereas the mean Dice of FlashSegmentator differed from the standard mode by 0.00001. In an example examination, the lower-resolution modes produced coarse, stair-stepped surfaces and fragmented ribs, whereas the output of FlashSegmentator preserved the same structures as that of the standard mode (Figure 4).

Three-dimensional surface renderings of the segmentation

Figure 4. Three-dimensional surface renderings of the segmentation of one TotalSegmentator test examination (114 structures in the reference standard) by the reference implementation in the standard, --fast, and --fastest modes and by FlashSegmentator without and with body cropping. (A) Anterior oblique view of the whole scan range. (B) Close-up of the neck and upper thorax. Each structure has the same color in all panels. Dice is the mean over the structures in the reference standard of this examination.

Structure groupStructuresTotalSegmentator, standardTotalSegmentator, --fastTotalSegmentator, --fastestFlashSegmentator (B = 4)
Examinations per hour531812131810
Mean Dice, all structures1170.9380.8210.6970.938
Organs and others320.8830.7950.7010.883
Vertebrae250.9520.8060.6780.952
Ribs240.9540.7650.5770.954
Vessels130.9170.7860.6140.917
Muscles100.9720.9150.8560.972

Table 3. Throughput and Mean Dice by Structure Group for the Lower-Resolution Modes (TotalSegmentator Test Set, n = 73)

All values were obtained on the A100 (batch size 4 for FlashSegmentator); as in Table 1, each command-line call of the reference implementation included start-up and model loading. Structures were grouped by name; the remaining 13 structures (bones of the limbs and girdles, sacrum, sternum, and skull) were not grouped.

Contribution of each modification

Static-shape compilation gave the largest gain (Table 4); it reduced the forward time per patch per network at batch size 8 from 8.10 to 5.55 ms.

ConfigurationBatch sizeExaminations per hourRelative to FastSegmentator
FastSegmentator111041.00
+ Batched sliding window and pipelining416701.51
+ GPU postprocessing and faster output writing422832.07
+ Static-shape compilation235413.21
+ cuDNN autotuning, batch size 8 (final)837823.43

Table 4. Cumulative Effect of Each Modification on the GH200 (TotalSegmentator Test Set, n = 73)

Effect of batch size

Throughput varied by less than 7% across batch sizes on every GPU, whereas peak GPU memory increased up to twofold with batch size (Figure S1). The highest throughput was obtained at a batch size of 8 on the GH200 and 4 on the A100 and T4.

Throughput of FlashSegmentator by batch size on each GPU

Figure S1. Throughput of FlashSegmentator by batch size on each GPU (TotalSegmentator test set, n = 73). Labels show examinations per hour and peak GPU memory.

Comparison of inference backends and network configurations

TensorRT, ONNX Runtime, fusion of the five networks into one grouped-convolution network, and a channels-last memory layout did not shorten the forward pass compared with the compiled PyTorch network (Table S6) and were not adopted.

ConfigurationBatch size 1Batch size 8
PyTorch, compiled (adopted)6.815.55
PyTorch, not compiled13.408.10
TensorRT, FP1610.79.2
TensorRT, FP3214.412.5
ONNX Runtime (CUDA)16.415.2
Five networks fused (grouped convolution), compiled8.24NA
Channels-last memory layout, compiledNA5.62

Table S6. Network Forward Time by Inference Backend and Network Configuration (GH200).

Processing cost on cloud virtual machines

Per 10,000 examinations, the processing cost on the A100 virtual machine was US $997 for the reference implementation run one call at a time (US $110 with 32 concurrent calls) and US $29 for FlashSegmentator (US $22 with body cropping); on the T4 virtual machine, it was US $167, US $26, and US $20 (Figure 5, Table S4).

Estimated processing time and cost per 10,000 examinations on Azure virtual machines

Figure 5. Estimated processing time and cost per 10,000 examinations on Azure virtual machines (both axes logarithmic). Cost is the virtual machine time multiplied by the pay-as-you-go list price on November 18, 2026 (Linux, Japan East: NC24ads_A100_v4 for the A100, US $5.326 per hour; NC4as_T4_v3 for the T4, US $0.71 per hour), excluding storage and data transfer; the gray lines connect points of equal hourly price. Throughput was measured on the TotalSegmentator test set (Table 1), except for 32 concurrent calls of the reference implementation, which was measured on the 512 training-split examinations (Table S3). Numerical values are given in Table S4.

Virtual machine (list price)ConfigurationExaminations per hourVirtual machine hoursCost (US $)
A100 (US $5.326/h) | TotalSegmentator, one call at a time | 53.4 | 187.3 | 997
A100 (US $5.326/h) | TotalSegmentator, 32 concurrent calls‡ | 482 | 20.7 | 110
A100 (US $5.326/h) | FastSegmentator | 689 | 14.5 | 77
A100 (US $5.326/h) | FastSegmentator, compiled | 724 | 13.8 | 74
A100 (US $5.326/h) | FastSegmentator, compiled, 4 processes‡ | 1707 | 5.9 | 31
A100 (US $5.326/h) | FlashSegmentator | 1810 | 5.5 | 29
A100 (US $5.326/h) | FlashSegmentator, body cropping | 2374 | 4.2 | 22
T4 (US $0.71/h) | TotalSegmentator, one call at a time | 42.5 | 235.3 | 167
T4 (US $0.71/h) | FastSegmentator | 200 | 50.0 | 36
T4 (US $0.71/h) | FastSegmentator, compiled | 221 | 45.2 | 32
T4 (US $0.71/h) | FlashSegmentator | 270 | 37.0 | 26
T4 (US $0.71/h) | FlashSegmentator, body cropping | 362 | 27.6 | 20

Table S4. Estimated Processing Time and Cost per 10,000 Examinations on Azure Virtual Machines. Calculated from the measured throughput (Table 1 and Table S3) and the pay-as-you-go list price on November 18, 2026 (Linux, Japan East: NC24ads_A100_v4 for the A100, NC4as_T4_v3 for the T4); storage and data transfer excluded. ‡ Measured on the 512 training-split examinations (Table S3); other rows, TotalSegmentator test set (Table 1).

Throughput and segmentation agreement on MRI

On the A100, FlashSegmentator processed the 55 test MRI examinations in 0.27 seconds per examination, compared with 25.8 seconds for the reference implementation, a 94-fold increase in throughput (Table S7). Mean Dice was 0.78157 for the reference implementation and 0.78158 for FlashSegmentator; the per-examination difference was 1.4×10−51.4 \times10^{-5} (90% CI: −1.0×10−5-1.0 \times10^{-5}, 3.8×10−53.8 \times10^{-5}; TOST P<.001P < .001), and all 50 structures met the equivalence criterion (widest structure-level 90% CI bound, 0.0010).

ImplementationTime per examination (s)Examinations per hourRelative throughputMean DiceStructures equivalent
TotalSegmentator25.81401.00.78157—
FlashSegmentator (B = 4)0.2713,139940.7815850/50

Table S7. Throughput and Segmentation Agreement on MRI (A100, TotalSegmentator MRI Test Set)

Discussion

In this study, optimization of the inference pipeline increased the batch-processing throughput of CT examinations while retaining the trained weights and standard resolution of TotalSegmentator. FlashSegmentator processed approximately 3800 examinations per hour on the GH200, and with its default settings its Dice scores were equivalent to those of the reference implementation. These results indicate that, even when an existing model continues to be used, revising its inference implementation can shorten the time needed to process large CT datasets.

A previous study reduced the computation of TotalSegmentator by Tucker decomposition of its convolution kernels and assessed the network forward time [19]; in contrast, the present study kept the model unchanged and assessed throughput per examination, from reading the image to writing the segmentation.

Running several processes on one GPU is a common way to increase throughput, but it requires user-side preparation and did not close the gap. The reference implementation on the A100 reached only 482 examinations per hour with 32 concurrent calls, compared with 471 with 16, indicating that parallelization alone has a ceiling and that the inference itself needs to be made more efficient. FlashSegmentator overlaps CPU and GPU work within one process and already kept the GPU busy with a single process, so that additional processes competed for GPU memory. For larger workloads, assigning one FlashSegmentator process to each GPU is therefore likely to scale better than running several processes on one GPU.

The lower-resolution modes of the reference implementation increase throughput, but they substantially reduced Dice scores for structures such as ribs and some vertebrae. FlashSegmentator retained the accuracy of the standard mode and was still approximately 8 to 10 times faster than the lower-resolution modes on the A100. Dice scores were equivalent on the TotalSegmentator test set and, at the examination level, on BTCV, an external benchmark with manual reference segmentations, where 12 of 13 structures met the equivalence criterion. Because the optional body cropping was not noninferior for all structures, the default settings without cropping appear appropriate for studies that quantify the whole body at standard resolution, including thin and small structures.

In large-scale CT studies, automated segmentation has been applied to datasets of tens of thousands to more than 350,000 examinations. Reference curves for whole-body anatomic volumes were derived from approximately 190,000 scans in an institutional PACS and two external datasets [7], and whole-body attenuation and volume charts were constructed from more than 350,000 CT examinations after filtering pathologic findings from the reports with large language models [6]. In a study of abdominal organ volumes using the Japan Medical Image Database (J-MID), a nationwide Japanese repository of medical images, the lower-resolution mode of TotalSegmentator was used to process approximately 50,000 abdominopelvic CT examinations on a single GPU [8]. A cardiac quantification study in the NLST included approximately 24,000 participants [20], and approximately 130,000 CT series were processed in a distributed manner in the cloud in the NCI Imaging Data Commons [21]. On the basis of the measured throughput of FlashSegmentator, segmentation of 100,000 CT examinations at standard resolution would take approximately 26 hours on a single node with one GH200. If the examinations were divided equally among eight such nodes and each node maintained the same throughput, the processing time would be shortened to approximately 3.3 hours. These estimates provide a guide to the segmentation time required for the initial analysis of a large cohort or for reanalysis after a model update.

Limitations

In this study, the implementations were compared on several GPU environments. Each condition was timed once in principle, and run-to-run variation under identical conditions was not assessed. Concurrent processes were evaluated on 512 training-split examinations on the GH200 and A100 only; on GPUs with less memory, such as the T4, the configurations that can be run concurrently are limited. For images not already at 1.5-mm resolution, small differences from the reference implementation can arise from the implementation of resampling, as observed for one structure on BTCV. The processing time for 100,000 examinations is an estimate that assumes the measured throughput is sustained; the actual time will depend on the computing environment, storage performance, and the time needed for image retrieval from the PACS and DICOM conversion. In addition, the evaluation was limited to the CT total and MRI total_mr tasks of TotalSegmentator, and the extent to which the same optimizations are effective for organ-specific tasks or other segmentation models remains to be investigated.

Conclusion

FlashSegmentator increased batch-processing throughput while retaining the trained weights and standard resolution of TotalSegmentator, with Dice scores equivalent to those of the reference implementation, and can shorten the computation time for the analysis of large CT cohorts.

Acknowledgments

Part of the computations were performed on the Miyabi-G supercomputer at the Joint Center for Advanced High Performance Computing (Information Technology Center, The University of Tokyo, and Center for Computational Sciences, University of Tsukuba). In this research work, we used the UTokyo Azure (https://utelecon.adm.u-tokyo.ac.jp/en/research_computing/utokyo_azure/). UTokyo Azure was used only for the measurements on the NVIDIA A100 and NVIDIA T4 GPUs; all other experiments were performed on other computing resources.

Funding

This work was supported by JST, CREST Grant Number JPMJCR21M2, Japan.

Code and Data Availability

The source code of FlashSegmentator, together with the scripts used for the throughput and agreement analyses, is available at https://github.com/yamagishi0824/FlashSegmentator under the Apache License 2.0. All datasets used in this study are publicly available: the TotalSegmentator CT and MRI datasets on Zenodo [13, 16] and the BTCV dataset [14].

Supplemental Material

Body cropping. Before sliding-window inference, the resampled 1.5-mm image was cropped to the bounding box of the body (voxels above −500 HU after morphologic opening, components of at least 1% of the largest component, 10-voxel margin), and the segmentation was pasted back into a background volume of the original size. Because voxels outside the box are always labeled background and the patch grid changes, the output differs slightly from that of the reference implementation. Body cropping was not used for MRI.

Reference implementation: TotalSegmentator 2.18.0 (commit 8806051) with nnunetv2 2.8.1. FastSegmentator: commit c8040ff. FastSegmentator and FlashSegmentator: the FastSegmentator fork of nnunetv2 (2.5.2). GPU memory is the vendor specification (the GH200 GPU reported 97,871 MiB). CPU models of the Azure virtual machines are those listed by Microsoft for the virtual machine series. TS = TotalSegmentator.

  • Median (interquartile range); age missing for one TotalSegmentator test CT examination and 16 MRI examinations. The training-split examinations were used only for the analysis of concurrent processes. For MRI, section thickness is the largest voxel dimension and scan range is the craniocaudal extent. TotalSegmentator images are distributed resampled to 1.5 mm. NA = not available.

Columns give the number of concurrent processes (reference implementation: concurrent command-line calls). Throughput is 512 examinations divided by the processing time of the longest-running process (reference implementation: total wall-clock time). OOM = at least one process ran out of GPU memory. NE = not evaluated (on the GH200 node, 16 or more concurrent calls of the reference implementation failed because of multiprocessing errors). — = not measured. B = batch size.

Values are milliseconds per patch per network. For the fused network, the time for all five networks (41.2 ms, vs 33.7 ms for the five separate compiled networks) was divided by five. NA = not measured.

Throughput was measured on all 55 examinations; Dice was calculated on the 49 examinations with nonempty reference standard segmentations.

References

  1. [1]Wasserthal J, Breit HC, Meyer MT, et al. TotalSegmentator: robust segmentation of 104 anatomic structures in CT images. Radiol Artif Intell 2023;5(5):e230024. doi:10.1148/ryai.230024DOI
  2. [2]Graffy PM, Liu J, Pickhardt PJ, Burns JE, Yao J, Summers RM. Deep learning-based muscle segmentation and quantification at abdominal CT: application to a longitudinal adult screening cohort for sarcopenia assessment. Br J Radiol 2019;92(1100):20190327. doi:10.1259/bjr.20190327DOI
  3. [3]Pickhardt PJ, Graffy PM, Zea R, et al. Automated CT biomarkers for opportunistic prediction of future cardiovascular events and mortality in an asymptomatic screening population: a retrospective cohort study. Lancet Digit Health 2020;2(4):e192–e200. doi:10.1016/S2589-7500(20)30025-XDOI
  4. [4]Jang S, Graffy PM, Ziemlewicz TJ, Lee SJ, Summers RM, Pickhardt PJ. Opportunistic osteoporosis screening at routine abdominal and thoracic CT: normative L1 trabecular attenuation values in more than 20 000 adults. Radiology 2019;291(2):360–367. doi:10.1148/radiol.2019181648DOI
  5. [5]Tamura A, Fujita K, Ieko Y, et al. Establishment of normative spleen volume in a Japanese cohort using automated CT segmentation: diagnostic implications for liver fibrosis. BMC Gastroenterol 2025;25:775. doi:10.1186/s12876-025-04383-zDOI
  6. [6]Wachinger C, Renger B, Späth C, Kirschke J, Makowski M. Whole body CT attenuation and volume charts from routine clinical scans via LLM report filtering. NPJ Digit Med 2026;9:505. doi:10.1038/s41746-026-02938-2DOI
  7. [7]Wachinger C, Renger B, Späth C, Makowski MR. Body charts from CT segmentations across the adult lifespan: large-scale cross-sectional and longitudinal analyses. Radiol Artif Intell 2026;8:e250506. doi:10.1148/ryai.250506DOI
  8. [8]Kikuchi T, Yamamoto K, Yamagishi Y, et al. Nationwide organ volume distributions and cross-sectional age-associated differences in abdominal CT from Japan. Jpn J Radiol 2026;44:1810–1817. doi:10.1007/s11604-026-02028-zDOI
  9. [9]Yamagishi Y, Kikuchi T, Yamamoto K, Hanaoka S, Yoshikawa T, Abe O. Sex-specific skeletal aging trajectories and reference centiles across vertebrae and ribs in over 78,000 patients. medRxiv [preprint]. 2026. doi:10.64898/2026.10.30.26332028DOI
  10. [10]Pickhardt PJ, Summers RM, Garrett JW, et al. Opportunistic screening: Radiology scientific expert panel. Radiology 2023;307(5):e222044. doi:10.1148/radiol.222044DOI
  11. [11]bowang-lab. FastSegmentator [software]. GitHub. https://github.com/bowang-lab/FastSegmentator (commit c8040ff). Accessed November 18, 2026
  12. [12]Ansel J, Yang E, He H, et al. PyTorch 2: faster machine learning through dynamic Python bytecode transformation and graph compilation. In: Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS ’24), Volume 2. 2024:929–947. doi:10.1145/3620665.3640366DOI
  13. [13]Wasserthal J. Dataset with segmentations of 117 important anatomical structures in 1228 CT images [dataset]. Version 2.0.1. Zenodo; 2023. doi:10.5281/zenodo.10047292
  14. [14]Segmentation Outside the Cranial Vault Challenge (Multi-Atlas Labeling Beyond the Cranial Vault) [dataset]. Synapse; 2015. doi:10.7303/syn3193805
  15. [15]Akinci D’Antonoli T, Berger LK, Indrakanti AK, et al. TotalSegmentator MRI: robust sequence-independent segmentation of multiple anatomic structures in MRI. Radiology 2025;314(2):e241613. doi:10.1148/radiol.241613
  16. [16]Wasserthal J, Akinci D’Antonoli T. TotalSegmentator MRI dataset: 616 MRI images with segmentations for 50 anatomical regions [dataset]. Version 2.0.0. Zenodo; 2025. doi:10.5281/zenodo.14710732
  17. [17]Isensee F, Jaeger PF, Kohl SAA, Petersen J, Maier-Hein KH. nnU-Net: a self-configuring method for deep learning-based biomedical image segmentation. Nat Methods 2021;18(2):203–211. doi:10.1038/s41592-020-01008-zDOI
  18. [18]Schuirmann DJ. A comparison of the two one-sided tests procedure and the power approach for assessing the equivalence of average bioavailability. J Pharmacokinet Biopharm 1987;15(6):657–680. doi:10.1007/BF01068419DOI
  19. [19]Weber T, Dexl J, Rügamer D, Ingrisch M. Post-training network compression for 3D medical image segmentation: reducing computational efforts via Tucker decomposition. Radiol Artif Intell 2025;7(2):e240353. doi:10.1148/ryai.240353DOI
  20. [20]Miller RJH, Killekar A, Shanbhag A, et al. Predicting mortality from AI cardiac volumes, mass, and coronary calcium on chest computed tomography. Nat Commun 2024;15:2747. doi:10.1038/s41467-024-46977-3DOI
  21. [21]Fedorov A, Longabaugh WJR, Pot D, et al. National Cancer Institute Imaging Data Commons: toward transparency, reproducibility, and scalability in imaging artificial intelligence. RadioGraphics 2023;43(12):e230180. doi:10.1148/rg.230180DOI

Paper details

vlnc:W_snmayegw
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents