When a lesion detector trained at one hospital runs at another, its boxes often land slightly off. The usual explanation is that the model "sees" worse: new scanner noise, new contrast, new optics. This note argues that a large and so far unmeasured share of the localization error has a different cause, and that it is simple. At a new site, predicted boxes are wrong in a consistent, low-dimensional way. They come out systematically too large or too small, and more so for small lesions. They drift by a consistent offset. They are stretched along one axis. Two sources plausibly produce this. One is physics: pixel spacing, slice thickness and blur change how wide a boundary looks. The other is annotation convention. DeepLesion boxes, for example, are radiologist diameter measurements padded by a fixed 20 pixels. That padding means a different number of millimetres on every scanner, so the "correct" box is itself defined differently from one dataset to the next.
The geometric box losses developed for detection give a natural coordinate system for pulling this systematic component apart from random error. These are objectives that score a box by its separate factors: centre distance, width-to-height ratio, and corner offsets. We propose to measure how much cross-site localization error is a shared per-site geometric transform. We then correct it source-free, from a handful of labeled target boxes, by fitting roughly six parameters in physical millimetre coordinates. The feature extractor and classifier are left untouched. If the systematic share is large, a clinic can repair localization with ten boxes instead of retraining. If it is small, we will have shown that cross-site box error is genuinely a representation problem. That answer is still useful, because every existing medical adaptation method assumes it without checking.
Core Claim
The claim has two parts. Under cross-institutional shift, a substantial fraction of the drop in box quality at strict overlap thresholds is explained by one per-site transform in box-parameter space. Because that transform depends on lesion size, a physically parameterized correction fitted on 5–50 target boxes recovers most of that fraction. It does so more reliably than fine-tuning the regression head on the same boxes.
We write a predicted box as centre $c$ (in mm), size $s = (w, h)$ (in mm), and physical pixel spacing $\rho$ from the image header. The correction is
$$c' = c + s \odot \delta, \qquad \log s' = (1+\beta)\log s + \gamma + \eta \log \rho,$$
where $\delta$ is a relative centre offset, $\gamma$ a per-axis log-scale bias, $\beta$ a size-dependent inflation term, and $\eta$ a spacing-dependent term. Together these give six scalars for 2D boxes. We fit them by minimizing the Vertex Distance IoU loss, computed in millimetre coordinates rather than pixels, over target boxes that have been matched to predictions. The term $\beta$ exists because blur widens small objects proportionally more than large ones. The term $\eta$ exists because a fixed-pixel padding convention becomes a spacing-dependent millimetre offset.
The diagnostic quantity is the systematic share: the fraction of target-domain localization loss removed by an oracle fit of these six parameters on all target boxes. A large systematic share motivates the few-shot method. A small one refutes the premise.
Relation to Prior Work
Two groups of prior work motivate the question, and neither answers it. The geometric losses were all built and tested within a single domain. Distance-IoU centroid penalties (Zhe Cheng et al.) and CIoU's aspect-ratio term (Complete Intersection over Union for Bounding Box Regression, Tingyao Jiang et al.) fall in this group. So does PAC-Net, which replaces angle-based aspect terms with corner distances normalized by the enclosing diagonal and reports 36.3% mAP against 20.8% for Faster R-CNN on DeepLesion. None of them asks how these factors behave when the scanner changes. We reuse PAC-Net's vertex loss as our fitting objective, but we move it into physical coordinates and use it at a new site rather than only in training.
Medical detection under shift has adapted everything except geometry. InvNorm normalizes image style with an invertible flow across ten capsule-endoscopy sensor brands. MIAdapt handles the source-free few-shot microscopy setting with resolution-aware resizing and category contrastive learning. CNDAD-Net aligns CT features adversarially. All three leave box regression standard.
The closest work is D-adapt. It shows that localization needs its own adaptor, separate from the detector, and trains a box adaptor with an "IoU disparity discrepancy" objective. Our proposal differs in three ways. D-adapt needs source data and unlabeled target images and runs three rounds of self-training, while we need neither source data nor retraining. Its adaptor is a full network, while ours is a six-parameter, physically interpretable transform. It was evaluated only on artistic, weather and synthetic shifts, never on medical data.
Two papers constrain the design. Box-Adapt found that adversarial alignment dropped CHAOS→SLIVER liver Dice from 0.740 (source only) to 0.643. This is why we avoid touching features at all. DeepLesion documents missing annotations and its fixed 20-pixel padding. This is why calibration pairs must be restricted to confidently matched predictions, and why a convention term is needed at all.
Research Program
The work has three stages. First, we train source detectors with each regression loss: smooth $L_1$, DIoU, CIoU, and pixel-space VDIoU. We evaluate them on target sites and compute the systematic share per loss, per lesion-size bin, and per factor (centre, scale, aspect). This directly answers whether geometric losses trained in-domain are themselves robust to shift.
Second, we implement the few-shot calibration. It fits the six parameters with robust matching: Hungarian assignment at IoU above a threshold, with unmatched predictions ignored rather than penalized. We sweep $k \in \{5, 10, 25, 50\}$ target boxes.
Third, we test whether the calibration is a property of the site. A transform fitted on some patients from site B should transfer to held-out patients from site B. It should fail on site C.
The settings span three physical regimes. In CT, we train on DeepLesion lung lesions and test on LUNA16 nodules, whose boxes come from unpadded diameters. This is a clean convention-plus-scanner shift. In microscopy, we use M5-Malaria across microscopes, where resolution differs, matching MIAdapt's protocol. In endoscopy, we use leave-one-brand-out on the ten-sensor GI dataset used by InvNorm, if brand labels are released per image, because optics distort aspect ratio there. VinDr-CXR's two hospitals serve as a fourth setting only if site identity can be recovered from the DICOM metadata; the file does not confirm this.
Baselines
The naive reference is the source detector applied unchanged. It uses the best in-domain regression loss, chosen per setting on source validation data. Any method must beat it at strict overlap thresholds, not only at IoU 0.5.
The second reference is the same detector after isotropic resampling of all images to a common physical spacing. This is the default preprocessing practice. It is the strongest cheap competitor to the physics part of our claim, and we will always apply our calibration on top of it, so that any gain is net of resampling.
The strongest few-shot competitor is fine-tuning the box-regression head, and optionally the last detector block, on the same $k$ target boxes. It gets matched learning-rate and early-stopping budgets tuned on a held-out target split of equal size.
The strongest existing adaptation methods run under their own data assumptions, which we state explicitly. D-adapt gets source data and unlabeled target data, which is more information than our method has. MIAdapt runs in its own source-free few-shot setting. MIAdapt reports a 21.3% mAP gain over source-free unsupervised adaptation and 4.7% over few-shot adaptation on Raabin-WBC. The corresponding M5-Malaria numbers are not in the file, so we will rerun it. D-adapt's reported best is 49.0 mAP on VOC→Clipart1k against 27.8 unadapted; no reported result found on Lacuna for D-adapt on any medical benchmark. The only reported figure on our CT target is CNDAD-Net's in-domain LUNA16 [email protected] of 0.889. There is no reported result found on Lacuna for DeepLesion→LUNA16 cross-dataset detection, so we will establish it.
Beating a baseline means one of two things. Either our calibration improves AP averaged over IoU 0.5–0.75 at equal $k$, with patient-level bootstrap intervals excluding zero. Or it adds to D-adapt when stacked on it, which would show the gains are complementary.
Three ablations isolate the key ingredients. We fit in pixel space instead of millimetres. We drop the size term $\beta$ and the spacing term $\eta$. We replace VDIoU with $L_1$ as the fitting loss.
Why not just…?
Why not just resample every scan to the same millimetre spacing? Resampling fixes the spacing-driven part of the shift. It cannot fix blur-driven scale inflation or a label convention like pixel-fixed padding, which happen after, or independently of, spacing. The resampled baseline and the "calibration after resampling" condition settle this directly. If calibration adds nothing on top of resampling, the physics motivation collapses to standard preprocessing, and we will report that.
Why not just fine-tune the regression head on the few target boxes? This is the real threat. With 25–50 boxes, head fine-tuning may match the calibration. Our expectation is that it overfits at $k \le 10$ and has no interpretable handle for transfer across patients. The $k$ sweep decides the question. If fine-tuning matches calibration at every $k$, the method contribution shrinks and the diagnostic becomes the contribution: the systematic share, and its dependence on size and loss.
Why not just train with CIoU or VDIoU and assume robustness follows? No paper in the file tests this. Stage one measures it. If geometric losses trained in-domain already give a small systematic share at target sites, calibration is unnecessary for them, and that is a publishable finding about those losses.
Why not use D-adapt's box adaptor? It needs source data, which privacy rules often forbid, and iterative retraining. Its medical performance is unknown. We run it where source access is allowed, and we test stacking our calibration on it.
Decisive Checks
The premise lives or dies on three results. The first is the oracle systematic share. If it falls below roughly a quarter of target localization loss in all three settings, we abandon the correction method and report the diagnostic. The second is the size dependence: small lesions should show larger fitted $\beta$-driven inflation, consistent with the finding that degradation concentrates in small structures. The third is site specificity: a transform fitted on site-B patients should improve held-out site-B patients and should not improve, or should harm, site C.
A further check is specific to the DeepLesion→LUNA16 pair. The fitted spacing term $\eta$ should be clearly nonzero, as the 20-pixel padding predicts. The correction should also shrink its scale terms once the DeepLesion training boxes are de-padded, which confirms that the correction is capturing a real convention artifact.
References
- YOLOv3 Object Detection Algorithm with Feature Pyramid Attention for Remote Sensing Images
- An Improved YOLOv5s Algorithm for Object Detection with an Attention Mechanism
- PAC-Net: Multi-pathway FPN with position attention guided connections and vertex distance IoU for 3D medical image detection
- InvNorm: Domain Generalization for Object Detection in Gastrointestinal Endoscopy
- MIAdapt: Source-free Few-shot Domain Adaptive Object Detection for Microscopic Images
- Design of a Lung Lesion Target Detection Algorithm Based on a Domain-Adaptive Neural Network Model
- Decoupled Adaptation for Cross-Domain Object Detection
- Box-Adapt: Domain-Adaptive Medical Image Segmentation using Bounding BoxSupervision
- DeepLesion: automated mining of large-scale lesion annotations and universal lesion detection with deep learning