MedRT-SFSeg

Directional Dual-Head Supervision for Real-Time Source-Free Polyp Segmentation

1University of Science, VNU-HCM, Ho Chi Minh City, Vietnam 2Vietnam National University, Ho Chi Minh City, Vietnam
*Equal contribution †Corresponding author
Overview of MedRT-SFSeg: a source-trained dual-head segmentation model is adapted to the target domain with AdaBN and Mean-Teacher self-training, using Mask-DHF, DURR and Seg-MARD.

MedRT-SFSeg adapts a dual-head YOLO segmentation model to a new endoscopy domain without source data, turning the sign of O2O/O2M disagreement into expand-or-shrink supervision. Only the adapted O2O Student is used at inference.

80.4%

Dice, Kvasir → ClinicDB

+7.7 over non-adapted baseline

80.8%

Dice, ClinicDB → Kvasir

+9.8 over non-adapted baseline

62+ FPS

End-to-end on RTX 4060 Ti

640 × 640, batch 1, FP32

10.37M

Deployment parameters

No overhead added by adaptation

Abstract

Source-free domain adaptation (SFDA) is critical for medical image segmentation as it enables model adaptation to unlabeled target domains without compromising source data privacy. However, its effectiveness is often hindered by confirmation bias, where self-training models struggle with small polyps, foreground hallucinations, and imprecise contours.

We propose MedRT-SFSeg, a real-time SFDA framework based on a dual-head O2O/O2M YOLO segmentation architecture. We introduce Mask-DHF to fuse precision- and recall-oriented predictions into stable pseudo-instances, and DURR, which exploits pixel-level disagreement for signed boundary routing to expand or shrink masks while recovering missed instances and suppressing hallucinations. Seg-MARD further regularizes feature representations through mask-guided region-stratified sampling.

Experiments on bidirectional adaptation between Kvasir-SEG and CVC-ClinicDB show that MedRT-SFSeg achieves 80.43%/80.77% Dice and 5.53/8.44 mm ASD, respectively. It improves the non-adapted baseline by 7.7 and 9.8 Dice points while retaining more than 62 FPS end-to-end. These results suggest that segmentation-aware dual-head fusion can improve pseudo-label quality while preserving real-time inference.

Method

Existing uncertainty-based SFDA methods mostly treat uncertainty as a trust decision: unreliable pixels are filtered, down-weighted, or denoised. At an ambiguous boundary, however, the useful question is not only whether a prediction is uncertain but how it should change. An uncertain boundary may mean the mask is too conservative and should expand, or that it has absorbed spurious foreground and should shrink.

YOLO26 exposes two complementary heads: a duplicate-free one-to-one (O2O) head that gives conservative, precision-oriented predictions, and a dense one-to-many (O2M) head that recovers missed instances. MedRT-SFSeg starts from a source-trained YOLO26-S-Seg model, re-estimates BatchNorm statistics on unlabeled target images (AdaBN), and then runs Mean-Teacher self-training in which three training-only components convert dual-head disagreement into segmentation-specific supervision.

Pseudo-instances

Mask-DHF

Extends dual-head fusion from boxes to masks. O2O predictions act as conservative anchors, matched O2M predictions serve as witnesses, and low-overlap O2M predictions become coverage candidates for missed instances. Each prediction receives an instance-level reliability r = √(s · qstab), combining confidence with mask stability across two probability thresholds.

Directional routing

DURR

Dual-Head Uncertainty Reliability Routing keeps the sign of the disagreement. Inside a two-sided boundary band, positive disagreement asks the Student to expand and negative disagreement asks it to shrink. Reliable O2M predictions additionally rescue instances the O2O head misses, and foreground is suppressed where both heads agree there is none.

Feature regularization

Seg-MARD

Adapts representation diversification to segmentation by replacing box-based sampling with pseudo-mask regions. At P3, P4 and P5, features are sampled from foreground, hard background (inside the box, outside the mask) and easy background, then regularized with variance and covariance losses.

Δi(x) = rim Pim(x) − rio Pio(x)

Δ > 0  →  expand the mask Δ < 0  →  shrink the mask

Signed, reliability-weighted disagreement between the aggregated O2M evidence Pm and the O2O anchor Po, used where |Δ| ≥ 0.02.

All auxiliary components (the EMA Teacher, Mask-DHF, DURR and Seg-MARD) are discarded after adaptation. Only the adapted Student O2O branch is deployed, so the model keeps the parameter count and latency of the original YOLO26-S-Seg.

Results

We evaluate both source-free adaptation directions between Kvasir-SEG (1,000 images) and CVC-ClinicDB (612 frames) without changing any component of the method between directions. Baseline is the source-only model evaluated on the target domain; Supervised is the target-supervised upper bound. Dice and Average Surface Distance (ASD) are reported as mean ± std across target images.

Comparison with source-free methods

Method Kvasir-SEG → CVC-ClinicDB CVC-ClinicDB → Kvasir-SEG
Dice (%) ↑ ASD (mm) ↓ Dice (%) ↑ ASD (mm) ↓
Baseline72.8 ± 33.05.9 ± 12.570.9 ± 25.29.8 ± 18.5
Supervised96.0 ± 4.30.6 ± 0.690.3 ± 16.63.7 ± 10.2
ProtoContra78.0 ± 12.10.9 ± 0.668.9 ± 26.49.5 ± 15.0
DPL67.2 ± 24.08.0 ± 12.466.1 ± 33.17.8 ± 17.7
IAPC73.3 ± 29.64.4 ± 7.961.2 ± 26.313.7 ± 13.2
DFG19.1 ± 14.797.5 ± 17.626.8 ± 18.187.5 ± 19.5
UPL-SFDA67.1 ± 14.62.2 ± 0.960.2 ± 31.311.4 ± 17.2
HEAL81.8 ± 22.64.3 ± 8.266.5 ± 28.89.15 ± 11.6
IPLC34.8 ± 11.734.7 ± 22.945.3 ± 21.219.2 ± 8.4
SRPL33.0 ± 22.731.4 ± 19.644.9 ± 26.018.9 ± 16.9
MedRT-SFSeg (Ours)80.4 ± 24.45.5 ± 10.780.8 ± 23.38.4 ± 15.3

Best and second-best among source-free methods.

Ablation study

Configuration Kvasir-SEG → CVC-ClinicDB CVC-ClinicDB → Kvasir-SEG
Dice (%) ↑IoU (%) ↑ASD (mm) ↓ Dice (%) ↑IoU (%) ↑ASD (mm) ↓
Baseline72.7565.545.9270.9463.079.81
Mask-DHF75.8368.175.7875.0466.929.25
Mask-DHF + Seg-MARD77.8970.025.6277.5969.218.84
Mask-DHF + DURR79.0271.925.5879.3371.048.59
Full MedRT-SFSeg80.4372.575.5380.7772.528.44

Real-time deployment

Protocol: RTX 4060 Ti, 640 × 640 input, batch size 1, FP32, 100 warm-up and 500 timed iterations, CUDA-synchronized. End-to-end timing excludes disk I/O. A configuration counts as real-time if it sustains at least 30 FPS end-to-end.

Metric Kvasir → ClinicDB ClinicDB → Kvasir
Full-graph params (M)11.43446311.434463
Fused deployment params (M)10.36572710.365727
Deployment GMACs17.022917.0229
Deployment GFLOPs34.045834.0458
Checkpoint size (MB)22.32222.335
Network mean latency (ms)11.80711.492
Network FPS84.6987.01
E2E mean latency (ms)15.76816.017
E2E p95 latency (ms)15.83016.108
E2E FPS63.4262.43
Real-time (≥ 30 FPS)PASSPASS

Boundary Correction Analysis

Boundary correction analysis on representative target-domain cases: input image, ground truth, Student prediction, error decomposition, boundary overlay and absolute mask error.
From left to right: input image; ground truth; Student prediction; error decomposition (true positive, false positive and false negative regions); overlay of ground-truth (green) and predicted (red) boundaries; and absolute mask error.

Residual errors are often concentrated around polyp contours rather than arising from gross false detections. This boundary-localized behavior is consistent with the motivation of DURR, which uses signed O2O/O2M disagreement to provide explicit expansion or contraction cues near uncertain boundaries.

Limitations

MedRT-SFSeg depends on the dual-head O2O/O2M architecture, which restricts direct transfer to conventional single-head backbones. The shared backbone may also produce correlated errors under severe domain shifts, reducing the effectiveness of reliability routing. Future work will extend the framework to broader architectures and more diverse multi-center clinical data.

BibTeX

@misc{nguyen2026medrtsfseg,
  author = {Nguyen, Hai-Dang and Le, Nhat-Khoi and Huynh, Huu-Thuan and Tran, Minh-Triet and Le, Trung-Nghia},
  title  = {Directional Dual-Head Supervision for Real-Time Source-Free Polyp Segmentation},
  year   = {2026},
  note   = {Manuscript under review},
}