Adapting the Frequency Response of Filters for Cross-Domain Few-Shot Learning

When a vision model trained on natural photos must learn new classes from one to five labeled images of chest X-rays, satellite tiles, or skin lesions, it fails largely because the low-level statistics of the images have changed. Contrast, texture, sensor noise and edge sharpness all differ. Two literatures already use the Fourier and cosine transforms on this problem, but they use them in unrelated ways. Cross-domain few-shot methods split image features into frequency bands and then adapt with ordinary convolutions. Separately, parameter-efficient fine-tuning methods store weight updates as a handful of frequency coefficients. The second group takes those frequencies over the row and column indices of a weight matrix, and those indices are channel numbers whose order carries no meaning. A "low-frequency" weight update in these methods has no relation to low image frequencies.

We propose to apply the compressed spectral parameterization only along weight axes that index pixel or token positions. These are the taps of convolution kernels, the 16×16 pixel grid inside a Vision Transformer's patch embedding, and the 2D token grid of its position embeddings. On those axes, restricting a weight update to a set of cosine frequencies restricts which image frequencies the adapted filter responds to. The result is an adapter with a few thousand parameters whose effect on image spatial frequency is explicit and controllable, chosen per target domain from the support set. This is a new few-shot adapter. It also gives a controlled instrument for settling an open contradiction: some papers treat low frequencies as domain "style" and others treat them as invariant "content."

Core Claim

A weight update is band-limited when it is built only from a chosen set of cosine basis patterns. If those patterns run along spatial axes and the update has a small parameter budget, it should do two things in 1–5-shot cross-domain transfer. It should match or beat feature-domain frequency methods and channel-axis spectral fine-tuning. It should also reveal, per target domain, which image-frequency band needs re-tuning. Our hypothesis is that the best band moves with domain distance. Near domains such as CropDiseases should want little change, or changes only in high bands. Far domains such as ChestX should need re-tuning of low and mid bands, where global contrast and intensity statistics differ. If this holds, FreqGRL and FADA are not contradicting each other. They are sampling different points on the same curve.

Concretely, for a layer whose weight $W$ has an output channel axis, an input channel axis, and a spatial tap grid of size $k\times k$, we write the update as

$$\Delta W = \sum_{u \in B} A_u \otimes \phi_u,$$

where $\phi_u$ is the 2D cosine basis pattern at spatial frequency $u$ on the $k\times k$ grid, $B$ is the chosen frequency band, and $A_u$ is a small learned matrix mixing input to output channels, kept low-rank. Because the cosine patterns are orthogonal, the update can only pass information carried by the band $B$ of each input patch. Parameter count scales with $|B|$ times the channel-mixing rank, independent of image resolution.

Where This Sits Relative to Prior Work

The weight-side machinery comes from the compressed-weight line of work. Training and Generating Neural Networks in Compressed Weight Space synthesizes dense weights from a small set of frequency coefficients through a differentiable inverse transform. Earlier neuroevolution work did the same in cosine space to shrink search (Compressed Network Complexity Search; Evolving large-scale neural networks for vision-based TORCS, which evolved over a million weights through 200 coefficients). Those early papers notably compressed along spatially meaningful weight axes. We reuse that mechanism directly.

The modern spectral fine-tuning methods are the closest weight-side relatives. FourierFT learns sparse Fourier coefficients of the update over its (output, input) indices. LoCA uses real cosine coefficients and learns their locations. MaCP partitions the update's cosine spectrum into low, mid and high bands. FouRA runs low-rank adaptation after projecting activations into frequency space. CrossSpectra applies a Fourier transform across layer depth. All of them treat frequency as a compression basis over channel or depth indices. None was evaluated in episodic cross-domain few-shot learning. Our proposal differs in where the transform is applied, and that changes what a "band" means: here it is a band of the filter's image-domain response.

The feature-side work motivates the problem and supplies the competitors. FAD splits backbone features into fixed radial bands and adapts each with spatial convolutions. FreqGRL swaps low frequencies between source and target images and enhances high frequencies. Meta-Exploiting Frequency Prior regularizes the backbone with low- and high-frequency branches that it discards at test time. Its authors note that their fixed threshold struggles on ChestX. Lightweight Frequency Masker learns amplitude and phase masks on activations with almost no extra parameters.

These methods either filter activations or add spatially parameterized modules. None constrains which image frequencies the backbone's own filters change. FADA and F2SST treat low frequencies as content, whereas FreqGRL treats them as domain bias. We treat that disagreement as a hypothesis to test across domain distance rather than as a choice to make.

A Broader Study of Cross-Domain Few-Shot Learning constrains the design. It shows that episodic meta-learning loses to plain fine-tuning under large shift, by 12.8% on average. We therefore build on test-time fine-tuning of a pretrained backbone rather than a meta-learned module. Revisiting Learnable Affines for Batch Norm shows that removing batch-norm affine parameters avoids a source-specific trap. We adopt that as a default component, so any gain we report is on top of it.

Research Program

We would build the adapter for two backbone families. On ResNet backbones of the kind used in BSCD-FSL, the update applies to every k×k convolution. The 7×7 stem gives 49 spatial frequencies. The 3×3 kernels give only nine, so on those layers bands are coarse: roughly the constant term, first-order edges, and corner terms. On an ImageNet-pretrained ViT-B/16, the update applies to the patch embedding, whose 16×16 pixel grid gives 256 frequencies. It also applies to the position embeddings, using a 2D cosine basis over the 14×14 token grid. This exposes coarse spatial frequency at the scale of whole objects. Phase is not discarded. A real cosine basis over spatial taps still produces filters whose responses differ in position and sign. This sidesteps the complaint in the file that DCT-based weight methods throw away phase. They throw it away only because their axes have no spatial meaning.

The adapter is trained per episode on the support set with cross-entropy for a fixed number of steps. Band selection is studied in three ways. The first is an oracle that sweeps radial bands on held-out target episodes. The second is leave-one-out accuracy on the support set. The third is a cheap statistic: the ratio of the target support images' average amplitude spectrum to the source spectrum, which locates where the shift lives. We would test two competing rules against the oracle. One is "adapt where the shift is." The other is "protect where the class content is," estimated from how much each band contributes to support-set class separation under the frozen backbone. Finally, we would replace hard band selection with learnable soft coefficients over frequencies, a band-level analogue of LoCA's location learning, and check whether this beats discrete selection when only five images per class are available.

Baselines

The naive reference point is the frozen pretrained backbone with batch-norm affines removed and a linear classifier or prototype head trained on the support set. Every method must clear this. Guo et al. show that frozen or lightly tuned transfer is hard to beat under large shift. The file gives no per-dataset BSCD-FSL numbers for this baseline (no reported result found on Lacuna for per-domain BSCD-FSL accuracy of fine-tuning or Feature Normalization), so we will measure it ourselves under our exact protocol.

Next come standard fine-tuning and LoRA applied to the same layers our adapter touches. These test whether a small, unconstrained update to the stem or patch embedding already captures the gain. Both are tuned on the same validation episodes with the same step budget and learning-rate grid as our method.

The key ablation is channel-axis spectral fine-tuning. This is FourierFT, and MaCP's banded cosine variant, applied to the same layers at an identical parameter count. Here frequency coefficients are taken over the output and input channel indices instead of the spatial taps. If this matches our method, the spatial meaning of the band does not matter and the gain is just parameter reduction. A second ablation keeps our spatial-axis construction but replaces the chosen band with a random set of frequencies of the same size. This separates "band-limited" from "low parameter count."

The strongest feature-domain competitors are FreqGRL, FAD and Meta-Exploiting Frequency Prior, each on its own benchmark. FreqGRL reports 81.21% average 5-way 5-shot and 61.91% 5-way 1-shot accuracy on miniImageNet → CUB, Cars, Places, Plantae. Meta-Exploiting Frequency Prior reports 46.85% average 5-way 1-shot accuracy across eight targets including EuroSAT, CropDisease, ChestX and ISIC. FAD reports 79.1% average accuracy on Meta-Dataset unseen domains, against 78.6% for ProLAD and 77.2% for TSA.

Because backbones and pretraining differ across these papers, we will re-run their public configurations where possible on our backbone. We will report both their published numbers and our matched re-runs. Beating a competitor means exceeding its matched re-run by more than the 95% confidence interval over 600 episodes. It also means not falling below its published number on the same benchmark.

For the activation-masking alternative, we compare against the Lightweight Frequency Masker's amplitude-phase masks, ported to classification on the same layers. It is the closest "few parameters, frequency-aware, test-time" competitor.

Why not just…?

Why not just filter the input images with a learned frequency mask? This is the most serious threat. A band-limited update to the first layer looks a lot like reweighting input frequencies. The two differ in one respect. An input mask can only rescale what the frozen filters already see. Our update adds new responses inside a band, with channel-specific mixing, while leaving the original response intact. We will run a learned per-frequency input mask with a frozen backbone, and an input mask plus linear head, at matched budget. If either matches our method on ChestX and ISIC, the weight parameterization adds nothing, and the honest conclusion is that cheap input-spectrum calibration suffices. In that case we would reposition the work as a study of which band to calibrate.

Why not just use LoRA or full fine-tuning on the early layers? FourierFT and LoCA show that spectral parameterizations match LoRA at far fewer parameters. However, they showed this only with plentiful downstream data, which is exactly the regime that does not apply here. FouRA's evidence that LoRA collapses on small adaptation sets is suggestive but comes from image generation. So this remains an open empirical question, settled by the matched-budget LoRA and fine-tuning baselines. We will also record the gap between support and query accuracy, to show whether band limitation reduces overfitting rather than just parameter count.

Why not just use an existing feature-domain frequency method like FAD or FreqGRL? These are strong, and on near domains they may win. They do not change what the backbone's filters respond to. Their fixed bands are acknowledged weaknesses by FAD and by the Meta-Exploiting Frequency Prior authors, the latter specifically on ChestX. Our prediction is concrete: gains should concentrate on far domains, ISIC and ChestX, where per-domain band choice matters. If the feature-domain methods match us there, the claim fails.

Why not just apply FourierFT to a ViT for few-shot transfer? This would be the obvious port. It is exactly our channel-axis ablation, and we include it at matched parameters. If channel-index frequencies did as well as spatial ones, our central argument about where frequency is meaningful would be wrong.

Proposed Experiments and Decisive Checks

The main evaluation uses three benchmarks. The first is BSCD-FSL (ImageNet → CropDiseases, EuroSAT, ISIC2018, ChestX), 5-way 1- and 5-shot, 600 episodes per domain. The second is miniImageNet → CUB, Cars, Places, Plantae, for direct comparison with FreqGRL. The third is the Meta-Dataset unseen domains, for comparison with FAD. Both backbone families are used throughout. We report accuracy with 95% confidence intervals, trainable parameter count, and per-episode adaptation time. As an optional addition, transductive inference in the style of Boudiaf et al. can be added uniformly on top of all methods, to check that gains survive a stronger inference rule.

Four checks decide the outcome. First, at an identical parameter count, the spatial-axis band-limited update must beat both the channel-axis spectral update and the random-band update on the far domains. If it does not, the core idea fails. Second, it must beat the learned input-spectrum mask. If it does not, the weight side is unnecessary. Third, the oracle-best band, plotted against a domain-distance ordering (CropDiseases, EuroSAT, ISIC, ChestX), should shift systematically. If it shifts, that is evidence the low-frequency style-versus-content disagreement depends on shift severity. If it does not shift, it tells us one of the two published views is simply more often right. Fourth, at least one support-set-only band selection rule must recover most of the oracle's gain. Otherwise the method is an analysis tool rather than a usable adapter.