Grounding Visual Representations with Texts for Domain Generalization

Seonwoo Min, Nokyung Park, Siwon Kim, Seunghyun Park, Jinkyu Kim

Introduction

Machine learning models frequently encounter performance degradation when deployed in environments that differ from their training data, a phenomenon known as domain shift. For instance, a classifier trained on high-resolution photographs of birds may fail to recognize the same species in a cartoon or a painting. This failure often stems from the model's tendency to rely on "shortcuts"—spurious correlations like background textures or lighting conditions—rather than the core semantic features of the object.

Domain Generalization (DG) aims to learn domain-invariant representations that remain consistent across diverse visual styles. While traditional approaches attempt to align feature distributions mathematically, this work proposes that natural language serves as a superior "semantic anchor." Concepts like a "long pointed bill" remain constant across photos, sketches, and paintings, providing a stable target for visual grounding.

Methodology: The GVRT Framework

The proposed framework, Grounding Visual Representations with Texts (GVRT), enhances a standard image classifier with two specialized modules designed to enforce semantic consistency through language.

The GVRT architecture consists of an Image Classifier, a Visual and Textual Joint Embedder (VTJE), and a Textual Explanation Generator (TEG).

1. Visual and Textual Joint Embedder (VTJE)

This module aligns visual features extracted by a backbone (e.g., ResNet) with a "pivot" embedding derived from textual descriptions. By minimizing an alignment loss ($\mathcal{L}_{align}$), the model is forced to prioritize visual cues that correspond to human-described attributes, such as plumage color or beak shape, effectively ignoring domain-specific noise.

2. Textual Explanation Generator (TEG)

To further internalize high-level semantic information, the TEG uses an encoder-decoder structure (LSTM) to generate human-like justifications for the model's decisions. Training the model to produce sentences like "This is a Ruby Throated Hummingbird because it has a long black bill" serves as a powerful auxiliary signal, ensuring the underlying visual features are discriminative and aligned with human reasoning.

Experimental Setup and Datasets

The researchers evaluated GVRT on two primary benchmarks:

  • CUB-DG: A new benchmark created by the authors to address the lack of text descriptions in existing DG datasets. Using the Caltech UCSD Birds-200-2011 dataset as a base, they applied style-transfer techniques (e.g., CycleGAN) to generate three additional domains: Art, Paint, and Cartoon.
  • DomainBed: A standard large-scale benchmark comprising five datasets (VLCS, PACS, OfficeHome, TerraIncognita, and DomainNet). For datasets lacking per-image captions, the authors utilized dictionary definitions from the Oxford English Dictionary as per-class textual supervision.

Results and Discussion

GVRT demonstrated superior generalization capabilities across both benchmarks. On DomainBed, the method achieved the top average performance among 14 competing algorithms. On the CUB-DG benchmark, GVRT reached an accuracy of 57.0%, significantly outperforming standard Empirical Risk Minimization (45.5%) and established DG methods like CORAL (55.4%).

Qualitative results on the CUB-DG benchmark showing consistent classification and description across Photo, Art, Paint, and Cartoon domains.

Key Insights

  • Language as an Anchor: The stability of linguistic concepts across domains helps the model ignore stylistic variations (e.g., brushstrokes vs. pixels).
  • Efficiency of Per-Class Supervision: Surprisingly, unique captions for every image are not strictly necessary; high-quality dictionary definitions for an entire class are sufficient to improve generalization.
  • Explanation as Training Signal: The act of generating an explanation is not just for interpretability; it actively shapes the latent space to be more robust and semantically meaningful.

Conclusion

By grounding visual features in the semantic stability of natural language, GVRT offers a robust solution to the problem of domain shift. While the method's efficacy can vary in highly camouflaged settings where visual cues are difficult to describe (e.g., the TerraIncognita dataset), the use of text as a cross-modal bridge represents a significant step toward more adaptable and human-aligned computer vision systems.

Summary updated

BibTeX
@inproceedings{min2022grounding,
  author = {Seonwoo Min and Nokyung Park and Siwon Kim and Seunghyun Park and Jinkyu Kim},
  title = {{Grounding Visual Representations with Texts for Domain Generalization}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19836-6\_3},
}
Figure