Repository navigation
feat: make RandomRedistributeSegGPU's bump-width floor configurable - #149
Hendrik-code wants to merge 1 commit into
Conversation
The remap adds a signed Gaussian bump per label at that label's mean intensity and rescales the sum to a peak-to-peak of 2 in the [0, 1] min-max units it works in. Each bump's width is floored at a hardcoded 0.01. A bump of width s rescaled that way has a slope of about 1.2/s, so at the floor a thin band of intensities swings by more than the whole input range and voxel noise inside the band comes out as salt-and-pepper. Measured on a ramp with the floor binding: maximum slope 123 / 26 / 13 at floors 0.01 / 0.05 / 0.1. On real spine patches the high-frequency share of the image at least doubled in 24% of applications. `min_redist_std` exposes the floor. Default 0.01 is the historical value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Results: Dataset803 and Dataset804, fold 0Pooled over scans, this arm is equivalent to the paper config within ±0.01 everywhere. Per cohort, it loses on the cohorts in the other modality: the CT cohorts for the MRI-trained model (803) and the Dixon cohorts for the CT-trained model (804). The largest loss is Dixon water on 804 (−0.070). The arm changes two things, the floor (0.01 → 0.05) and Setup.
Floor 0.05 minus paper (replicate), paired mean and 95% CI:
All four cells are equivalent (TOST p ≤ 0.008). Against the published run, the deltas are −0.000, −0.007, −0.001 and −0.004. Cohort means: 803 in / out 0.901 / 0.841 (paper replicate 0.901 / 0.844). 804 in / out 0.903 / 0.762 (paper replicate 0.903 / 0.781, so −0.020 out-of-domain). Where it moves, per cohort against the replicate:
The pooled verdict misses this because of cohort sizes. On 803, myelom-ct is 58% of the out-of-domain scans. On 804, SPIDER is 84% of them and each Dixon cohort only 5%. Caveat: GPU model. This arm's Dataset804 run trained on an L40S; every reference trained on an A40. On Dataset804 Dixon water, the three arms of this round that trained on the L40S (#147, #149, #150) scored 0.724, 0.698 and 0.539. That is below all 23 other full-capacity arms on 804 (0.756 to 0.778) and all four runs of the paper config (0.767 to 0.771). An earlier paper-family run on the same L40S scored 0.759, with no scan more than 0.05 below the paper config, so the card alone does not produce the drop. With one run per cell, an interaction between card and arm is not excluded; an A40 rerun on 804 would settle it. In training. About 36 s/epoch on the L40S, no non-finite losses in either run. At p = 0.4, Redistribute fired in 9 of 20 pre-flight batches. Bottom line: the option defaults to off and is safe to merge. Do not change the paper config. The speckle and the label-confined plateaus look like artifacts but carry some cross-modality value. Separating the floor from |
What
RandomRedistributeSegGPUtakesmin_redist_std(default0.01, the hardcoded value it replaces): the floor on each label's Gaussian bump width, in the[0, 1]min-max units the remap is built in.Why
The remap adds a signed Gaussian bump per label at that label's mean intensity, then rescales the sum to a peak-to-peak of 2. A bump of width s, rescaled that way, has a slope of about 1.2 / s. At s = 0.01 a thin band of intensities swings by more than the whole input range, so voxel noise inside that band comes out as salt-and-pepper.
Measured on an intensity ramp with the floor binding (voxel-random labels,
std_noise_range=(0, 0)), mean of the maximum slope over 20 seeds:On real SpineGAN MR/CT patches, the high-frequency share of the image (std of what a σ=1 blur removes ÷ std) at least doubled in 24% of Redistribute applications, and in 47% when it ran after SynthSeg. It is the most frequent TA in the paper config (
p: 0.4).Behaviour
Default unchanged (tested: bit-identical with and without the key at 0.01). A non-positive floor is refused.
all_augmentations.jsonregenerated.Tests
unit_tests/test_redistribute_std_floor.py:Full suite:
477 passed, 13 skipped.mypy smauglab/clean, pre-commit passes.🤖 Generated with Claude Code