arXiv(opens in a new tab)cs.CVSep 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2609.04837

PAPT++: Risk-Aware Adversarial Tuning and Generation for Single Domain Generalization

Zhipeng Xu, De Cheng, Xinyang Jiang, Lingfeng He, Huaijie Wang, Dongsheng Li, Nannan Wang, Xinbo Gao

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Zhipeng Xu, De Cheng*, Xinyang Jiang, Lingfeng He, Huaijie Wang, Dongsheng Li, Nannan Wang, Senior Member, IEEE, and Xinbo Gao, Fellow, IEEE

Abstract—Single domain generalization (SDG) aims to learn a model from one labeled source domain that generalizes to unseen target domains. A common strategy is to enrich the source distribution with augmented or generated samples, and recent text-to-image (T2I) diffusion models provide a strong generative prior for this purpose. However, diversity alone is insufficient for robust generalization, because useful generated samples should also capture variations that the current classifier finds difficult. Motivated by distributionally robust optimization (DRO), we define a semantic ambiguity set in the class-conditional generative space of a pretrained T2I model and search it for samples with high classification loss under the current classifier. To this end, we introduce PAPT++, a risk-aware adversarial generation-training framework for SDG. PAPT++ first learns diverse semantic reference images for each class through image-text alignment and intra-class diversity regularization. These references then serve as denoising targets during classifier-guided diffusion synthesis, reducing semantic drift while guiding generation toward challenging variations. The generated samples are combined with the source data to update the classifier, and the updated classifier guides the next synthesis round in return. In this way, PAPT++ progressively exposes the classifier to challenging yet semantically consistent variations. Extensive experiments on standard SDG benchmarks demonstrate the superiority of the proposed PAPT++ method and the effectiveness of its main components.

Index Terms—Domain Generalization, Distributional Robust Learning, Adversarial Training, Generative model.

I. INTRODUCTION

DEEP neural networks (DNNs) are commonly trained and evaluated under the assumption that training and test data are independently and identically distributed (i.i.d.) [1]. In real-world applications, however, test data often deviate from the training distribution due to changes in style, background, viewpoint, image quality, or acquisition conditions. As a result, a model trained only on the source data may suffer a noticeable performance drop when deployed in unseen environments. To improve robustness under such distribution shifts, domain generalization (DG) [2], [3] aims to learn from available labeled source data and generalize to unseen target domains without accessing target data during training.

Single domain generalization (SDG) is a more challenging setting of DG, where only one labeled source domain is available for training. To alleviate the lack of domain diversity, existing SDG methods usually expand or regularize the source

Figure

Fig. 1. Comparison of data augmentation strategies for SDG. (A) Conventional augmentation expands the source distribution within predefined transformation spaces. (B) Diffusion-based augmentation provides broader semantic variations but is not explicitly guided by the current classifier. (C) PAPT++ searches the class-conditional T2I generative space for classifier-challenging samples while preserving class semantics.

distribution through data augmentation, adversarial perturbation, or normalization. Although these approaches improve robustness by introducing additional variations or regularizing the learned representation, augmentation- and perturbation-based methods often operate within predefined transformation spaces, such as perturbations of channel-wise feature statistics. Consequently, the resulting training distribution may still fail to cover complex unseen variations in style, background, viewpoint, or image quality.

Recent text-to-image (T2I) diffusion models provide a promising way to further enrich the source distribution for SDG. Benefiting from large-scale image-text pretraining, these models contain rich generative priors and can synthesize diverse visual and semantic variations beyond predefined image transformations. However, simply increasing generation diversity does not necessarily lead to robust generalization. From the perspective of robust learning, useful generated samples should not only be diverse, but also expose challenging variations that are not well covered by the source data and cannot be reliably handled by the current model.

To guide the search for such variations, we build on distributionally robust optimization (DRO), which minimizes the worst-case risk over an ambiguity set around the source distribution. Rather than fitting only observed or augmented samples, DRO explicitly considers possible distributional perturbations and focuses on those that yield high model risk.

Zhipeng Xu, De Cheng, Lingfeng He, Huaijie Wang, Nannan Wang, and Xinbo Gao are with Xidian University, Xi'an, China. Xinyang Jiang and Dongsheng Li are with Microsoft Research Asia, Shanghai, China (e-mail: xinyangjiang@microsoft.com; dongslie@microsoft.com).

∗^{*}Corresponding author: De Cheng (e-mail: dcheng@xidian.edu.cn).

Applying this formulation to T2I diffusion models requires a suitable ambiguity set for high-risk sample search. Existing methods [4] have constructed such sets in feature spaces parameterized by CLIP or ResNet encoders. However, extending feature-space risk search to the generative space of T2I diffusion models is non-trivial. Without semantic constraints, directly maximizing model risk may produce degenerate high-loss samples, such as artifact-dominated or texture-biased images, rather than meaningful variations that preserve core class semantics. Therefore, a key question naturally arises: how can we use a T2I diffusion model to construct a semantic ambiguity set and search it for high-risk samples while preserving core class semantics?

Based on this motivation, we propose PAPT++, a risk-aware adversarial generation-training framework for SDG, as shown in Fig. 1. PAPT++ extends our previous PAPT [5] by moving from diversity-driven generation to risk-aware diffusion synthesis guided by the current classifier. Specifically, PAPT++ uses the class-conditional generative space of a pretrained T2I model to construct a semantic ambiguity set. Semantic references for each class constrain the search to reduce semantic drift, while the current classifier guides generation toward variations with high classification loss. PAPT++ alternates between difficult sample generation and classifier training, progressively exposing the classifier to challenging yet semantically consistent variations and improving its generalization to unseen domains. It consists of two modules: Class-Level Semantic Reference Learning (CSRL) and Classifier-Guided Adversarial Diffusion Synthesis (CADS).

CSRL provides semantic constraints for subsequent adversarial synthesis. Without such constraints, classifier-guided generation may increase classification loss by drifting away from the target class. CSRL therefore first learns a set of semantic reference images for each class by adapting the diffusion model with two complementary objectives: image-text alignment and intra-class diversity regularization. The image-text alignment objective encourages generated images to follow their class prompts and preserve class-level semantics, including overall object appearance, shape, and other discriminative visual cues. However, this objective alone may cause the generator to favor a small set of high-scoring visual patterns. The intra-class diversity objective therefore penalizes feature similarity among images of the same class, encouraging more diverse visual appearances. The learned reference images are then fixed and used as denoising targets to regularize the subsequent classifier-guided synthesis.

Using the semantic references learned by CSRL, CADS alternates between classifier-guided diffusion synthesis and classifier training. In each synthesis round, the current classifier is fixed to provide classification-loss feedback, while the diffusion model is optimized to generate samples with high classification loss under this classifier. Meanwhile, the semantic references serve as denoising targets to constrain the diffusion optimization. This constraint discourages the generator from increasing classification loss through semantic drift or by introducing noise, distorted textures, and other visual artifacts. The generated challenging samples are then combined with the source data to update the classifier, and

the updated classifier guides the next synthesis round.

The main contributions are summarized as follows:

  • We propose PAPT++, a risk-aware adversarial generation-training framework for SDG that extends our previous PAPT beyond diversity-driven prompt generation. PAPT++ formulates classifier-guided sample generation as a search over a class-conditional semantic ambiguity set and alternates between challenging sample generation and classifier training.

  • We develop two complementary modules for semantically constrained risk search. CSRL learns diverse semantic reference images through image-text alignment and intra-class diversity regularization, while CADS uses these references to regularize classifier-guided diffusion synthesis, generating challenging yet semantically consistent samples. We further introduce a progressive denoising optimization strategy to extend gradient guidance over the denoising trajectory and improve generation quality.

  • We establish a theoretical connection between PAPT++ and DRO. We show that the reference denoising objective controls an upper bound on the KL divergence between the smoothed reference and generated distributions. We further derive a target-domain risk bound that accounts for ambiguity-set coverage, the finite CADS search gap, and finite-sample estimation error.

  • Extensive experiments on SDG and multi-source DG benchmarks show that PAPT++ achieves state-of-the-art performance. Ablation studies verify the effectiveness of its main components, and additional experiments analyze the generation process from multiple perspectives.

This article extends our CVPR 2025 conference paper PAPT [5] in three main aspects: (1) PAPT++ moves beyond the diversity-driven prompt generation of PAPT by using the current classifier to search for challenging variations in the T2I generative space. CSRL provides semantic references that constrain this search, while CADS incorporates classifier feedback and progressive denoising into an iterative generation-training process. (2) We further formulate this risk-aware generation process from a DRO perspective. The analysis shows how reference denoising constrains distributional deviation and how the worst-case risk over the resulting semantic ambiguity set relates to target-domain risk, providing theoretical support for semantic preservation and high-risk search. (3) The empirical study is substantially expanded to examine both performance and the underlying generation mechanism. PAPT++ achieves state-of-the-art results on SDG and multi-source DG benchmarks, together with strong corruption generalization.

References (97)