Bi-Level Optimization for Single Domain Generalization
Organizations: School of Computer Science, Carleton University, Ottawa, Canada · Canada CIFAR AI Chair, Amii, Canada
Abstract
Generalizing from a single labeled source domain to unseen target domains, without access to any target data during training, remains a fundamental challenge in robust machine learning. We address this underexplored setting, known as Single Domain Generalization (SDG), by proposing BiSDG, a bi-level optimization framework that explicitly decouples task learning from domain modeling. BiSDG simulates distribution shifts through surrogate domains constructed via label-preserving transformations of the source data. To capture domain-specific context, we propose a domain prompt encoder that generates lightweight modulation signals to produce augmenting features via feature-wise linear modulation. The learning process is formulated as a bi-level optimization problem: the inner objective optimizes task performance under fixed prompts, while the outer objective maximizes generalization across the surrogate domains by updating the domain prompt encoder. We further develop a practical gradient approximation scheme that enables efficient bi-level training without second-order derivatives. Extensive experiments on various SGD benchmarks demonstrate that BiSDG consistently outperforms prior methods, setting new state-of-the-art performance in the SDG setting.
Figures & tables
| Target | MixUp | CutOut | ADA | ME-ADA | AugMix | RandAug | ACVC | L2D | AdvST | BiSDG (Ours) |
|---|---|---|---|---|---|---|---|---|---|---|
| Art | 52.8 | 59.8 | 58.0 | 60.7 | 63.9 | 67.8 | 67.8 | 67.6 | ||
| Cartoon | 17.0 | 21.6 | 25.3 | 28.5 | 27.7 | 28.9 | 30.3 | 42.6 | ||
| Sketch | 23.2 | 28.8 | 30.1 | 29.6 | 30.9 | 37.0 | 46.4 | 47.1 | ||
| Avg. | 31.0 | 36.7 | 37.8 | 39.6 | 40.8 | 44.6 | 48.2 | 52.5 | 64.1 |
| Method | SVHN | MNIST-M | SYN | USPS | Avg. |
|---|---|---|---|---|---|
| ERM [ 15 ] | 27.8 | 52.7 | 39.7 | 76.9 | 49.3 |
| CCSA [ 24 ] | 25.9 | 49.3 | 37.3 | 83.7 | 49.1 |
| JiGen [ 2 ] | 33.8 | 57.8 | 43.8 | 77.2 | 53.1 |
| ADA [ 33 ] | 35.5 | 60.4 | 45.3 | 77.3 | 54.6 |
| ME-ADA [ 40 ] | 42.6 | 63.3 | 50.4 | 81.0 | 59.3 |
| M-ADA [ 30 ] | 42.6 | 67.9 | 49.0 | 78.5 | 59.5 |
| Target | MixUp | CutOut | CutMix | ADA | ME-ADA | RandAug | AugMix | ACVC | AdvST | BiSDG (Ours) |
|---|---|---|---|---|---|---|---|---|---|---|
| Painting | 38.6 | 38.3 | 38.3 | 38.2 | 39.0 | 41.3 | 40.8 | 41.3 | ||
| Infograph | 13.9 | 13.7 | 13.5 | 13.8 | 14.0 | 13.6 | 13.9 | 12.9 | ||
| Clipart | 38.0 | 38.4 | 38.7 | 40.2 | 41.0 | 41.1 | 41.7 | |||
| Sketch | 26.0 | 26.2 | 26.9 | 24.8 | 25.3 | 30.4 | 29.8 | 30.9 | ||
| Quickdraw | 3.7 | 3.7 | 3.6 | 4.3 | 4.3 | 5.3 | 6.3 | 6.6 | ||
| Avg. | 24.0 | 24.1 | 24.2 | 24.3 | 24.7 | 26.3 | 26.5 | 26.9 |
| Method | SVHN | MNIST-M | SYN | USPS | Avg. |
|---|---|---|---|---|---|
| BiSDG (Ours) | |||||