Where to Cut? Adaptive Thresholds for Density-Ratio Few-Shot Segmentation

Rafael Sterzinger, Robert SablatnigarXiv 2026

TL;DR

Vision foundation models can already spot new objects in an image from just one or two reference examples without any extra training—they just assign every image patch a continuous "foreground-vs-background" score. However, turning that continuous score map into a clean binary mask usually relies on a rigid, pre-set threshold of zero, which leaves massive accuracy on the table. This paper shows how to dynamically read the right cutoff directly from the target image's own score histogram, setting a new state of the art across nine segmentation benchmarks with zero threshold constants to tune.

What Problem Does This Paper Address?

Imagine deploying a vision system into the wild. Sooner or later, it will encounter something it was never trained to segment—a specific car part, an underwater coral species, or a medical anomaly. Few-shot segmentation (FSS) tackles this by defining the target on the fly using just $k$ annotated reference ("support") images to segment a new ("query") image.

Thanks to self-supervised Vision Foundation Models like DINOv3, we don't even need to train mask decoders anymore; frozen patch features naturally relate the query to the support. The remaining puzzle is simply how to turn those rich features into a crisp binary mask.

Existing training-free approaches fall into two traps:

  1. Pre-clustering (e.g., INSID3): Grouping query pixels into clusters before looking at the support image. If you want to segment individual tomato slices in a salad bowl, but the algorithm pre-clustered the whole bowl as one chunk, you are out of luck.
  2. Fixed thresholds (e.g., FROST): Scoring every query patch individually by comparing how closely it resembles support foreground vs. support background (a log-density ratio), and cutting the mask wherever that score is greater than $0$.
Comparison of fixed pre-clustering vs. density-ratio scoring with adaptive thresholding on fine-grained pieces in a bowl.

Cutting at $0$ assumes an equal 50/50 split between foreground and background and assumes that scores calibrated on the support image keep their exact numerical scale on the query image. The authors measure what this rigid zero-cut costs: on the exact same score map, picking the optimal per-image threshold would boost 1-shot accuracy by 14 mIoU! Even worse, as you add more support images, the fixed cut actually degrades on its own, flooding the background.

Methods

The authors build upon FROST’s Kernel Density Estimation (KDE) scoring over frozen DINOv3 features—stripping away complex engineering like support flipping and bilateral propagation—and introduce an episode-adaptive threshold pipeline:

  • Correspondence-Augmented Score Field: Alongside the standard KDE log-ratio (which asks if a patch statistically looks more like foreground than background), they add a forward correspondence term using softmax attention from support foreground patches. This helps pinpoint the object when support examples are scarce, and naturally fades into the background as more support shots are added.
  • Windowing the Histogram ($\mathcal{R} = \{s > 0\}$): If you feed an entire image's score histogram into a classical threshold finder (like Otsu's method), the massive mountain of obvious background pixels drags the threshold way too low. Instead, the authors restrict the histogram to scores greater than zero—discarding obvious background so only the true object and ambiguous background remain.
Over the whole image, the score histogram is dominated by a massive background peak with a tiny foreground tail.
  • Valley Separator & Gate: On this restricted histogram, they smooth the curve until two peaks remain and place the cut $\hat{\tau}_V$ right in the valley between them (using Glasbey's minimum method, which ignores mode sizes). If the positive window isn't clear enough, a "valley gate" compares it against the full-image histogram and picks whichever has the deeper valley.
  • Multiplicative Shrinkage: Because the $s > 0$ window trims away most of the background, the valley sits slightly too high (cutting into the object). They pull the threshold back toward zero multiplicatively: $\hat{\tau} = \hat{\tau}_V / (1 + \hat{\pi})$, where $\hat{\pi}$ is Otsu’s estimate of the foreground fraction in that window.
  • Backward Correspondence Veto: Finally, after thresholding, a lightweight check removes false-positive query patches unless a majority of support views agree that their top-3 most similar patches actually lie inside the support mask.

Datasets

Because the method is completely training-free, no training datasets are used (apart from leaving one dataset out on a small fold-0 split to fix two global scaling hyperparameters). Evaluation spans nine diverse benchmarks (no new datasets are introduced):

  • Semantic Segmentation: COCO-$20^i$, LVIS-$92^i$ (920 long-tailed classes), ISIC2018 (skin lesions), Chest X-Ray, iSAID-$5^i$ (aerial/remote sensing), and SUIM (underwater imagery).
  • Part Segmentation: PASCAL-Part and PACO-Part.
  • Personalized Segmentation: PerMIS (segmenting a specific instance, like "this exact car", evaluated at 1-shot).

Key Insights and Ideas

  • It’s a calibration problem, not a class-prior problem: You might think cutting at $0$ fails on datasets with small objects simply because foreground isn't 50% of the image. Shockingly, plugging the true oracle foreground fraction into Bayes' rule actually makes performance worse ($52.4 \rightarrow 51.5$ mIoU)! Yet taking that exact same fraction of top-ranked pixels recovers 66.2 mIoU (just $0.4$ shy of the oracle limit). Why? Because patch similarity shrinks and shifts asymmetrically when moving from support to query. The ranking of pixels is great; the numerical zero is broken.
  • Classical histogram separators work—if they look in the right place: 1960s–80s histogram thresholding rules aren't obsolete; they just choke on unimodal distributions dominated by background. Restricting the view to $\{s > 0\}$ turns a lopsided tail into a clean bimodal problem where the valley sits right next to the optimal cut.
  • Forward and backward matching naturally tag-team across shot counts: Forward attention boosts recall at 1-shot and naturally flattens out as shots increase, while the majority-vote backward veto boosts precision as more views are added—requiring zero manual scheduling across shot counts.

Key Results

  • 1-Shot State-of-the-Art: Reaches 58.6 mIoU averaged across all nine benchmarks, beating every training-free baseline on every single dataset (+3.9 over INSID3, +4.8 over FROST).
  • Massive Gains on Object-Centric Data: Over FROST, the biggest leaps happen where score contraction is worst: +10.6 mIoU on COCO-$20^i$ and +10.0 mIoU on LVIS-$92^i$, while still gaining +5.7 mIoU on Chest X-Ray (reaching 90.5 mIoU).
  • Multi-Shot Scaling: Achieves 66.0 mIoU at 5-shot (+2.3 over FROST) and maintains the lead across 1, 3, 5, and 10 shots.
  • Ablation MVP: Replacing the fixed cut with the adaptive threshold is by far the single biggest contributor, adding +7.2 mIoU at 1-shot and +8.5 mIoU at 5-shot.

Limitations and Future Work

The authors highlight two main limitations and three clear avenues for future work:

  • Need for both classes: Density ratios require both foreground and background anchors in the support image. If a support mask covers 100% of the image—or is just a tiny sliver—one density is undefined or noisy.
  • Purely visual matching: If a query target is semantically related to the support but looks completely different visually, patch features alone won't bridge the gap without multimodal/semantic reasoning.
  • Remaining headroom: Even on the exact same score map, the per-episode oracle cut still sits 7.8 mIoU above their adaptive rule at 1-shot—meaning threshold estimation isn't completely solved. Furthermore, adapting features per episode and moving beyond a fixed $64 \times 64$ patch grid (via adaptive patching) could push performance even higher.

Summary updated

BibTeX
@misc{sterzinger2026where,
  author = {Rafael Sterzinger and Robert Sablatnig},
  title = {{Where to Cut? Adaptive Thresholds for Density-Ratio Few-Shot Segmentation}},
  year = {2026},
  eprint = {2611.35977},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.35977},
}
Figure