Hadronness for Organs: Tree-Scored Through-Slice Tracks to Repair 2D Segmentation of 3D Scans

When a 2D image model, such as the Segment Anything Model (a promptable segmenter pre-trained on natural photographs), segments a CT scan one slice at a time, it has no view of how the organ continues from slice to slice. The result is a set of predictable errors. The organ disappears for a few slices and then reappears. Spurious blobs show up on isolated slices. Boundaries become saw-toothed. Ground-based gamma-ray astronomy faced a similar situation decades ago. Cherenkov telescopes see each air shower as a flat 2D blob of light, and faint background showers caused by cosmic-ray protons look almost exactly like the rare gamma-ray showers. The field did not solve this by building bigger image models. It summarized each candidate shower with a few physically meaningful shape moments, added one descriptor of how the shower evolves along its axis (the photon arrival-time gradient), and let a random forest output a continuous "hadronness" score: the fraction of trees voting that the event is background. Adding that single evolution descriptor halved the residual background (Improving the performance of the single-dish Cherenkov telescope MAGIC through the use of signal timing).

This note proposes the same move for volumetric context loss. We stack a frozen 2D model's per-slice organ masks into candidate 3D "tracks." We describe each track by how its centroid, area and shape change along the depth axis, much as the time gradient describes how a shower develops. A random forest then scores each track and each slice within it as anatomically plausible or spurious. The score is used to delete false fragments and to locate gaps. Each gap is then filled by re-prompting the 2D model on only the missing slices, at an interpolated location. The bet is narrow and testable. Explicit through-plane descriptors scored by a forest should recover most of what a learned 3D aggregator recovers, and do so with far less training data. They should also transfer better across hospitals, because the descriptors are normalized geometry rather than raw intensities.

Core Claim

Most of the volumetric context that slice-wise models lose is low-dimensional and geometric. It consists of whether a structure's cross-section moves smoothly, grows and shrinks smoothly, and persists without gaps across depth. A random forest over a dozen such through-plane descriptors, trained on a few dozen volumes, can therefore act as an organ-level "hadronness" filter. It can raise worst-case Dice on pancreas CT and reduce through-plane discontinuities without any 3D convolution, and it degrades less than a learned 3D aggregator when moved to unseen scanning centers. If a learned 3D aggregator trained on the same data matches the forest both in-domain and across centers, the claim is false. The experiments below are built to detect that outcome.

Relation to Prior Work

The closest prior pipeline is Deep convolutional networks for pancreas segmentation in CT imaging. It used a cascade of random forests to filter 2D superpixels before a 2D ConvNet, then restored continuity with a 3D Gaussian blur, which raised mean Dice from 56% to 68%. Its forests see one slice at a time and act before segmentation. They can discard true organ regions irreversibly, and the 3D context comes only from isotropic smoothing. Our forest acts after the 2D model, on objects that already span depth, and its features are specifically the through-plane ones that pipeline lacked.

PanSAM: Zero-Shot, Prompt-Free Pancreas Segmentation in CT Imaging is the strongest motivating and competing work. It pairs a frozen SAM encoder with an automatic prompt generator and a learned 3D convolutional aggregator, reaching 87.01% Dice on NIH Pancreas-CT and 83.20% zero-shot on AbdomenCT-1K. Its automatic prompts cost about 2 Dice points relative to expert prompts. PanSAM shows that some 3D aggregation is needed. Our question is whether that aggregation must be a learned convolutional module, or whether interpretable descriptors plus a forest suffice. Our gap-targeted re-prompting also attacks the prompt-quality loss directly.

A Fixed-Point Model for Pancreas Segmentation in Abdominal CT Scans shows that the failures that matter most are worst-case ones. Its iterative coarse-to-fine refinement lifts worst-case Dice from 34.11% to 62.43%, at roughly 3 minutes per volume with repeated full forward passes. We reuse its insight that re-running the model under better localization fixes catastrophic cases, but we re-run only on forest-flagged slices.

Two works supply the method. (RF)² - Random Forest Random Field used forests with leaf class histograms to score pairs of neighboring regions in 2D images, which shows that forests can model relations between spatial units and not only isolated units. Our slice-to-slice transition features follow that idea along depth, without the sampling-based inference it needed (about 31 s per image). A new method of reconstructing images of gamma-ray telescopes applied to the LST-1 of CTAO shows that richer fitted descriptors fed to forests improved low-energy sensitivity by up to 50%. This supports the descriptor-plus-forest design over raw-pixel models when signal is weak, a regime analogous to the low-contrast pancreas.

One cited result cuts against us. Deep-learning-driven event reconstruction applied to simulated data from a single Large-Sized Telescope of CTA found that CNNs on raw telescope images beat Hillas-parameter forests by up to 40% in arrival-direction accuracy, because hand-crafted moments discard substructure. We take this seriously. It is the reason the learned 3D aggregator is our primary competitor. The same paper also reports that the CNNs are fragile when moved from simulation to real data, and that domain-shift weakness is where we expect the forest to win.

Lumbar Disc Localization and Labeling with a Probabilistic Model on Both Pixel and Object Features supports the general strategy of separating local appearance from a global geometric chain (96.2% localization accuracy). Our tracks are a non-parametric version of that chain prior.

Research Program

The 2D model is frozen throughout. We use two backbones: SAM with an automatic box prompt generator, and a 2D U-Net trained on the training folds. Running either on every axial slice gives a probability map per slice. We threshold it and link 2D connected components across adjacent slices by overlap. Each linked chain is a candidate track, with cross-sections $c_z$ on slices $z = z_0, \dots, z_1$.

For each track we compute descriptors in two groups. The first group is in-plane, the analogue of the Hillas parameters: mean area, eccentricity, mean intensity, and the 2D model's mean confidence. The second group is through-plane, the analogue of the time gradient. It includes the slope and residual spread of the centroid trajectory fitted against depth, the second difference of area along depth, the slice-to-slice Dice between consecutive cross-sections, the number and length of internal gaps, track length in millimetres, and the track's position relative to a coarse body landmark (the spine centroid). The central through-plane quantity is the centroid drift rate and its roughness:

$$g = \frac{\Delta \mu_z}{\Delta z}, \qquad r = \sqrt{\frac{1}{n}\sum_{z}\left(\mu_z - \hat{\mu}_z\right)^2},$$

Here $\mu_z$ is the in-plane centroid on slice $z$, $\hat{\mu}_z$ is a linear fit to those centroids over depth, $n$ is the number of slices in the track, and both quantities are expressed in millimetres. A smooth true organ yields a coherent $g$ and a small $r$, just as gamma showers yield a coherent arrival-time gradient. Distractor fragments, such as duodenum, vessels or noise, tend toward erratic trajectories.

A track-level forest outputs a spuriousness score, the average of tree votes as in hadronness. We drop tracks above a threshold chosen on validation folds. A second, slice-level forest uses the same descriptors computed in a window of ±3 slices around each slice. It flags individual slices whose cross-section is inconsistent with its neighbors, and it flags missing slices inside an accepted track. For each flagged gap, we interpolate the centroid and extent from the flanking slices, generate a box prompt (SAM) or a cropped region (U-Net), and re-run the 2D model on those slices only. Forest inference is negligible next to the backbone. The added cost is the number of re-run slices, which we report.

Baselines

The naive reference is the frozen 2D backbone applied slice by slice and stacked, with no 3D processing. It shows how much volumetric context loss there is to recover. We found no reported number on Lacuna for slice-wise SAM without aggregation on NIH Pancreas-CT. For a slice-wise 2D ConvNet, the closest reported figure is 56% mean Dice in Roth et al., from an older architecture. We will measure our own.

The heuristic baseline is the post-hoc approach from Deep convolutional networks for pancreas segmentation in CT imaging: 3D Gaussian smoothing of the stacked probabilities, plus keeping the largest 3D connected component. We tune the kernel width and threshold on the same validation folds. The proposal must beat it on worst-case Dice and on our discontinuity metric, not just on mean Dice.

The strongest existing method is PanSAM's learned 3D convolutional aggregator over frozen SAM outputs (PanSAM). It reports 87.01% Dice on NIH Pancreas-CT and 83.20% zero-shot Dice on AbdomenCT-1K. We will reimplement an aggregator of matching parameter count on our own frozen backbone outputs, so that both methods consume identical slice predictions, training folds and hyperparameter search budget. We then compare against our reimplementation, and we cite PanSAM's numbers for context only. Beating it means one of three outcomes. The first is in-domain mean Dice within 1 point while being clearly better in worst case. The second is a smaller in-domain to AbdomenCT-1K drop. The third is clearly higher Dice when both are trained on 10 or 20 volumes. Our claim is not supported if the aggregator wins on all three.

The iterative-refinement baseline is the fixed-point model (A Fixed-Point Model for Pancreas Segmentation in Abdominal CT Scans), which reports 82.37% mean and 62.43% worst-case Dice on NIH Pancreas-CT under 4-fold cross-validation. We compare against it at matched wall-clock budget, and we report how many slices each method re-evaluates.

Two ablations isolate the key ingredient. The first is the MAGIC-style "no timing" ablation: the same forests with only in-plane descriptors, so the through-plane features are removed. The second replaces our descriptors with a gradient-boosted tree model on raw downsampled probability patches from neighboring slices. This tests whether hand-designed track geometry matters, or whether any trees over neighbor information would do. A third ablation removes gap re-prompting and keeps only deletion, to separate false-positive removal from missing-slice recovery.

Why not just…?

Why not just smooth the probability volume in 3D? Smoothing can remove isolated speckle and soften jagged edges, and Roth et al. show that it yields large gains from a weak base. It cannot create organ evidence on slices where the 2D model predicted nothing. It also cannot tell a smooth but wrong neighboring structure from the pancreas. Our gap-recovery metric and the worst-case Dice comparison test this directly. If smoothing plus largest component matches the forest on worst-case scans, the forest has no purpose and we will report that.

Why not just train a small learned 3D aggregator, as PanSAM does? This is the real threat. PanSAM's 87.01% shows that it works in-domain, and the telescope CNN results show that learned features can beat hand-crafted moments. We do not argue around it. We test it head to head on identical inputs, and add two regimes where we expect geometry-based trees to have the edge: training sets of 10–20 volumes, and transfer across the 12 centers of AbdomenCT-1K. The CTA simulation-to-data fragility reported in Deep-learning-driven event reconstruction is the precedent for that expectation, but it is only a precedent. If the aggregator also wins in those regimes, the remaining value of the forest is interpretability and quality control, and we will narrow the claim to that.

Why not just use a native 3D network? Native 3D models avoid the problem entirely but cannot inherit 2D foundation-model pre-training. Swin-UMamba reports over 12% gains from ImageNet pre-training on small medical sets, which suggests that from-scratch 3D models suffer when data is scarce. We include a 3D U-Net trained on the same folds as a reference point. Its role is to bound how much of the 2D-to-3D gap remains, not to serve as the method we must beat in the full-data setting.

Proposed Experiments

The main experiment is 4-fold cross-validation on NIH Pancreas-CT (82 volumes), matching the protocol used by the fixed-point model. We report mean, standard deviation and worst-case Dice. We also report a through-plane discontinuity rate: the fraction of slices between the first and last ground-truth pancreas slice where the prediction is empty or disconnected from its neighbors. Runtime and the number of re-evaluated slices per volume are reported as well. The cross-center experiment trains on NIH and evaluates zero-shot on AbdomenCT-1K, reporting the drop from in-domain performance for every method. The data-efficiency experiment repeats training with 10, 20 and 40 volumes for both the forest and the learned aggregator, with the 2D backbone fixed.

The decisive checks are three. First, the in-plane-only ablation must lose clearly to the full forest on worst-case Dice and on discontinuity rate. This reproduces, in medicine, the gain that timing gave in the MAGIC study. Second, gap re-prompting must recover slices that smoothing cannot. This is measured on the subset of volumes where the frozen backbone has internal gaps, and it should narrow the automatic-versus-expert prompt gap that PanSAM reports. Third, the forest must beat or match the learned aggregator in at least the low-data or cross-center regime at equal training data and tuning budget. Failing the third check while passing the first two would mean that through-plane geometry matters but trees are not the best way to use it. That is still a useful and publishable negative result.