Domain Generalization (DG) aims to learn representations that remain robust under out-of-distribution (OOD) shifts and generalize effectively to unseen target domains. While recent invariant learning strategies and architectural advances have achieved strong performance, explicitly discovering a structured domain-invariant subspace through second-order statistics remains underexplored. In this work, we propose CPCANet, a novel framework grounded in Common Principal Component Analysis (CPCA), which unrolls the iterative Flury-Gautschi (FG) algorithm into fully differentiable neural layers. This approach integrates the statistical properties of CPCA into an end-to-end trainable framework, enforcing the discovery of a shared subspace across diverse domains while preserving interpretability. Experiments on four standard DG benchmarks demonstrate that CPCANet achieves state-of-the-art (SOTA) performance in zero-shot transfer. Moreover, CPCANet is architecture-agnostic and requires no dataset-specific tuning, providing a simple and efficient approach to learning robust representations under distribution shift. Code is available at https://github.com/wish44165/CPCANet.
翻译:领域泛化旨在学习在分布外偏移下保持鲁棒性、并能有效泛化到未知目标领域的表示。尽管近期的不变学习策略与架构进展已取得优异性能,但通过二阶统计量显式发现结构化领域不变子空间的研究仍显不足。本文提出CPCANet——一种基于公共主成分分析的新型框架,该框架将迭代式Flury-Gautschi算法展开为完全可微分的神经层。该方法将CPCA的统计特性融入端到端可训练框架,在保证可解释性的同时强制发现跨领域的共享子空间。在四个标准领域泛化基准上的实验表明,CPCANet在零样本迁移中达到了目前最优性能。此外,CPCANet具有架构无关性,无需针对特定数据集调整参数,为学习分布偏移下的鲁棒表示提供了简洁高效的方案。代码已开源:https://github.com/wish44165/CPCANet。