When a colonoscopy polyp fades into the surrounding mucosa, part of its outline is plainly visible and part of it is essentially guesswork. Current segmentation models treat every point on the outline the same way. Pixel classifiers let the invisible stretch leak into the background. Contour models refine every vertex using local image features, and those features are uninformative exactly where the boundary is invisible. This note proposes a contour model that decides, point by point along the outline, how much to trust the image. Where the boundary has clear evidence, the image sets the shape. Where it does not, the missing stretch is filled in by a smooth, low-frequency shape fitted to the confident stretches, much as an endoscopist mentally completes a half-visible lesion.
The mechanism uses a Fourier contour: the outline written as a short sum of sinusoids around the closed curve. Keeping only the first few sinusoids acts as a low-pass filter. It makes the curve smooth and closed, and it stops it from fragmenting. Prior work fixes how many sinusoids to keep and then adds an unconditional local correction everywhere. We instead fit the low-frequency curve by weighted least squares, with each point's weight set by its predicted boundary evidence. We then allow a high-frequency correction only in proportion to that same evidence. The result is a smoothing prior that varies along the contour, which neither the spectral contour literature nor the low-contrast segmentation literature has built. We pair it with an evaluation that measures boundary error separately by local contrast, so the claim can be tested on the arcs where it should matter.
Core Claim
In low-contrast images, the best estimate of an invisible boundary arc is the low-frequency completion of the visible arcs, not a locally refined guess. A contour model that ties both its low-pass fit and its high-frequency freedom to per-point boundary evidence should lower boundary error on low-contrast arcs relative to (a) ungated coarse-to-fine contour models and (b) spatial boundary-attention segmenters. It should lose nothing on high-contrast arcs. The new ingredient is the evidence-weighted spectral fit with a coupled gate. Neither the Fourier representation nor boundary attention is new.
Where This Sits
Two coarse-to-fine spectral methods supply the representation and motivate the gap. Contour Proposal Networks regress a fixed-order Fourier series per cell, then a residual vector field nudges sampled points toward the boundary. EFDTR predicts only first-order elliptical Fourier descriptors and then snaps sampled points with a polygon decoder. It reports that regressing higher orders directly injected gradient noise and hurt convergence. We reuse EFDTR's phase-domain parameterization, which unrolls the 2D outline into a 1D sequence with a one-to-one match between predicted and ground-truth points.
Both methods apply their refinement uniformly, and both were evaluated only where boundaries are visible: stained nuclei for CPN, natural images in COCO for EFDTR. Our proposal changes exactly that uniformity. HarmonicNet shows the other extreme in 3D. A truncated spherical-harmonic shape is robust to staining gaps but permanently smooths away real detail. Together these papers constrain the design. More frequencies everywhere is unstable, and fewer frequencies everywhere over-smooths.
Three spatial methods motivate the problem from the low-contrast side. Polyper splits a coarse mask into interior and "potential boundary" bands using fixed erosion and dilation, then lets interior features attend to the band. Its authors concede the fixed band width fails on wide, gradual transitions. MISNet adds reverse attention and a boundary branch supervised with hard binary edges. Structure Boundary Preserving Segmentation uses boundary key points and an adversarial shape critic on ultrasound and dermoscopy. All three express uncertainty about where the boundary lies as a spatial band or attention map. None makes the shape representation itself become smoother where evidence is weak.
We borrow Polyper's insight that interior features should inform the boundary. We place it in the evidence predictor rather than in a fixed-width band.
Method
A backbone, shared with the baselines, predicts a coarse first-order ellipse per object, as in EFDTR. It then samples $N$ points along the ellipse at phase positions $t_j$. For each sample, a head attends from interior features to the boundary neighborhood and predicts two things: a candidate boundary location $z_j$ (a complex number $x+iy$ found by moving along the ellipse normal) and an evidence weight $w_j \in (0,1)$. The low-frequency contour is then solved in closed form as a differentiable layer:
$$ c = \arg\min_{c} \sum_{j=1}^{N} w_j \Big| z_j - \sum_{|k|\le K} c_k e^{2\pi i k t_j} \Big|^2 + \lambda \sum_{|k|\le K} k^2 |c_k|^2 , $$
Here $c_k$ are the complex Fourier coefficients, $K$ is a modest cutoff (we sweep 3 to 8), and $\lambda$ penalizes high-frequency energy. Points with low $w_j$ barely influence the fit, so the curve across an ambiguous arc is interpolated from the confident arcs under the smoothness penalty.
The final contour is
$$ z(t) = \sum_{|k|\le K} c_k e^{2\pi i k t} + g(t)\, r(t). $$
Here $r(t)$ is a learned residual offset, as in CPN, and $g(t)$ is the evidence weight interpolated along the contour. High-frequency detail is therefore permitted only where the image supports it.
Training uses a point-matching loss on $z(t)$ in the phase domain, plus a mask loss on the rasterized contour. The evidence weight $w_j$ gets weak supervision from a contrast profile measured on the ground truth. For each ground-truth boundary point, we compute the intensity and color difference across the normal within a band a few pixels wide, then normalize it within each image. The model may override this target, because it is a regularizer and not a hard label. Multi-polyp frames are handled with one contour per instance. Holes are out of scope, which is a mild restriction for polyps and skin lesions.
Research Program
The work has three parts. The first is the model above, built on the same backbone as the strongest polyp baseline so that architecture is not the variable. The second is a contrast-stratified boundary evaluation. We bin every ground-truth boundary point into terciles by its contrast profile and report boundary error within each tercile, using mean point-to-contour distance and a 95th-percentile Hausdorff distance computed over that tercile's points.
The third is a controlled stress test. On Kvasir-SEG test images, we synthetically erase contrast along a randomly chosen arc of each polyp boundary by local blurring and blending toward the neighboring mucosa, at graded strengths. This lets us measure how far each model's boundary drifts on that arc while the rest of the image is unchanged. Real images confound contrast with size, location and shape, and the stress test removes that confound.
Baselines
The naive reference point is a pixel-wise segmenter on the shared backbone trained with Dice plus cross-entropy. It shows how much any boundary-aware method buys. The strongest existing method on the low-contrast question is Polyper, which reports an ETIS mDice of 86.51% against 81.00% for its SegT baseline. It is the strongest competitor because it targets exactly the interior-to-ambiguous-boundary inference we claim to do better. A second strong reference is MISNet, which reports mDice of 0.903 on Kvasir-SEG and 0.918 on CVC-ClinicDB. It isolates the reverse-attention-plus-edge-supervision approach.
Polyper and MISNet will be retrained under the standard polyp protocol: train on Kvasir-SEG and CVC-ClinicDB, test on Kvasir, ClinicDB, CVC-ColonDB, CVC-300 and ETIS. Each gets the same backbone where its design allows, the same image resolution, the same epoch budget and the same number of hyperparameter trials as our model. We will report their published numbers alongside our reproductions. No reported result was found on Lacuna for contrast-stratified or Hausdorff boundary metrics on polyp benchmarks, so those comparisons rest entirely on our reproductions.
The spectral baselines are an ungated coarse-to-fine contour model and a pure low-pass contour. The ungated model is a CPN/EFDTR-style head on the same backbone with uniform residual refinement, meaning $g \equiv 1$ and $w \equiv 1$. The pure low-pass contour has fixed $K$ and no residual.
Three ablations isolate the key ingredient. The first keeps the weighted least-squares fit but removes the gate on $r$. The second keeps the gate but uses uniform weights in the fit. The third replaces per-point evidence with a single per-instance cutoff $K$ chosen by a learned classifier. An oracle variant that uses ground-truth contrast profiles as $w$ bounds what better evidence prediction could gain.
Beating the strongest competitor means two things. First, a statistically reliable reduction in boundary distance on the lowest-contrast tercile relative to both Polyper and the ungated contour model, using a paired bootstrap over images on ETIS and CVC-ColonDB. Second, no significant loss on the highest-contrast tercile, and mDice within noise of Polyper or better.
Why not just…?
Why not just add a uniform smoothness penalty, such as curvature regularization or a single stronger $\lambda$, to an ordinary contour model? A uniform penalty trades sharpness on visible arcs for stability on invisible ones. The literature documents exactly this failure in truncated spectral models, which round real corners (FCENet; HarmonicNet). The uniform-weight ablation, swept over $\lambda$, is this alternative. If its best setting matches our model on the low-contrast tercile without hurting the high-contrast tercile, then per-point evidence is unnecessary and the claim is false.
Why not just choose the Fourier order adaptively per instance? This is the obvious reading of the fixed-$K$ gap in CPN and FCENet. A polyp is often sharp on one side and dissolves into a fold on the other, so a single cutoff for the whole object must still over-smooth or under-regularize somewhere. The per-instance-$K$ ablation tests this directly. The synthetic single-arc erasure test is designed so that per-instance adaptation cannot localize the damage.
Why not just raise the number of Fourier modes so the contour can follow any boundary? EFDTR found that regressing higher-order descriptors destabilized training. In low-contrast arcs, extra modes have nothing true to fit and will follow speckle and texture. Our $K$ sweep on the ungated and pure low-pass baselines will show whether this holds for polyps.
Why not just use Polyper or a stronger pixel segmenter? This is a real threat. mDice is dominated by interior pixels, and Polyper already reaches 86.51% on ETIS, so our gains may not show up in mDice at all. We therefore commit in advance to the contrast-stratified boundary metrics and the stress test as the primary evidence, and report mDice only as a no-harm check. If Polyper's boundary error on the lowest-contrast tercile matches ours, the conclusion is that spatial interior-to-boundary attention already captures the benefit, and the spectral prior adds nothing.
Decisive Checks
The first decisive check is the stress test. As the erased arc's contrast drops, the ungated contour model and Polyper should drift progressively. Our model's error on that arc should plateau near the error of the low-frequency completion. The predicted weights $w$ on that arc should fall, which also checks that the evidence head is measuring contrast and not memorizing shape.
The second is the real-data stratified comparison on ETIS and CVC-ColonDB. Gains should concentrate in the lowest-contrast tercile, with parity in the highest.
The third is a transfer check to a regime with visible boundaries. On BBBC039, where CPN reports an average F1 of 0.91, our model should learn high $w$ almost everywhere and match CPN. That would show the gate costs nothing when evidence is plentiful. On ISBI 2016/PH2 dermoscopy, where the boundary-preserving method reports 91.84% Dice, it should transfer to a second low-contrast modality.
If the uniform-smoothing ablation or Polyper matches us on the lowest-contrast tercile, we will report the idea as unsupported.
References
- Contour proposal networks for biomedical instance segmentation
- EFDTR: Learnable Elliptical Fourier Descriptor Transformer for Instance Segmentation
- Spherical Harmonics for Shape-Constrained 3D Cell Segmentation
- Polyper: Boundary Sensitive Polyp Segmentation
- Multi-scale information sharing and selection network with boundary attention for polyp segmentation
- Structure Boundary Preserving Segmentation for Medical Image With Ambiguous Boundary
- Fourier Contour Embedding for Arbitrary-Shaped Text Detection