Geometry-Defined Fuzzy Boundaries for Cross-Hospital Lesion Analysis

Segmentation networks for lesions with faint edges, such as colon polyps or breast ultrasound masses, usually output a per-pixel probability and then cut it at 0.5. Inside the lesion that probability is near 1 and behaves well. Along the edge it means "how confident the network is," and confidence is exactly what shifts when the scanner, lighting or noise changes at a new hospital. The result is that the boundary, which is where malignancy cues such as irregular or infiltrating margins live, is also the part of the prediction that breaks first under transfer. We propose to redefine what the network predicts at the edge. Instead of a confidence, it predicts a fuzzy membership, a value between 0 and 1 saying how deep a pixel sits inside the lesion. The value is fixed by the distance from the annotated contour, measured relative to lesion size. Because that target is defined by geometry rather than intensity contrast, its meaning should not change from one hospital to the next.

The same membership field is then reused downstream. Current lesion-classification pipelines pool network features under a binary lesion mask. We would instead pool interior features and transition-zone features separately, each weighted by the predicted membership. The proposal makes two coupled, falsifiable claims. First, geometry-supervised membership gives boundaries that are more stable at unseen hospitals than crisp, label-smoothed, or deliberately sharpened outputs. Second, membership-weighted pooling makes downstream diagnosis more robust when the upstream mask is imperfect and no target-site recalibration is allowed.

Core Claim and How It Differs From Prior Work

Let $d(x)$ be the signed distance of pixel $x$ to the annotated contour, positive inside the lesion. Let $r$ be the lesion's equivalent radius and $\alpha$ a band fraction. The training target is a linear ramp:

$$m^*(x) = \mathrm{clip}\!\left(\tfrac12 + \tfrac{d(x)}{2\alpha r},\,0,\,1\right).$$

The network regresses this ramp alongside the usual mask. The ramp's 0.5 level set is the annotated contour, so thresholding still yields a standard mask.

For downstream use, write $f(x)$ for the encoder features and $\hat m$ for the predicted membership. We form two pooled vectors and concatenate them:

$$z_{\text{in}} = \frac{\sum_x \hat m(x)\, f(x)}{\sum_x \hat m(x)}, \qquad z_{\text{band}} = \frac{\sum_x 4\hat m(x)(1-\hat m(x))\, f(x)}{\sum_x 4\hat m(x)(1-\hat m(x))}.$$

The weight $4\hat m(1-\hat m)$ peaks at the contour and vanishes deep inside the lesion and far into the background.

The closest prior work sits in three places, and each plays a different role.

Bounding Maps for Universal Lesion Detection supplies the method. It replaces binary box labels in CT lesion detection with linear ramps from 1.0 at the center to 0.5 at the border. It also reports that linear ramps beat Gaussian profiles. However, it works on boxes rather than dense contours and is never tested across hospitals. We take its linear-ramp finding as a design constraint and move it to dense, contour-relative targets.

CLFSeg motivates the problem from the opposite side. It inserts learnable Gaussian membership functions inside the network and reports lower HD95 on polyp and cardiac benchmarks. Its membership is a learned internal feature transform, though, not a supervised output with a fixed geometric meaning, and it reports no cross-site evaluation. Our hypothesis is that learned membership parameters, tuned on one cohort, inherit that cohort's contrast statistics.

Combating Uncertainty with Novel Losses for Automatic Left Atrium Segmentation constrains the design from a third direction. Its Overlap Loss pushes foreground and background probabilities apart so that edges become steep. That raised Dice from 82.01% to 89.83% on a single-site atrial dataset. The paper therefore represents the opposing "sharpen the edge" view. Whether sharpening or partial membership transfers better to unseen sites has not been tested, and our experiments are set up to answer that.

On the pooling side, Lesion-Centric Latent Phenotypes from Segmentation Encoders for Breast Ultrasound Interpretability pools segmentation-encoder features under a binary predicted mask and validates externally on BUS-BRA. Computed tomography–based COVID–19 triage through a deep neural network using mask–weighted global average pooling does the same with a Gaussian-blurred lung mask. Neither separates the transition zone from the interior. Neither uses a soft weight whose meaning is defined independently of image contrast.

Research Program

The program has three stages.

The first stage is target construction and training. Annotations from the training sites are converted to contour-relative ramps, with $\alpha$ swept over a small grid chosen on a held-out seen-site split only. A segmentation backbone is trained with three heads: the ramp regression, the standard mask head, and a consistency term tying the mask's 0.5 level to the ramp's. The training change is backbone-agnostic. We therefore apply it to the strongest published polyp backbone instead of building a new architecture.

The second stage is boundary analysis under shift. At unseen sites we measure:

  • Dice and HD95.
  • Threshold sensitivity: the spread of Dice as the cut varies from 0.3 to 0.7. A geometrically meaningful field should be insensitive to this choice.
  • Calibration within the boundary band: expected calibration error restricted to pixels within $\alpha r$ of the true contour.
  • The seen-to-unseen gap, which is the quantity that matters for deployment.

The third stage is downstream pooling. On breast ultrasound we pool encoder features with binary, blurred, dilated-ring, softmax-weighted, and membership-weighted schemes. We then probe malignancy at the external site under two conditions: with and without the bottleneck recalibration of the lesion-centric paper. We also test with deliberately degraded upstream masks, eroding or dilating them by a fraction of $r$ to simulate a segmenter that clips an infiltrating margin.

Baselines

The naive reference is the backbone trained with binary cross-entropy plus Dice, thresholded at 0.5. This is how PraNet and Polyp-PVT are trained. Every other arm must beat it on unseen sites to be worth anything.

The strongest existing segmentation method in the file is Polyp-PVT, a pyramid vision transformer with camouflage-identification and similarity-aggregation modules. Trained on Kvasir-SEG plus CVC-ClinicDB, it reports mDic 0.808 on unseen CVC-ColonDB and 0.787 on unseen ETIS-LaribPolyp. For comparison, PraNet reports 0.628 on unseen ETIS. For fairness we retrain Polyp-PVT ourselves with its published recipe as the crisp arm. Our arm is the identical backbone, data, augmentation, and epoch budget, with only the targets and loss changed. Both arms get the same hyperparameter search budget on seen-site validation only. Beating Polyp-PVT means an unseen-site mDic improvement on both ColonDB and ETIS that exceeds seed-to-seed variation across at least three seeds, together with lower threshold sensitivity. A Dice tie with clearly better threshold stability would be reported as a partial result, not a win.

The sharpening competitor is the same backbone with Overlap Loss from the left-atrium paper added. The learned-membership competitor is a reimplementation of CLFSeg's Gaussian fuzzy module inserted into the same backbone. CLFSeg reports CVC-ColonDB DSC 0.9593 under its own split. No reported result was found on Lacuna for CLFSeg on ETIS or under a seen/unseen protocol, so its cross-site number will come from our own run.

The cheap soft-label competitor is uniform boundary label smoothing at a matched band width. This isolates whether geometric structure in the target matters or merely softness.

For downstream pooling, the strongest baseline is binary mask-weighted pooling from the lesion-centric breast ultrasound paper. Trained on BUSI plus BUS-UCLM and tested on BUS-BRA, it reports malignancy probing AUC 0.982, against 0.852 for an unweighted CNN and 0.774 for radiomics. This leaves little headroom on clean external AUC. We do not count a gain there as the test. Beating this baseline means one of two things. The first is a higher AUC on BUS-BRA when bottleneck recalibration is disallowed. The second is a smaller AUC loss when upstream masks are eroded or dilated, compared with binary pooling and its own reported margin-accuracy figure of 90.9% on discordant cases.

Two ablations isolate the key ingredient. The first defines the ramp by image intensity rather than geometry, which tests whether contrast-independence of the target is what helps. The second collapses the two pooled vectors into one, which tests whether the transition zone carries separate information.

Why not just…?

Why not just use the network's own softmax probabilities as the soft pooling weight? They are already continuous and cost nothing, so this is the most serious alternative. Our argument is that edge probabilities encode confidence, which moves with contrast across sites. This is consistent with the large seen-to-unseen drops for PraNet (0.898 on Kvasir to 0.628 on ETIS). We test it directly: softmax-weighted pooling is a baseline, and band calibration error is measured for both. If softmax weights match membership weights on BUS-BRA under mask degradation, the downstream half of our claim fails and we will say so.

Why not just blur or dilate the binary mask? Bai et al. blurred their lung mask and gained 0.9 points of sensitivity and 2.0 of specificity over unweighted pooling. A dilated ring around the mask is an even cheaper way to include margin context. This is a real threat to the pooling claim, because a ring captures the transition zone without any learned membership. Both are run as baselines at matched band width. The fuzzy approach must win specifically when the upstream mask is wrong, because a blurred wrong mask stays centered on the wrong contour. Our predicted membership, by contrast, is a separate regression that can disagree with the thresholded mask.

Why not just smooth the labels or use a foundation model with heavy augmentation? Uniform label smoothing makes outputs soft but carries no geometry, so it is run at matched width to separate softness from structure. For foundation models, Ultrasound SAM Adapter reports that SAM degrades on speckled, low-contrast ultrasound and needs domain adapters to reach 89.95% Dice on BUSI. Polyp-PVT itself still fails under reflections despite global attention. Because our change is a target, not an architecture, it can be applied on top of any such backbone. The relevant question is therefore whether it adds to the strongest one, which is exactly the Polyp-PVT comparison above.

Decisive Checks

Polyp segmentation. The protocol is the standard one: train on Kvasir-SEG plus CVC-ClinicDB, test on CVC-ColonDB and ETIS-LaribPolyp. The claim survives only if three things hold together. Geometry-supervised Polyp-PVT must beat crisp Polyp-PVT, label smoothing, and Overlap Loss on unseen-site mDic. Its threshold sensitivity must be lower. And the intensity-defined-ramp ablation must lose most of the gain. If Overlap Loss transfers better than any soft target, the sharpening view wins the tension left open between the left-atrium paper and CLFSeg, and that is itself a publishable answer.

Breast ultrasound. The protocol is train on BUSI plus BUS-UCLM, test on BUS-BRA. The pooling claim survives only if membership-weighted interior-plus-band pooling beats binary, blurred, ring, and softmax pooling in at least one of two settings: the no-recalibration setting or the degraded-mask setting. It must also do so without losing clean AUC relative to the reported 0.982.

Interpretation of outcomes. A result where segmentation improves but pooling does not would mean geometric membership is a better boundary representation but not a better diagnostic feature. We would report the two findings separately rather than as one combined story.