Spline Curvature as a Filter for Synthetic Vessel Training Data

Generative models are now used to manufacture training data for thin-structure segmentation, meaning the task of tracing blood vessels, nerves or strokes one or two pixels wide. A diffusion model (a generator that learns to turn random noise into samples by removing noise step by step) draws a vessel tree, and a second model paints a realistic image around it. These synthetic trees are used as they come out of the generator, even though generators of vascular structure are known to produce fragmented vessels and impossible branching.

We propose a cheap, interpretable gate for this data. The gate fits smooth parametric curves (B-splines, which are piecewise polynomials with guaranteed continuous derivatives) to the centerline of each synthetic vessel tree. It then reads off how sharply the curve bends along its length and compares that to the bending seen in real anatomy. Trees that jitter or kink in ways no real vessel does are rejected. Among the trees that pass, the gate keeps the ones whose high-bending segments the current segmentation model still gets wrong.

The claim is that the damaging flaws in synthetic curvilinear data are mostly geometric, not topological. Kinks, jitter and implausible bending pass every existing filter, whether that filter is a classifier's confidence, an entropy score, a pixel discriminator or a count of connected components. A spline-based curvature gate catches these flaws and turns an unfiltered augmentation set into a curated one.

Core Claim and What Is New

Selective augmentation already exists, but every filter in the file scores samples with scalar outputs of a network. Better Diffusion Models Further Improve Adversarial Training keeps the most classifier-confident synthetic images. A New Supervised Over-Sampling Algorithm keeps samples inside a bounded confidence window, on the evidence that very confident samples are redundant. Generating High Fidelity Synthetic Data via Coreset selection and Entropic Regularization drops high-entropy samples and then selects a diverse coreset. Diffusion Rejection Sampling rejects intermediate diffusion states using a time-dependent discriminator. These papers motivate the proposal, since they show filtering matters: on SVHN, unfiltered generative augmentation drops accuracy from 92.0% to 88.1%, and filtering lifts it to 94.5%. None of these filters looks at shape.

On the other side, curve-fitting work computes pointwise curvature and torsion only as a measurement. Fitting Splines to Axonal Arbors fits adaptive-degree B-splines to axon traces and finds that different branch types have distinct, consistent curvature and torsion signatures. That consistency is exactly what makes curvature usable as a realism test. Skeleton-based cerebrovascular quantitative analysis and B-spine supply the method of fitting splines to noisy centerlines. Generation of Structurally Realistic Retinal Fundus Images with Diffusion Models supplies the application: it produces 3,000 unfiltered diffusion vessel masks and paints fundus images around them. The closest bridge, Curvature Enhanced Data Augmentation for Regression, uses second-order curvature to generate tabular samples. It works on point clouds rather than image skeletons, and it does no rejection. Our proposal differs from all of these by using the curvature of fitted curves as the acceptance criterion for generated images.

The Gate

The gate first skeletonizes each synthetic vessel mask and splits the skeleton at junctions into branches. It fits one cubic B-spline per branch by penalized least squares. We treat junctions separately rather than forcing a curve through them, because curve representations are known to be unstable at bifurcations (Tubular Curvature Filter, Segmentation and Vascular Vectorization for Coronary Artery). At each junction the gate records only the branch angles.

For a candidate tree $x$, it computes three quantities:

  • the mean distance $r(x)$ between the raw skeleton pixels and the fitted spline, which measures jitter;
  • the histogram $h_\kappa(x)$ of curvature $\kappa(s)$ sampled along arc length $s$;
  • the histogram $h_\theta(x)$ of junction angles.

The plausibility score is

$$ P(x) = W_1\big(h_\kappa(x), h_\kappa^{\text{real}}\big) + W_1\big(h_\theta(x), h_\theta^{\text{real}}\big) + \lambda\, r(x). $$

Here $W_1$ is the one-dimensional Wasserstein (earth-mover) distance, the superscript "real" denotes histograms pooled over the real training masks, and $\lambda$ scales the jitter term. Every term is computed by the same pipeline on real masks.

The rejection threshold is set to the 95th percentile of $P$ over leave-one-out real masks. This removes the hand-tuned thresholds criticized in the selection literature: the threshold is whatever real anatomy itself tolerates.

Among accepted candidates, the gate ranks by utility $U(x)$. Utility is the current segmentation model's per-pixel error on $x$'s paired image, weighted by the local curvature of the spline under each pixel. This deliberately favors hard, strongly bending vessels. It follows the fidelity-utility argument of Active Tabular Augmentation via Policy-Guided Diffusion Inpainting that realistic samples in regions the model already handles add nothing. Unlike that paper's per-sample sequential policy, we re-rank only once per training round, so the overhead stays at spline fitting plus one forward pass per candidate.

Research Program

The first step is diagnostic, and the proposal lives or dies on it. We will reproduce the retinal diffusion mask generator on DRIVE and HRF training masks. We will then compare the distributions of $r$, $\kappa$ and junction angle between synthetic and real masks, both with spline-derived curvature and with finite-difference curvature on the raw skeleton.

If the synthetic and real spline-curvature distributions are indistinguishable, the gate has nothing to catch and we stop. If they differ while connected-component counts do not, that is direct evidence for the geometric-flaw claim.

The second step trains segmentation networks on real data plus a fixed budget of retained synthetic samples. The third step tests transfer to a different curvilinear domain, Oracle bone characters, using the skeleton stage of Oracle bone heritage data augmentation based on two-stage decomposition GANs. That model generates discrete skeletons and admits them without filtering. Its strokes are curves whose bending statistics can be gated in exactly the same way, which tests whether real-data-calibrated thresholds really remove per-domain tuning.

Baselines

The naive reference is training on real data only. The second reference is the unfiltered pipeline of Generation of Structurally Realistic Retinal Fundus Images with its 3,000 synthetic images. It is the strongest existing method because it is the published augmentation system for exactly this task. The paper reports vessel segmentation AUC 0.984 on the private FIREFLY dataset, against 0.973 without augmentation. No reported result was found on Lacuna for this method on DRIVE or HRF, so we will reproduce it there ourselves.

Every filtered condition draws from the same pool of candidates, about five times the retained budget. Every condition retains exactly 3,000 samples, and uses the same segmentation network, epochs and hyperparameter search budget. The differences therefore reflect selection alone.

The filtering baselines are four:

A topology-only filter rejects masks whose connected-component and loop counts fall outside the real range. Procedural Bézier trees, following Synthetic Data for Blood Vessel Network Extraction, serve as a smooth-by-construction data source.

Three ablations isolate the key ingredients. The first uses plausibility only. The second uses utility only. The third replaces spline curvature with finite-difference curvature on raw skeletons, which isolates the curve fit itself.

Beating the unfiltered pipeline and the best filter requires two things. First, the gate must significantly improve topology-sensitive metrics over three seeds, measured by clDice and Betti error from clDice. Second, it must not lose AUC or Dice. The finite-difference ablation should lose most of the gain.

Why not just…?

Why not just count connected components and loops? This is the most serious threat, because it is nearly free and targets fragmentation directly. We include it as a baseline and in combination with our gate. If it matches the curvature gate on clDice and Betti error, then the flaws are topological after all and the spline machinery is unjustified. The diagnostic step will show this before any training.

Why not just keep the samples the segmentation model is confident about? Confidence measures how separable a sample is, not whether its shape is anatomically real. TargetSOS shows that the most confident samples are the redundant ones. Our utility term keeps hard samples, but only after geometry has vouched for them. The comparison at equal retained budget settles which approach works better.

Why not just use a learned discriminator? A discriminator may learn curvature cues implicitly, and Diffusion Rejection Sampling shows this approach is powerful for image quality. However, a discriminator needs training data. It also tends to reject by texture, and it gives no reason for a rejection. If the discriminator matches our gate, the gate's remaining advantages are interpretability and calibration without training. We will report that outcome honestly rather than claim accuracy gains.

Why not just use procedural spline trees, which are smooth by construction? Synthetic Data for Blood Vessel Network Extraction raises edge F1 on five real TPLSM scans from 0.496 to 0.626 this way. The cost is up to a million volumes, because procedural rules do not match real anatomy's statistics. We compare against procedural data directly. We also test applying the utility half of our gate to procedural pools.

Why not just train with a topology-aware loss? A loss like clDice changes how the model learns from each sample, while our gate changes which samples it sees. The two are complementary. We will run every condition with and without clDice to check that the gate's gain survives on top of it.

Decisive Checks

The idea fails in two cases. The first is if spline-curvature histograms of diffusion masks match those of real DRIVE and HRF masks. The second is if the topology-only filter matches the full gate at an equal budget.

The idea succeeds on three conditions. The gate must lower Betti error and raise clDice over the unfiltered 3,000-image pipeline and over every filter, at equal budget. The finite-difference ablation must recover little of that gain. On OBC306, a ResNet101 classifier trained on gated Oracle bone skeletons must exceed the 74.21% top-1 accuracy the two-stage GAN reports with unfiltered augmentation, using thresholds taken from real OBI skeletons without any per-domain tuning.