Abstract
In this paper, we address the problem of adapting models from a source domain to a target domain, a task that has become increasingly important due to the brittle generalization of deep neural networks. While several test-time adaptation techniques have emerged, they typically rely on synthetic toolbox data augmentations in cases of limited target data availability. We consider the challenging setting of single-shot adaptation and explore the design of augmentation strategies. We argue that augmentations utilized by existing methods are insufficient to handle large distribution shifts, and hence propose a new approach SiSTA, which first fine-tunes a generative model from the source domain using a single-shot target, and then employs novel sampling strategies for curating synthetic target data. Using experiments on a variety of benchmarks, distribution shifts and image corruptions, we find that SiSTA produces significantly improved generalization over existing baselines in face attribute detection and multi-class object recognition. Furthermore, SiSTA performs competitively to models obtained by training on larger target datasets.
Introduction
Deep learning models are notoriously brittle; they perform exceptionally well on data from their training distribution but often fail when faced with even minor environmental changes, such as shifts in lighting, style, or sensor noise. While Source-Free Domain Adaptation (SFDA) has emerged as a viable strategy to mitigate this without requiring access to original training data, most existing methods still necessitate a substantial batch of target-domain images to be effective.
This research addresses the extreme constraint of Single-Shot Adaptation, where only a single image from the target domain is available. We introduce SiSTA (Single-Shot Target Augmentations), a framework designed to bridge the domain gap by leveraging generative models to create a diverse, target-aware synthetic dataset for model fine-tuning.
Methodology
The SiSTA framework operates in two distinct stages: generative fine-tuning and target-aware synthesis.
1. SiSTA-G: Generative Fine-Tuning
The process begins with a StyleGAN model pre-trained on the source domain. To adapt this generator to the target domain using only one image, we employ a fine-tuning strategy centered on a "style-mixing" protocol. By blending the content of the single target image with various random latent styles, the generator is prevented from simply memorizing the target example (overfitting). This ensures the latent space remains flexible and capable of generating variations rather than a single static output.
2. SiSTA-S: Target-Aware Synthesis
Once the GAN is tuned, the challenge shifts to generating diverse data that effectively represents the target distribution. We propose two novel "activation pruning" strategies to curate this data:
- Prune-Zero: This strategy identifies the weakest activations within the GAN’s style layers and sets them to zero. By systematically stripping away specific style information, the model creates a more "generic" representation, which encourages the classifier to learn domain-invariant features.
- Prune-Rewind: Instead of zeroing activations, this method replaces weak activations in the fine-tuned GAN with those from the original source GAN. This creates a smooth interpolation between the source and target domains, effectively mixing the two manifolds to provide a richer set of training augmentations.
Following synthesis, these images are used to train the original classifier using Neighborhood Retrieval Correlation (NRC), a standard SFDA algorithm.
Experimental Evaluation
We evaluated SiSTA across several benchmarks, including CelebA-HQ (face attributes), AFHQ (animal faces), CIFAR-10, and DomainNet (multi-domain object recognition).
Key Results
- Face Attribute Detection: On the CelebA-HQ benchmark involving grayscale and inverted color shifts, SiSTA improved average accuracy by 17.73% over the source-only baseline. For specific challenging attributes like "Bangs" or "Blond Hair," gains reached nearly 30%.
- Object Recognition: On the DomainNet Sketch domain, SiSTA improved accuracy from 43.8% to 48.1%, outperforming generic augmentation baselines.
- Efficiency: Remarkably, SiSTA—using only a single target image—performed competitively with models adapted using the entire unlabeled target dataset.
Discussion and Insights
One of the most significant findings is the effectiveness of information removal. Pruning activations (either via zeroing or rewinding) proved more effective than standard generative sampling. This suggests that creating a spectrum of images that bridge the gap between source and target is more valuable for adaptation than simply generating more images in the target style.
Furthermore, SiSTA demonstrates an "implicit manifold mixing" effect. Even when the single target image belongs to only one class, the adaptation improves performance across all classes in a multi-class model. This indicates that the GAN successfully learns a general "style shift" applicable to the entire data manifold.
From a practical standpoint, SiSTA supports a vendor-client privacy model. A vendor can provide a pre-trained GAN and classifier, while the client provides a single target image to receive synthetic augmentations. This allows for local adaptation, protecting the privacy of the client's data and the proprietary nature of the vendor's source data.
Conclusion and Future Work
SiSTA provides a robust framework for model adaptation in data-scarce environments. While the method currently relies on the availability of a high-quality pre-trained GAN for the source domain, it significantly outperforms traditional test-time adaptation methods. Future research will focus on expanding the applicability of SiSTA to domains where GANs are less mature and developing a deeper theoretical understanding of optimal pruning ratios for different distribution shifts.
Summary updated