Abstract
While several methodologies have been proposed for the daunting task of domain generalization, understanding what makes this task challenging has received little attention. Here we present SemanticDG (Semantic Domain Generalization): a benchmark with 15 photo-realistic domains with controlled domain shifts in lighting, materials, and viewpoints. Using this benchmark, we investigate the impact of each of these semantic shifts on generalization independently. Visual recognition models easily generalize to novel lighting, but struggle with distribution shifts in materials and viewpoints. Inspired by human vision, we hypothesize that scene context can serve as a bridge to help models generalize across material and viewpoint domain shifts and propose a context-aware vision transformer (CDCNet/HDNet) along with a contrastive loss over material and viewpoint changes. Our approach outperforms existing domain generalization methods by over an 18% margin.
Introduction: The Generalization Gap
Despite massive datasets like ImageNet, AI models are notoriously brittle. A slight change in lighting, a new camera angle, or a different material texture can cause a state-of-the-art classifier to fail. This is known as the generalization gap.
The authors argue that the problem isn't just how we train models, but what we feed them. Humans learn from a "visual diet" of 3D environments where we see the same objects under infinite variations of light and perspective, always within a meaningful context (e.g., a sofa is in a room, not floating in a white void). In contrast, machine "diets" consist of sparse snapshots—one photo per scene—with little transformational diversity.
The SemanticDG Benchmark
To investigate these challenges, the researchers introduced the Human Visual Diet (HVD) dataset, also known as SemanticDG. It features 15 photo-realistic domains based on 3D reconstructed rooms from ScanNet. Unlike standard datasets, HVD allows for controlled, disentangled changes in:
- Lighting: Variations in color and intensity.
- Materials: Over 250 procedural textures applied to objects and surfaces.
- Viewpoints: Changes in camera height and angle.
The study also utilized a "natural" counterpart, Semantic iLab, which uses style transfer to introduce lighting and material diversity into real-world images of toy vehicles.
Methods: Mimicking the Human Visual Diet
The proposed model, the Human Diet Network (HDNet) (also referred to as CDCNet), is designed to exploit the hallmarks of the human visual diet through two primary mechanisms:
- Two-Stream Reasoning: HDNet uses a cross-attention transformer to integrate information from two streams: one for the target object crop and one for the full surrounding scene context. This allows the model to use the "forest" to help identify the "tree."
- Supervised Contrastive Learning: To handle 3D transformations, the model employs a contrastive loss function. It learns to cluster representations of the same object seen under different conditions (lighting, viewpoint) while separating different object categories.
Key Insights and Results
- Context is a Feature, Not Noise: Explicitly reasoning about the environment (the "context stream") provides a massive boost in robustness, especially when the object itself is obscured or seen from an unusual angle.
- Diversity Trumps Augmentation: True 3D transformational diversity is far more effective than traditional 2D data augmentations (like flipping or rotating). Models trained with high 3D diversity outperformed those with heavy 2D augmentation.
- Synthetic-to-Real Generalization: Models trained purely on synthetic HVD data generalized to real-world ScanNet images significantly better than models using standard domain generalization techniques. HDNet achieved 69% accuracy on ScanNet, while the best-performing traditional model (IRM) only reached 51%.
Conclusion
While HDNet significantly closes the generalization gap for lighting and material shifts, viewpoint changes remain a significant challenge. Future work may need to incorporate dynamic cues (video/motion) and depth information to further align machine vision with the human experience. The HVD dataset and HDNet provide a foundation for understanding and addressing the semantic distribution shifts that make domain generalization hard.
Summary updated