ConstStyle: Robust Domain Generalization with Unified Style Transformation

Nam Duong Tran, Nam Nguyen Phuong, Hieu H. Pham, Phi Le Nguyen, My T. Thai · DOI

Abstract

Deep Neural Networks (DNNs) often struggle with domain shift, where test data from unseen domains differs significantly from training data. Traditional Domain Generalization (DG) methods focus on learning invariant features or augmenting training data, yet they often overlook the critical inference phase and the potential negative impact of increasing training domain diversity. We present ConstStyle, a novel DG framework that maps both training and testing data into a single "unified domain" to minimize style discrepancies. By aligning unseen test samples to this common space during inference, ConstStyle significantly outperforms existing methods, achieving accuracy gains of up to 19.82% in data-constrained scenarios and producing superior class separation.

Introduction

The brittleness of DNNs under domain shift remains a primary hurdle for real-world deployment. When a model trained on photographs is asked to classify sketches or paintings, performance typically plummets. Current research in Domain Generalization (DG) generally follows two paths: finding features that remain invariant across domains or using data augmentation to simulate diversity.

However, these approaches suffer from two major limitations. First, the "More is Better" fallacy: empirical evidence suggests that simply adding more training domains can sometimes clutter class boundaries and degrade performance. Second, the "Inference Oversight": most methods focus exclusively on the training phase, ignoring the fact that the domain gap is widest at the moment of testing when the model encounters a completely novel style.

Methodology: The Unified Domain

ConstStyle addresses these gaps by introducing a Unified Domain. Rather than attempting to make a model robust to every conceivable style, ConstStyle projects all data into one consistent, theoretically grounded style space.

1. Unified Domain Selection and Training Alignment

The framework utilizes an algorithm to define a unified domain that acts as a common representation space, designed to minimize style distance between disparate domains. During the training phase, samples from all seen domains are mapped onto this unified domain, allowing the model to focus on extracting features that are consistent within this specific space.

2. Inference Alignment

Crucially, ConstStyle incorporates an alignment step at test time. Unlike traditional models that process test images "as is," ConstStyle projects unseen test samples onto the unified domain before prediction. This "secret sauce" effectively translates the unknown domain into a language the model already understands, closing the gap between training and testing environments.

Experimental Evaluation

ConstStyle was evaluated on several standard DG benchmarks:

  • PACS: Photo, Art Painting, Cartoon, and Sketch.
  • Digits5: Five styles of handwritten digits (e.g., MNIST, SVHN).
  • VLCS: Object recognition across four datasets (VOC, LabelMe, Caltech, Sun).
  • Duke-Market101: Person re-identification across camera views.

Results and Discussion

The "Less is More" Phenomenon

Our analysis challenges the assumption that more data diversity is always better. As shown in the performance metrics, training on a single, well-chosen domain can sometimes yield better generalization than training on multiple domains when using the ConstStyle framework.

Figure 1: Accuracy vs. Number of Seen Domains for Digits5 and VLCS datasets. Note how performance often peaks or remains high with fewer domains.

Accuracy and Feature Clarity

ConstStyle consistently outperformed state-of-the-art DG methods. In scenarios with limited training domains, it boosted accuracy by up to 19.82% over the next best approach. Visualizations of the feature space reveal that ConstStyle produces much more defined class boundaries compared to traditional methods, which often suffer from overlapping feature clusters.

Figure 2: Feature visualizations demonstrating the clean class separation achieved by the ConstStyle alignment process.

Conclusion

ConstStyle shifts the DG paradigm from ignoring style to controlling it. By treating style as a bridge and prioritizing alignment during the inference phase, the framework achieves significant robustness against domain shift. While future work may focus on reducing the computational latency of the inference-time projection, the current results establish a new benchmark for performance in domain generalization.

Summary updated

BibTeX
@inproceedings{tran2025conststyle,
  author = {Nam Duong Tran and Nam Nguyen Phuong and Hieu H. Pham and Phi Le Nguyen and My T. Thai},
  title = {{ConstStyle: Robust Domain Generalization with Unified Style Transformation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
  url = {https://openreview.net/forum?id=k83GTrPOPG},
}
Figure