When a model trained on everyday photos is asked to learn new classes from five X-rays or five satellite images, the best current methods use the unlabeled test images themselves. They adjust the classifier so that its predictions on those test images become confident. This is called transductive inference. It has two weaknesses. First, it trusts every test image equally, including images the model cannot represent at all. Second, the usual "become confident" objective quietly assumes the test images are spread evenly across classes. Real clinical or remote-sensing batches rarely are, and under realistic class imbalance these methods can fall below plain non-transductive classifiers.
We propose to make transductive inference ask, for each test image, a question it currently ignores. Is this prediction uncertain because the image is genuinely ambiguous, or because the handful of labeled examples is not enough to pin down the classifier? The second kind, epistemic uncertainty (uncertainty about the model itself), can be estimated cheaply. We run many random dropout passes through a small classifier head fit on the labeled support examples, and measure how much those passes disagree. Test images with low disagreement are used to estimate how the test batch is actually divided among classes, and only those images drive the adaptation. High-disagreement images are left alone. The result is a source-free, test-time procedure for ordinary pretrained backbones. It is designed to adapt without collapsing when classes are imbalanced, and to say which of its predictions on distant domains such as ChestX should not be trusted.
Core Claim
In cross-domain few-shot learning, much of the epistemic uncertainty plausibly sits in the few-shot classifier rather than the frozen backbone: five support images leave many classifiers equally consistent with the data. If so, stochastic forward passes through a dropout-trained head can separate that uncertainty from inherent ambiguity at negligible cost, because backbone features are computed once. This hypothesis is tested directly in the decisive checks below. Our claim is that using this separation in two specific places beats both deterministic transduction and confidence-thresholded self-training when test batches are class-imbalanced and the domain gap is large. The first place is gating which test images enter the transductive objective. The second is estimating the test batch's class proportions, which then replace the uniform-balance assumption.
The motivating evidence comes from two directions. Veilleux et al. show that standard transductive few-shot methods implicitly assume uniform query classes. They report that PT-MAP loses 18% to 20% accuracy under Dirichlet-sampled imbalance and that standard methods can fall below inductive baselines. Their α-TIM partly repairs this by changing the entropy family. Gal et al. establish that dropout kept on at test time approximates Bayesian inference, and that its variance rises on rotated digits where softmax stays confidently wrong. That is exactly the failure that makes deterministic confidence a poor gate under shift.
Relation to Prior Work
Four lines of prior work connect uncertainty to few-shot transfer. None of them uses query-level epistemic uncertainty to control transduction.
The closest is Repurposing Pretrained Models for Robust Out-of-Domain Few-Shot Learning. It perturbs MAML checkpoint weights with Gaussian noise and uses the resulting parameter variance on the support set to shrink per-layer step sizes and scale adversarial support perturbations. Its uncertainty is computed over support-set parameters to steer an optimizer. It never scores query predictions, never touches the unlabeled query set, and is tied to MAML checkpoints. Guo et al. found that MAML trails simple fine-tuning on the BSCD-FSL benchmark (Broader Study of Cross-Domain Few-Shot Learning) by an average of 12.8% accuracy. Our method works on transfer-learning backbones, and its uncertainty is per query image.
Patacchiola et al. (DKT) obtain analytic predictive variance from a Gaussian process with a learned deep kernel. DKT requires end-to-end episodic training of that kernel and was evaluated only up to miniImageNet→CUB. We supply the method's spirit, a Bayesian head on top of features, without retraining the backbone.
Zhang et al. model aleatoric uncertainty in query–prototype similarity during in-domain meta-training and discard the estimator at test time. That is the opposite regime from ours.
Yi et al. (REAP) inject random register tokens into ViT pretraining purely as a flatness regularizer, with no test-time stochasticity.
Among transductive methods, RePRI (Boudiaf et al.) supplies the template we modify. It fits a linear head at test time with support cross-entropy, query entropy, and a KL term pulling predicted class proportions toward a target. RePRI's target proportion is fixed, and every query pixel counts equally. RDC-FT (Li et al.) calibrates query–support distances with k-reciprocal re-ranking. It is deterministic and evaluated on balanced queries.
Two papers constrain the design. Yazdanpanah et al. show that learned batch-norm affine parameters can zero out shifted features. We therefore adopt their fixed-affine feature normalization in the backbone, so that dropout variance is not drowned by this artifact. Open problem 3 in the uncertainty literature warns that deep features may map far-out-of-domain inputs to tight, low-variance clusters. This is a real threat on ChestX, and the experiments test it explicitly rather than assuming it away.
Research Program
The backbone is the standard BSCD-FSL ResNet-10 trained supervised on miniImageNet, with an ImageNet ResNet-50 as a second backbone. Both are frozen, with feature normalization. No target-domain images are used before evaluation, which keeps us in the strict source-free protocol that Islam et al. and the CLDFD work (Paper Cross-Level Distillation and Feature Denoising for Cross-Domain Few-Shot Classification) relax.
For each episode, we fit a linear head with dropout on the penultimate features using the support set. Because the head was trained with dropout, keeping dropout on at test time is the setting Gal et al. justify. For each query image $x$ we draw $T$ dropout passes, giving class-probability vectors $p_1,\dots,p_T$ with mean $\bar p$. Total predictive entropy then splits into an aleatoric part and an epistemic part:
$$ H[\bar p] \;=\; \frac{1}{T}\sum_{t=1}^{T} H[p_t] \;+\; I(x), $$
Here $H$ is Shannon entropy. The first term is the expected entropy of individual passes (ambiguity that persists whatever classifier is sampled). The mutual information $I(x)$ is the remainder, the disagreement between passes, which serves as our epistemic score.
We turn $I(x)$ into a weight $w(x)=\exp(-I(x)/\tau)$, with temperature $\tau$ set from support-set leave-one-out. These weights are used twice.
The first use is estimating the query batch's class proportions:
$$ \hat\pi \;=\; \frac{\sum_{x\in Q} w(x)\,\bar p(x)}{\sum_{x\in Q} w(x)}, $$
where $Q$ is the unlabeled query set. This weighted average replaces the uniform target in a RePRI-style KL proportion term. It is refreshed every few iterations.
The second use is inside the transductive objective itself. Only the entropy-minimization term is weighted by $w(x)$, so images the head cannot yet classify reliably are not pushed toward a confident label. High-aleatoric, low-epistemic images keep their weight in proportion estimation, but their entropy term is capped, so genuine ambiguity is not forced either.
The head is re-sampled as it adapts, so images can move from untrusted to trusted. The final output is the adapted predictions plus a per-query epistemic score, usable for selective prediction (abstaining on the least trustworthy images) on ISIC and ChestX. Cost is $T$ passes through a linear layer on cached features, which sidesteps the inference-latency objection to MC dropout.
Baselines
The naive reference point is the inductive fine-tuning baseline of Guo et al.: a linear head trained on support features from the same frozen, feature-normalized backbone, with no use of queries. Any transductive method that falls below it under imbalance has failed. Veilleux et al. show this happens in-domain, with an inductive baseline at 70.6% 1-shot on CUB under imbalance.
The strongest transductive competitors are of two kinds, both run on our backbone with our episodes.
The first kind is imbalance-aware transduction. α-TIM is the main competitor on the imbalance question. It reports 75.7% 1-shot accuracy on CUB under Dirichlet imbalance versus 74.8% for standard TIM (Veilleux et al.). We found no reported result on Lacuna for α-TIM on BSCD-FSL, so we will run it ourselves.
The second kind is deterministic distance calibration. RDC-FT is the strongest cross-domain transductive method in the file, reporting 51.53% average 1-shot and 63.70% average 5-shot accuracy across eight target domains including the four BSCD-FSL sets (Li et al.). Those numbers come from balanced queries, so we rerun it under our imbalanced protocol. We also run RePRI's objective adapted to classification with a uniform proportion target, which is our method with every uncertainty ingredient removed.
For context we quote, but do not directly compare against, methods using different backbones or unlabeled target data. These are DAMSL v2 at 74.99% BSCD-FSL average (Cai et al.) and REAP at 66.75% average 5-way 5-shot (Yi et al.).
Fairness rules apply to every method. All methods use identical frozen features, identical episodes and query-imbalance draws, and the same number of test-time optimization steps. Each method gets the same hyperparameter-search budget, tuned on a held-out source-like validation split (miniImageNet novel classes under imbalance), never on target domains.
Two ablations isolate the key ingredient. The first is confidence-gated transduction: we keep everything identical but replace $I(x)$ with deterministic predictive entropy $H[\bar p]$, or with one minus max-softmax, and match the effective number of trusted queries. This asks whether the epistemic/aleatoric split matters at all, or only "confidence." The second is proportion-only versus gating-only: each use of $w(x)$ is switched off in turn.
Beating the strongest competitor means accuracy above both α-TIM and RDC-FT, averaged over the four BSCD-FSL domains under Dirichlet imbalance, with 95% confidence intervals not overlapping. It also means accuracy no worse than theirs under balanced queries.
Why not just…?
Why not just gate on deterministic softmax confidence, as in standard pseudo-labeling? This is the most serious threat, and the confidence-gated ablation exists to settle it. The case against it is that softmax can be confidently wrong on shifted inputs while dropout variance rises (Gal et al.). Likewise, adding a dropout-based model-uncertainty signal to the posterior raised the Spearman correlation between estimated confidence and the actual quality of each prediction from 0.477 to 0.625 on IFTTT (Dong). That evidence is out of domain for us. If confidence gating matches our method on BSCD-FSL, the honest conclusion is that the split adds nothing here, and we will report it that way.
Why not just use α-TIM, which already handles imbalance? α-TIM fixes imbalance by changing which entropy is minimized, but it still weights every query equally. On distant domains, the queries the backbone cannot represent will still pull the head. Our prediction is that α-TIM and our method tie on CropDiseases, the domain closest to natural photos, and separate on ISIC and ChestX. If they tie everywhere, the gating idea is not worth its complexity. We will also test the cheap combination of α-entropy with our weights. If that combination wins, it becomes the recommended method.
Why not just ensemble with test-time augmentation or several independently fit heads instead of dropout? These are legitimate sources of stochasticity, and the program does not depend on dropout specifically. We will run a matched-cost variant using $T$ augmented views and one using $T$ heads fit on bootstrap resamples of the support set. Augmentation needs $T$ backbone passes per query rather than $T$ head passes, so it costs far more. If either gives a better epistemic score, measured by how well it ranks wrong predictions above right ones, we will adopt it.
Proposed Experiments
The main benchmark is BSCD-FSL (CropDiseases, EuroSAT, ISIC, ChestX) in 5-way 1-shot and 5-shot episodes. Each query set has a fixed size, with class proportions drawn from a Dirichlet distribution following Veilleux et al.. We sweep the concentration from near-uniform to highly skewed, and also report balanced queries. Secondary evaluation on CUB, Cars, Places and Plantae allows contact with RDC-FT's eight-domain average.
Metrics are accuracy, expected calibration error, AUROC for separating correct from incorrect query predictions, selective accuracy at 80% coverage, and L1 error between $\hat\pi$ and the true query proportions.
Four checks decide whether the idea stands.
The first check asks whether the epistemic signal survives extreme shift. We compute the error-detection AUROC of $I(x)$ per domain. If it drops to chance on ChestX, as the low-variance-cluster concern predicts, we report that as a finding about where head-level stochasticity stops being informative. It would also mean the gate should fall back to uniform weights on such domains. We will test whether a support-set diagnostic, such as near-zero leave-one-out accuracy, can trigger that fallback automatically.
The second check asks whether estimated proportions beat the uniform assumption. The $\hat\pi$ error should be lower with epistemic weights than with deterministic-softmax averages, and that gap should grow with skew.
The third check is the head-to-head against α-TIM and RDC-FT as the imbalance curve steepens. The predicted signature is a widening margin at high skew and on low-similarity domains, with parity under balance.
The fourth check is the decomposition test: on each domain, whether $I(x)$ outperforms total entropy and the aleatoric term alone as an error detector. That test tells us whether the separation itself, not just the stochasticity, is doing the work.
References
- Realistic evaluation of transductive few-shot learning
- Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning
- Repurposing Pretrained Models for Robust Out-of-domain Few-Shot Learning
- A Broader Study of Cross-Domain Few-Shot Learning
- Deep Kernel Transfer in Gaussian Processes for Few-shot Learning
- Uncertainty-Aware Few-Shot Image Classification
- Random Registers for Cross-Domain Few-Shot Learning
- Few-Shot Segmentation Without Meta-Learning: A Good Transductive Inference Is All You Need?
- Ranking Distance Calibration for Cross-Domain Few-Shot Learning
- Revisiting Learnable Affines for Batch Norm in Few-Shot Transfer Learning
- Dynamic Distillation Network for Cross-Domain Few-Shot Recognition with Unlabeled Data
- Cross-Level Distillation and Feature Denoising for Cross-Domain Few-Shot Classification
- Cross-Level Distillation and Feature Denoising for Cross-Domain Few-Shot Classification
- DAMSL: Domain Agnostic Meta Score-Based Learning
- Confidence Modeling for Neural Semantic Parsing