Mitigating Domain shifts

SVG Icon Editor

Deep neural networks often perform well on trained data. However, on unseen data they usually fail to generalize and accompany performance degradation (Vu et al., 2019). This degradation of performance affects systems deployed in real-world environments such as processing images for self-driving cars, processing street views, generating text, and examining cells and tissues through various scanners deployed.

Figure 1: Illustration of domain adaptation and generalization mechanisms. Every color is indicative of sample with domain shift with pink consistently representing the test-data. Legends 'training' and test-time' provide an insight of the source training and target adaptation process.

To deal with such scenarios, domain adaptation (Figure 1a) and domain generalization emerged. Domain adaptation (Pandey et al., 2020) assumes access to target data and focuses on training a source model on the source domain, indicated with blue and pink samples in the training legend. At test time, it only focuses on evaluating the trained model on precomputed test data.
Common domain adaptation techniques focus on utilizing unlabeled target data. This assumption does not hold true in most of the cases since access to target data is only sometimes available. For instance, in scenarios such as self-driving cars (Vu et al., 2019), it is hard to collect all variations of road, weather, and scenes. Hence, domain generalization emerged to counter this.

Domain generalization (Muandet et al., 2013) (Figure 1b) assumes no access to target data while training a source model on multiple source domains indicated with different colors in the training legend. At test time, akin to domain adaptation, they evaluate precomputed test data. Existing methods focus on aligning the source distributions for invariant learning, training the model with meta-learning, augmenting domain data to resemble target or increase variations, and simulating the target data. However, since one cannot access target data or its distribution, these methods often come across overfitting and performance issues on the unseen target domain, known as the adaptivity gap.

To get closer to practical scenarios where access to target data is often not always precomputed, a recent paradigm Test-time adaptation (Wang et al., 2020) emerged (Figure 1c). In test-time adaptation, the source model is finetuned on target data as and when it arrives in small batches, as shown in the Test-time legend. For instance in scenarios this is the usual case in medical imaging applications where the imaging data from scanners is often available as and when the patient arrives. Moreover, the focus is to make the source model more target-specific by finetuning the model on target data. However, since access to such an unseen batch of samples is unlaballed, finetuning the model is challenging. Common methods utilize source model predictions and entropy on these batches to finetune the model.

Test-time generalization (Ambekar et al., 2023) (Figure 1d) focuses on training source models on multiple source domains during training while following the test-time adaptation setting at test-time. Recent methods such as (Ambekar et al., 2023; Xiao et al., 2022) focus on simulating domain shifts and test-domain and meta-learn the ability to generalize on unseen test data. Moreover, several methods also focus on addressing pseudo labeling, consistency, clustering, and self-supervision with auxiliary tasks.

Datasets and applications

Common tasks in deep learning include but not limited to Classification, speech recognition, medical imaging, computer vision, natural language processing. Moreover the common datasets utilized to evaluate method in classification and segmentation include DomainNet, Office-Home, Cifar corrupted, PACS, VLCS, Office-31, and NICO++.

Related topics

Transfer learning: One usually assumes access to labeled target data to evaluate and finetune the model. However, one doesn't assume access to labelled target data to fine-tune the model for all the paradigms above.

Zero-shot learning: This focuses on unseen label space changes between source and target, while the paradigms above focus primarily on generalizing the model to the unseen domain where new label space can seldom be a part of it.

Semi-supervised learning: Here, one assumes access to partial target set where the training and testing distributions come from the same distribution. However, the above paradigms do not focus on addressing the same distributions.

In summary, well-performing target models adapting to unseen target data is an omnipresent problem. Addressing these while being reminiscent of practical scenarios while being efficient remains an open problem.

References

Pandey, Prashant, Aayush Kumar Tyagi, Sameer Ambekar, and A. P. Prathosh. "Unsupervised domain adaptation for semantic segmentation of NIR images through generative latent search." In ECCV 2020

Bo Li, Yezhen Wang, Shanghang Zhang, Dongsheng Li, Kurt Keutzer, Trevor Darrell, and Han Zhao. Learning invariant representations and risks for semi-supervised domain adaptation. CVPR 2021.

Ambekar, Sameer, Zehao Xiao, Jiayi Shen, Xiantong Zhen, and Cees GM Snoek. "Learning Variational Neighbor Labels for Test-Time Domain Generalization.", CoLLAs 2024

Tuan-Hung Vu, Himalaya Jain, Maxime Bucher, Matthieu Cord, and Patrick Pérez. Advent: Adversarial entropy minimization for domain adaptation in semantic segmentation. CVPR 2019.

Dequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno Olshausen, and Trevor Darrell. Tent: Fully test-time adaptation by entropy minimization. ICLR 2021

Abhimanyu Dubey, Vignesh Ramanathan, Alex Pentland, and Dhruv Mahajan. Adaptive methods for real-world domain generalization. CVPR 2021

Muandet, Krikamol, David Balduzzi, and Bernhard Schölkopf. "Domain generalization via invariant feature representation." ICML 2013.

Xiao, Zehao, Xiantong Zhen, Ling Shao, and Cees GM Snoek. "Learning to generalize across domains on single test samples." ICLR 2022.

RELATED

  • Can We Trust the Uncertainty of Causal Foundation Models?

    Causal foundation models promise fast, flexible treatment-effect estimation from observational data, but can their uncertainty be trusted? This post examines prior-data fitted networks (PFNs) for causal inference, revealing a hidden prior-induced confounding bias, and introduces a one-step posterior correction that restores reliable, frequentist-consistent uncertainty for average treatment effect estimation. Full post
  • Exploring XAI Methods for Interpretability of Large Language Models

    Large Language Models can summarise text, answer questions, and classify sentiment with impressive accuracy, but their reasoning often feels like a black box. Why did the model land on that prediction? This post walks through four complementary approaches from Explainable AI (XAI) that help open up the box. Together, these methods make LLMs less opaque and more trustworthy. Full post
  • Robotic Decision Making via Diffusion Models

    Robots are increasingly expected to operate in complex, real-world environments, but the machine learning methods that drive their decision-making, like reinforcement and imitation learning, often struggle with training stability and capturing the multimodal nature of behavior. This post introduces diffusion models as a powerful alternative for robotic decision making, explaining their core denoising mechanism and surveying their applications in several contexts. Full post
  • A Beginner’s Guide to Certifiable Robustness

    Machine learning models, such as ChatGPT and those used in autonomous driving, are becoming essential tools in our daily lives. However, the existence of "adversarial examples" demonstrates that these systems are not free from vulnerabilities. The post, introduces the concept of adversarial examples and discusses Certifiable Robustness, a methodology designed to combat them. Full post
  • Responsible Textual Generative Models (Part I): Generating Truthful Content

    This post introduces hallucination in large language models—why fluent outputs can still be wrong, what distinguishes intrinsic from extrinsic errors, and how training data, model design, inference, and alignment contribute. It surveys detection and mitigation approaches and sets up later posts on toxicity, bias, and inclusivity in responsible textual generative AI. Full post
  • Random Convolutions: A Simple Way to Boost Generalization

    Random Convolutions (RC) are a simple and effective data augmentation technique designed to improve the robustness of deep learning models, particularly in medical imaging. Instead of relying on fixed or learned filters, RC applies a small stack of randomly generated convolutional filters to input images during training. This introduces strong but controlled variations in image texture while preserving the underlying anatomical structure. By exposing models to a wide range of plausible appearance changes, Random Convolutions reduce overfitting to dataset-specific characteristics such as scanner type or acquisition protocol. In practice, RC acts as an implicit form of domain randomization, encouraging models to focus on stable, shape-based and contextual features rather than fragile texture cues. Despite its simplicity and low computational cost, RC has been shown to substantially improve generalization across institutions and imaging conditions in challenging tasks such as multiple sclerosis lesion segmentation. Full post
  • Neuromorphic Computing: A Brain-inspired Approach to Robot Intelligence

    This post offers a high-level walkthrough of neuromorphic computing, why it matters for energy-efficient robot intelligence, and how SNNs, event cameras, and neuromorphic chips fit together Full post
  • Introduction to Embodied Instruction Following

    This work explores how AI systems bridge the gap between understanding human instructions and performing real actions by learning through direct interaction with their environment. Full post
  • From Unlucky Strikers to Statistical Learning Theory

    Using the analogy of football striker, this post explains how statistical learning theory helps us understand when we can trust model predictions and empirical averages, highlighting the challenges of generalization in modern machine learning, especially with complex models like deep neural networks. Full post
  • Performative Prediction

    Machine learning systems are increasingly used to support decision-making processes. Yet, these systems do not merely reflect the world—they also reshape it. Once deployed, predictions can influence behaviors, alter policies, and redirect resources, creating feedback loops that change the very data-generating processes they aim to model. Full post
  • What even is differential privacy?

    A concise introduction to differential privacy which offers provably privacy guarantees for training machine learning models. Full post
  • A gentle introduction to uncertainty quantification

    Uncertainty Quantification (UQ) is considered indispensable for predictive models in safety-critical applications. Modern models, though high-performing, struggle with providing meaningful uncertainty estimates due to a number of reasons. Full post
  • Welcome to the relAI Blog

    Welcome to the relAI blog of the Konrad Zuse School of Excellence in Reliable AI (relAI). This blog will serve as a platform to share cutting-edge research and developments from our school, highlighting the significant strides we are making towards making AI systems safer, more trustworthy, and privacy-preserving. Full post