Adversarial domain adaptation retrains a model so that it works in a new setting, say sketches instead of photos, by adding a second network called a discriminator. The discriminator tries to tell whether an internal representation came from the old setting or the new one, and the main model is trained to fool it. The method has a basic weakness. The discriminator has to learn what the new setting looks like, and when only one to five target images exist it overfits them and stops giving a useful signal. The literature disagrees about whether this can be fixed. Few-Shot Adversarial Domain Adaptation (FADA) gets around it by pairing each scarce target image with many source images. Multi-source Few-shot Domain Adaptation (MSFAN) concludes that adversarial training cannot learn invariant features from so little data and drops it entirely.
We propose to settle that disagreement with an idea taken from research on how humans learn so efficiently. People recognize a new object from one example partly because they see it as a composition of reusable parts. Wings, beaks and strokes recur across many categories and many images. If the discriminator compares parts instead of whole images, each target image supplies many samples, one per part. The parts are also shared across classes, so they are better matched between domains. Our claim is that a discriminator conditioned on part identity stays trainable at one to five target images where a whole-image discriminator does not. We also claim that this part decomposition, more than the adversary itself, is what closes the few-shot domain gap. The experiments are built so that either half of this claim can fail on its own.
Core Claim
Work on the sample efficiency gap shows that compositional structure buys large gains with little data. One-shot learning by inverting a compositional causal process models handwritten characters as stroke programs and reaches 4.8% one-shot error on Omniglot, against 4.5% for humans and 18% to 38% for deep networks of the time. One Shot Learning via Compositions of Meaningful Patches reports 68.86% one-shot MNIST accuracy, against 28.01% for a convolutional network. These papers motivate the proposal. They show that parts give strong priors, but they never put parts inside an adversarial alignment loop.
Learning Compositional Representations for Effective Low-Shot Generalization (RPC) supplies the method we reuse. It learns a fixed number $M$ of attention-selected part features per image without part annotations and maps them onto a dictionary of prototypes. Its domain transfer on SVHN→MNIST is passive: no discriminator aligns parts across domains.
The existing few-shot adversarial methods each align something other than parts. FADA aligns global embedding vectors. Spectral Adversarial MixUp for Few-Shot Unsupervised Domain Adaptation (SAMix) aligns the low-frequency Fourier amplitude of images, which captures colour and texture style. That assumption fails when the shift changes shape, as in sketch-to-photo. Meta-Learning Adversarial Domain Adaptation Network for Few-Shot Text Classification applies a global discriminator to text episodes.
What would be new here is a discriminator that receives single part features together with the identity of their part slot. Concretely, let $z_m(x)$ be the feature of part slot $m \in \{1,\dots,M\}$ in image $x$, and let $D(z, m)$ be the discriminator's probability that a part feature came from the source. Training solves
$$\min_{f}\max_{D}\; \mathcal{L}_{\text{task}}(f) + \lambda \sum_{m=1}^{M}\Big(\mathbb{E}_{x_s}\log D(z_m(x_s), m) + \mathbb{E}_{x_t}\log\big(1 - D(z_m(x_t), m)\big)\Big),$$
where $f$ is the feature extractor, $x_s$ and $x_t$ are source and target images, and $\lambda$ weights the alignment term. The key quantity is the target sample count the discriminator sees. With $n$ target images it nominally gets $nM$ part samples instead of $n$ whole-image samples. Parts within one image are correlated, so the effective count lies somewhere between $n$ and $nM$, and we will measure where.
Conditioning on $m$ restricts each comparison to like parts. A "beak in a sketch" is aligned to a "beak in a photo", not to a background patch. This is a weaker form of the class-conditional alignment that plain marginal alignment fails to provide.
The approach has a clear limitation. If the frequency of parts differs between domains, part-level alignment will distort features in the same way marginal alignment does under label shift. We report results on domain pairs where this is likely.
Research Program
The work has three components.
The first component is the model. We build on an RPC-style part extractor on a pretrained backbone. A gradient reversal layer, as used in FAN-Net, flips the discriminator's gradient so the extractor learns to confuse it. The discriminator takes the part feature together with a learned embedding of its slot. We run two regimes. In the few-shot supervised regime of FADA, the $n$ target images per class are labeled. In the few-shot unsupervised regime of SAMix, the target images are unlabeled.
The second component is a mechanism study, and it is the heart of the proposal. For whole-image, grid-patch, and part-level discriminators, we measure the discriminator's generalization gap as $n$ varies from 1 to 10. The gap is its source-versus-target accuracy on the target images it trained on minus its accuracy on held-out target images. Our prediction is that the part-level gap shrinks much faster as $n$ grows. We also estimate effective sample size by comparing part-level gap curves against whole-image curves trained with artificially enlarged target sets. Finally, we measure class confusion: the fraction of target features whose nearest source prototype belongs to the wrong class.
The third component is a test of whether the adversary is needed at all. We replace the discriminator with per-slot moment matching, which aligns the mean and covariance of source and target features within each part slot and involves no adversarial game. If this replacement matches the full method, the honest conclusion is that compositional decomposition is the active ingredient. That outcome resolves the FADA versus MSFAN disagreement in MSFAN's favour, but for a different reason than MSFAN gives.
Baselines
The naive reference point is the fine-tuning baseline from FADA. A network is trained on the source domain, then fine-tuned on the few target images. FADA reports 82.3% accuracy for it on MNIST→USPS with one labeled sample per class. We rerun it with the same backbone as every other method.
The strongest adversarial competitor in the few-shot supervised regime is FADA itself, which pairs target and source samples and uses a four-way discriminator over same-class and different-class pairs. It reports 89.1% accuracy on MNIST→USPS with one sample per class. We will count our method as beating it if it exceeds this figure in our rerun under matched conditions, with the gap outside seed variance. On Office, FADA reports parity with earlier methods but no number appears in the file. We therefore rerun it there and on Office-Home and the DomainNet subset.
The strongest non-adversarial competitor is MSFAN, which uses prototype-based self-supervision and pseudo-labels. Its reported results are relative gains: a 20.2% mean improvement on Office, 9.4% on Office-Home and 16.2% on DomainNet. No absolute accuracy for MSFAN is found on Lacuna. We therefore reimplement it in a single-source few-shot setting and compare absolute accuracy directly.
In the unsupervised regime, the strongest competitor is the Advent adaptation method with SAMix added. On one-shot REFUGE→RIM-One fundus segmentation it reaches 78.48% Dice, against 64.43% for Advent alone. No reported result is found on Lacuna for SAMix on natural-image or sketch shifts. We run SAMix on the same classification backbone for PACS and the DomainNet subset.
All methods share the same pretrained backbone, the same source data, and the same target images, drawn with identical random seeds. Each gets an equal hyperparameter search budget, such as 20 configurations, selected on a held-out target validation split of the same size $n$. All are trained for equal wall-clock time. SAMix's inner optimization loop counts against its compute budget.
Two ablations isolate the key ingredients, and they are as important as the external baselines. The grid-patch discriminator uses the same number $M$ of samples per image but takes them from fixed spatial cells with no slot conditioning. It tests whether semantic parts matter or whether more samples alone are enough. The per-slot moment-matching variant tests whether the adversary itself matters.
Why not just…?
Why not just fine-tune on the few target images? FADA's own comparison shows that fine-tuning trails pair-based adversarial alignment by almost seven points on one-shot MNIST→USPS, at 82.3% against 89.1%. We keep fine-tuning as the floor in every table. We do not expect it to compete when the shift is large, as in sketch-to-photo.
Why not just use local patches instead of learned parts? This is the most serious threat. Patch-level alignment also multiplies the number of samples the discriminator sees, and it needs no part extractor. The grid-patch ablation settles the question. On digits, where objects fill the frame, we expect patches to come close to parts. On PACS sketch and DomainNet, background cells should dominate the grid, and aligning them should mix object and background statistics. If patches match parts on those benchmarks too, then the contribution reduces to the claim that local features cure discriminator starvation, and we will report it that way.
Why not just drop the adversary, as MSFAN does? MSFAN's reported gains are real, but they depend on pseudo-labels for the target domain. These are least reliable at one shot and under severe shift. A non-adversarial method is a threat only if it gets the benefit of part structure, so the per-slot moment-matching ablation is the fair test. If it ties the adversarial version, we adopt it and say so.
Why not just use spectral mixing like SAMix? SAMix's authors state that its split between amplitude as style and phase as structure may not capture geometric or structural differences between domains. Sketch and clipart domains change shape, not only colour and texture. The PACS and DomainNet comparisons show directly whether this limitation costs accuracy.
Proposed Experiments
We start with digits, MNIST→USPS and SVHN→MNIST, because they connect to reported numbers and support the mechanism study cheaply. We then move to Office, Office-Home, the four-domain, 126-class DomainNet subset, and PACS with sketch as the target. In each case we sweep $n \in \{1, 3, 5, 10\}$ target images per class, in both supervised and unsupervised regimes, with five seeds each. RPC's 95.2% on SVHN→MNIST is not a few-shot target-adaptation result, so we use it only as context.
The metrics are target accuracy, the discriminator generalization gap, the class-confusion rate, and accuracy against compute.
The claim is supported if four conditions hold. First, the part-level discriminator's generalization gap at $n=1$ is clearly smaller than that of the whole-image discriminator. Second, accuracy beats FADA's 89.1% on one-shot MNIST→USPS. Third, the part-level method beats FADA, MSFAN and SAMix on PACS sketch and DomainNet at $n \le 3$. Fourth, the advantage of part-level alignment over grid-patch alignment grows on cluttered domains.
The claim is refuted if any of three things happens. The grid-patch discriminator ties the part-level one everywhere. The gap curves for parts and whole images overlap. Or gains vanish on domain pairs where part frequencies shift, which would show that slot conditioning does not protect against class confusion.
References
- Few-Shot Adversarial Domain Adaptation
- Multi-source Few-shot Domain Adaptation
- One-shot learning by inverting a compositional causal process
- One Shot Learning via Compositions of Meaningful Patches
- Interpretable Compositional Representations for Robust Few-Shot Generalization
- Spectral Adversarial MixUp for Few-Shot Unsupervised Domain Adaptation
- Meta-Learning Adversarial Domain Adaptation Network for Few-Shot Text Classification
- Fan-Net: Fourier-Based Adaptive Normalization for Cross-Domain Stroke Lesion Segmentation