Manuscript Offprint
arXiv:2611.04242Improving Diffusion-Based Augmentation for Data-Scarce Image Classification via Mask-Guided Reference Attention and Repulsive Noise Optimization
Hyun-Jic Oh
GaYeon Koh
Won-Ki Jeong
Korea University, Republic of Korea
VIENCE Inc., Republic of Korea
{hyunjic0127,wkjeong}@korea.ac.kr
Code: https://github.com/hvcl/MGRAttn-RNO

Figure 1. Rare-class generations illustrating the two failure modes. (Left) Ours corrects foreground artifacts in concept-learning (CL) (e.g., incorrect red coloration on the bird's head) and better preserves foreground details. (Right) CL generates similar outputs despite varying prompts; Ours produces diverse prompt-conditioned samples while preserving foreground details.
Abstract
Diffusion-based data augmentation has emerged as a powerful strategy for addressing data-scarce image classification. Recent pipelines typically adapt a pretrained text-to-image diffusion model to a limited number of class examples and subsequently sample synthetic images using diverse textual prompts. However, in extreme data-scarce regimes such as long-tailed single-sample settings, this approach suffers from a dual failure mode: the generated samples often lack discriminative foreground details crucial for classifier training, and the adapted class prior can bias the early denoising process, causing output images to exhibit similar patterns despite varying text prompts. To overcome these limitations, we propose a sampling-side framework of two complementary components that simultaneously enhance fine details and diversity. First, Mask-Guided Reference (MGR) Attention updates only foreground value tokens with reference features via zero-shot segmentation, limiting reference influence to the target object and mitigating excessive global feature injection. Second, Repulsive
Noise Optimization (RNO) encourages initial noise trajectories to diverge from dominant generative modes of the adapted model, enabling target prompts to express broader contextual variation. Extensive evaluations show consistent improvements, with the largest gains in long-tailed single-sample settings of up to 2.50 and 2.94 points on CUB-LT IF100, and further robustness across few-shot and background-shift evaluations.
1. Introduction
Training high-performing image classifiers under data-scarce regimes remains a fundamental challenge, particularly in long-tailed and single-sample settings where certain categories contain only a handful of labeled instances [27, 43, 48]. This constraint is especially severe in fine-grained classification, where deployable vision backbones must capture subtle, highly localized foreground attributes such as specific texture patterns or color contours to effectively distinguish visually similar sub-categories.
Synthetic data augmentation powered by pretrained text-to-image diffusion models [28, 33] has emerged as a promising solution to alleviate this scarcity by generat-
Equal contribution.
Corresponding author.
ing additional training samples with diverse synthetic variants [1, 13, 29]. For these synthetic samples to benefit downstream classifier training, they must simultaneously satisfy two criteria: preserving class-discriminative fine-details while maintaining broad contextual diversity.
Diffusion-based augmentation methods typically adapt a text-to-image diffusion model via concept-learning techniques such as Textual Inversion [8] or LoRA [16], and sample synthetic images using diverse textual prompts. While effective to an extent, we observe that in extreme data-scarce regimes such as long-tailed single-sample cases, this approach suffers from a distinct dual failure mode (see Fig. 1). (i) Fine-Detail Degradation: the adapted model often fails to reproduce precise, discriminative foreground details, as adapting from only a few examples can yield weak fine-grained priors. (ii) Diversity Collapse: the adapted class prior can dominate the early denoising process, causing generated images to collapse into similar geometric structures despite varying text prompt suffixes.
To overcome fine-detail degradation, we propose Mask-Guided Reference (MGR) Attention, a sampling-time localized attention strategy. Existing attention-manipulation methods [3, 17] are designed for image editing such as style transfer or spatial layout control, where replacing self-attention key-value tokens with those from a reference is appropriate. However, directly applying such techniques to data augmentation is not straightforward: global key-value replacement propagates reference features across the entire synthesized image, suppressing contextual variation driven by the text prompt. Instead, MGR Attention uses a zero-shot segmenter [4, 19] to obtain foreground boundaries, updating only foreground value tokens with reference features.
To address diversity collapse, we introduce Repulsive Noise Optimization (RNO), a latent optimization method applied before the denoising process begins. While standard noise optimization techniques like CNO [18] enforce an attraction-repulsion balance to stabilize generic generation, we observed that retaining an attraction term in adapted-model augmentation forces the latent trajectories right back into the dominant collapsed class prior. RNO establishes fixed anchors from the adaptation prompt, representing the dominant generative modes of the adapted model, and optimizes initial latent trajectories via a repulsion-only objective, encouraging diverse prompt-conditioned generation across broader layout spaces.
Our framework operates entirely at sampling time, making it compatible with existing concept-learning pipelines on UNet-based latent diffusion models as a plug-and-play component. This is particularly effective in single-sample regimes, where concept-learning approaches cannot exploit reference information beyond what was captured during adaptation, whereas our modules leverage a real reference image at every generation step. Extensive evaluations demonstrate consistent improvements in classification accuracy across long-tailed single-sample, few-shot, and Waterbirds background-shift settings, with the largest gains in the most data-scarce regimes. Our main contributions are summarized as follows:
• We introduce MGR Attention, a sampling-time localized attention strategy that updates target foreground value tokens with reference features via zero-shot segmentation, limiting reference influence to the target object region.
• We propose RNO, a latent optimization method that refines initial noise trajectories via a repulsion-only objective against fixed anchors from the adaptation prompt, encouraging diverse prompt-conditioned generation.
• We demonstrate consistent improvements with the largest gains in long-tailed single-sample settings, and further robustness across few-shot and background-shift settings.
2.1. Diffusion Augmentation for Classification
Generative data augmentation leveraging text-to-image diffusion models [20, 28, 33] has become a standard pipeline for expanding limited datasets. A common research direction focuses on training-based adaptation strategies, where a diffusion model is adapted to a targeted dataset via concept-learning pipelines. For instance, early formulations such as Da-Fusion [38] fine-tune text embeddings via Textual Inversion [8], while subsequent frameworks like DiffMix [41] incorporate cross-class imagery blending. Furthermore, recent adaptation lines like Diff-II [40] execute intra-class interpolation using target prompt suffixes, and more recent variants optimize this adaptation stage by learning salient concepts [49], employing hierarchical structural guidance [24], or enriching contextual prompt diversity during adaptation [44]. While these training-based adaptation methods yield notable improvements for data distribution expansion, they encounter performance bottlenecks in extreme data-scarce scenarios such as single-sample settings, where interpolation-based strategies become ill-defined and foreground fidelity depends heavily on the adapted prior.
Our framework complements these adaptation-centric approaches by operating at sampling time without modifying any adapted model weights, and can therefore be combined with existing concept-learning baselines.
2.2. Reference-Guided Diffusion Sampling
A prominent branch of training-free diffusion manipulation modifies attention matrices to inject specific reference attributes. Prompt-to-Prompt [14] regulates semantic editing via cross-attention layout cloning, and Visual Style Prompting [17] replaces target key-value features to transplant global artistic aesthetics. MasaCtrl [3] converts self-attention into mutual self-attention for spatial transfer, us ing attention maps to derive localized masks for region-selective feature injection. However, such attention-derived masks are less reliable in adapted diffusion models, as the learned class prior can distort intermediate attention maps and lead to inaccurate foreground localization. These methods are primarily designed for image editing or style transfer, where maintaining a global spatial layout or uniform texture is the objective. For data augmentation, global key-value token replacement causes reference features to propagate across the entire synthesized image, suppressing contextual variation that should be steered by the text prompt.
Another line of research focuses on region-controlled generation [5, 42] or detection-oriented augmentation frameworks [23, 50]. However, these methods require dense annotations or explicit object-level objectives, making them difficult to apply in automated data augmentation pipelines under image-level labels.
In contrast, MGR Attention operates under image-level labels only, employing a zero-shot segmenter [4, 19] to automatically localize foreground boundaries and restricting reference feature insertion to foreground value tokens.
2.3. Sampling-Time Diversity Control
Controlling the generative trajectory at inference time without model retraining has been actively explored to enhance sample variance. CADS [34] perturbs text conditioning signals to broaden output distributions. InitNO [10] refines initial noise maps for prompt-layout alignment, while CNO [18] optimizes initial noises in the Tweedie prediction space by balancing instance attraction and sample repulsion. More recently, Harrington et al. [11] demonstrate that calibrating noise properties can recover diversity from repetitive sampling modes of pre-trained diffusion models.
Although successful in diverse sample generation, directly applying these techniques to adapted-model augmentation is not straightforward. Perturbing conditioning signals can deteriorate sample fidelity in fine-grained settings where discriminative details are critical. Furthermore, where the adapted class prior strongly biases early latent trajectories, retaining an attraction term makes it difficult for latent trajectories to escape the dominant generative mode.
RNO addresses these limitations by reformulating noise optimization for adapted diffusion models, treating adaptation-prompt anchors as stationary repulsive barriers and optimizing initial noises via a repulsion-only formulation. Together, RNO and MGR Attention address the dual failure mode: RNO promotes diversity through noise optimization, while MGR Attention reinforces foreground details through localized reference guidance.
3. Preliminaries
Latent Diffusion Process. Latent Diffusion Models (LDMs) [33] perform the diffusion process within the
lower-dimensional latent space of a pretrained autoencoder. Let denote the latent representation of a clean image. The forward process gradually corrupts over discrete timesteps :
where and are determined by the predefined noise schedule. In conditional generation, an adapted denoiser predicts the noise under a text-conditioning embedding . Following DDPM [15], the Tweedie estimate of the clean latent at timestep is:
The forward process in Eq. (1) is used to noise the reference image in MGR Attention; the Tweedie estimate in Eq. (2) forms the basis of our noise optimization in RNO.
Self-Attention in Latent Diffusion. At each self-attention layer in the LDMs, an intermediate feature tensor is projected into query (), key (), and value () tokens, and the output is computed as:
where is the feature channel dimension. Our method modifies this token update rule without altering any pre-trained or adapted parameter weights. As the attention weights are determined by and , our method exploits this property by modifying only selected value tokens, confining direct reference influence to the attended features without altering the attention weight distribution.
4. Method
4.1. Problem Setup
We assume a text-to-image diffusion model has been adapted to the available training data via concept-learning pipelines, establishing an adapted class prior. We refer to the prompt used during this adaptation as the adaptation prompt (“a photo of a <concept> bird”$).
During augmentation, a real training image from the target class is selected as the reference image. Each generated sample is conditioned on a text prompt describing the desired contextual variation, such as background or pose.
4.2. Pipeline Overview
Our framework operates entirely during inference and consists of two complementary components (see Fig. 2a). Before the diffusion loop begins (), RNO optimizes a set of initial latent noises for diverse sample generation. The denoising then proceeds to an intermediate timestep , at which a foreground mask is extracted from the decoded

(a) Overview of sampling pipeline

(b) Repulsive Noise Optimization (RNO)
(c) Mask-Guided Reference (MGR) Attention
Figure 2. Overview of the proposed sampling pipeline. (a) RNO optimizes initial noises before denoising; the target mask M is extracted at and the reference mask is cached offline; MGR Attention refines target foreground values during the remaining steps. (b) RNO optimizes each target noise () to diverge from adaptation-prompt anchors (blue), which remain fixed throughout optimization. (c) MGR Attention constructs a hybrid bank , from target-background and reference-foreground tokens, updating only foreground values.
intermediate image via zero-shot segmentation. During the remaining steps (), MGR Attention performs a region-selective value update in selected self-attention layers, infusing reference features into the target object region.
4.3. Repulsive Noise Optimization (RNO)
When adapted from extremely limited data, the learned prior can heavily bias early latent trajectories toward repetitive structural modes. CNO [18] further struggles here, as the dominant prior can overwhelm the attraction objective, pulling trajectories back to repetitive generation.
To address this, RNO introduces a repulsion-only latent optimization strategy before the denoising process begins (see Fig. 2b). Let be a batch of initial random noises assigned to target variation prompts, and let and denote the embeddings of the target and adaptation prompts, respectively. The remaining branches conditioned on serve as adaptation-prompt anchors for each target noise , kept frozen throughout optimization via . These anchors represent dominant generative modes of the adapted model, serving as stationary repulsive barriers. Let and denote target and anchor predictions. RNO minimizes their average
similarity at timestep :
where denotes cosine similarity and the stop-gradient operation. This repulsion-only formulation encourages the optimized latents to explore broader layout spaces for diverse sample generation.
4.4. Mask-Guided Reference (MGR) Attention
While RNO promotes layout diversity, generated objects can still lack fine-grained details; MGR Attention addresses this via a region-selective value update that injects reference features into foreground token positions (see Fig. 2c).
4.4.1. Mask Extraction
At timestep , where coarse object structure has emerged, we decode the Tweedie estimate and apply a zero-shot segmenter to extract target foreground mask ; reference mask is pre-computed from the clean reference image offline. Both masks are downscaled to match the spatial resolution of the selected self-attention layers.

Figure 3. Qualitative comparison on CUB-LT and Flower-LT IF100 (prompts: “sitting on a ledge by water” and “against a brick wall”). (a) CL and (b) Diff-II rely on the adapted class prior, limiting foreground details and prompt-conditioned variation. (c) MGR enhances foreground details. (d) MGR+RNO (Ours) increases prompt-conditioned diversity while preserving foreground details, successfully following the given prompts.
4.4.2. Region-Selective Value Update
MGR Attention operates on two concurrent streams: a target stream generating the synthetic image and a frozen reference stream supplying reference features. At each timestep , the reference image is encoded and noised via Eq. (1); this noised latent is passed through the frozen denoiser to extract key and value tokens from the selected self-attention layers, serving solely as a feature provider.
Let Q, K, V and , denote tokens of the target and reference streams, respectively, partitioned by spatial masks into foreground ( ) and background ( ) sets. MGR Attention constructs a hybrid bank from target-background and reference-foreground tokens (see Fig. 2c):
Foreground queries attend exclusively to this bank to compute reference-fortified values:
The value update is then applied to foreground indices:
Finally, the self-attention output is computed using the updated value tensor :
Since Q and K remain directly unaffected, preserves the original attention weight distribution, confining reference influence to the foreground value tokens.
5. Experiment
5.1. Setup
Benchmarks. We evaluate in three data-scarce regimes: (i) Long-tailed (LT): CUB-LT [36] and Flower-LT [41]
with imbalance factors IF∈{100, 20, 10}, following Diff-II [40]. (ii) Few-shot: 5-shot and 10-shot on CUB [39], Aircraft [26], Cars [21], and Pet [32]. (iii) Background-shift: 5-shot CUB trained model evaluated on Waterbirds [35].
Generation and adaptation. We use a pretrained Stable Diffusion (SD) [33] v1.5 model with 50-step DDIM sampling [37] and a classifier-free guidance scale of 7.0, with publicly available adapted checkpoints from Diff-Mix [41] and class-specific prompt suffixes following Diff-II [40]. We additionally evaluate on top of BOB [44] on Flower-LT, reproduced following the official protocol, with both SD v1.5 and SD v2.1 backbones. MGR Attention extracts the target mask at and is applied to decoder upblock self-attention layers (from layer 2.1) for , using SAM3 [4] for zero-shot segmentation. Further details, including RNO hyperparameters, are provided in the supplementary material.
Synthetic-data and classifier protocols. For LT experiments, we generate enough samples to match each class to the maximum real class frequency, following SYNAuG [45]. For few-shot and background-shift experiments, real and synthetic images are mixed at a 1:5 ratio following Diff-II [40]. We train ResNet-50 [12] and ViT-B/16 [6] classifiers for all augmentation methods.
Baselines and metrics. We compare with standard cross entropy (CE), Mixup [47], CutMix [46], CMO [31], CMO-DRW [2], and diffusion-based augmentation methods including Real-Filter, Real-Guidance [13], Real-Gen, Real-Mix, Diff-AUG, Diff-Mix [41], Da-Fusion [38], and Diff-II [40]. Top-1 accuracy (%) is the primary metric.
5.2. Qualitative Comparison
Figure 3 compares generated samples on CUB- and Flower-LT IF100. On CUB-LT, (a) CL and (b) Diff-II fail to reproduce fine-grained foreground details such as wing texture and head color, whereas (c) MGR and (d) MGR+RNO better preserve these foreground details while generating di-
Table 1. LT classification results (%) on CUB-LT and Flower-LT (ΔCE: gain over CE; Diff-II†: SYNAuG [45]-style normalization).
| Method | CUB-LT (ResNet-50) | Flower-LT (ResNet-50) | CUB-LT (ViT-B/16) | Flower-LT (ViT-B/16) | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| IF100 | IF20 | IF10 | ΔCE | IF100 | IF20 | IF10 | ΔCE | IF100 | IF20 | IF10 | ΔCE | IF100 | IF20 | IF10 | ΔCE | |
| CE | 33.65 | 44.82 | 58.13 | - | 80.43 | 90.87 | 95.07 | - | 53.87 | 68.36 | 78.82 | - | 92.84 | 97.52 | 99.20 | - |
| Mixup [47] | 37.59 | 49.15 | 63.43 | +4.52 | 81.11 | 92.13 | 96.16 | +1.01 | 53.64 | 68.85 | 79.38 | +0.27 | 92.06 | 97.79 | 98.96 | -0.25 |
| CutMix [46] | 37.61 | 49.15 | 63.27 | +4.48 | 81.96 | 92.28 | 95.80 | +1.22 | 54.02 | 68.45 | 78.22 | -0.12 | 92.06 | 97.28 | 99.00 | -0.41 |
| CMO [31] | 32.94 | 44.08 | 57.62 | -0.65 | 83.95 | 91.43 | 95.19 | +1.40 | 49.22 | 64.20 | 79.55 | -2.69 | 92.21 | 97.57 | 99.03 | -0.25 |
| CMO-DRW [2] | 32.57 | 46.43 | 59.25 | +0.55 | 84.07 | 92.02 | 95.29 | +1.67 | 51.20 | 67.29 | 73.80 | -2.92 | 95.27 | 98.15 | 99.17 | +1.01 |
| Real-Filter [13] | 36.83 | 49.41 | 62.69 | +4.11 | 80.38 | 91.58 | 95.65 | +0.41 | 48.84 | 64.77 | 78.37 | -3.02 | 88.30 | 96.16 | 98.88 | -2.07 |
| Real-Guidance [13] | 36.50 | 49.34 | 59.11 | +2.78 | 81.94 | 91.60 | 95.27 | +0.81 | 52.62 | 65.43 | 75.37 | -2.54 | 91.16 | 96.75 | 98.69 | -0.99 |
| Real-Gen [41] | 45.86 | 53.43 | 61.42 | +8.04 | 83.56 | 91.84 | 95.22 | +1.42 | 61.17 | 69.97 | 76.46 | +2.18 | 92.67 | 96.63 | 99.00 | -0.42 |
| Real-Mix [41] | 47.75 | 55.67 | 62.27 | +9.70 | 85.19 | 92.96 | 96.02 | +2.60 | 62.72 | 71.75 | 76.35 | +3.26 | 92.60 | 96.12 | 98.30 | -0.85 |
| Da-Fusion [38] | 35.74 | 46.82 | 57.13 | +1.03 | 83.86 | 91.82 | 95.31 | +1.54 | 49.13 | 62.19 | 72.80 | -5.64 | 92.13 | 96.92 | 98.71 | -0.60 |
| Diff-AUG [41] | 47.77 | 59.73 | 67.22 | +12.71 | 87.47 | 94.12 | 96.87 | +4.03 | 54.02 | 68.76 | 80.82 | +0.85 | 95.61 | 97.57 | 99.22 | +0.95 |
| Diff-Mix [41] | 50.35 | 58.19 | 64.48 | +12.14 | 89.46 | 93.86 | 96.63 | +4.53 | 60.89 | 66.33 | 73.08 | -0.25 | 95.29 | 97.77 | 99.00 | +0.83 |
| Diff-II [40] | 51.21 | 62.31 | 70.28 | +15.74 | 89.54 | 94.39 | 97.35 | +4.97 | 64.50 | 74.53 | 81.46 | +6.48 | 95.34 | 98.52 | 99.37 | +1.22 |
| Diff-II† [40] | 53.59 | 64.14 | 69.52 | +16.89 | 88.44 | 94.49 | 96.84 | +4.47 | 66.93 | 75.54 | 81.72 | +7.71 | 92.81 | 98.57 | 99.44 | +0.42 |
| Ours | 56.09 | 66.15 | 71.68 | +19.11 | 90.34 | 95.29 | 97.60 | +5.62 | 69.87 | 77.51 | 82.59 | +9.64 | 96.13 | 98.59 | 99.44 | +1.53 |
Table 2. Few-shot (5-shot and 10-shot) classification results.
| Method | 5-shot | 10-shot | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| CUB | Air. | Pet | Car | Avg | CUB | Air. | Pet | Car | Avg | |
| CE | 54.52 | 36.63 | 86.98 | 40.10 | 54.56 | 70.26 | 54.11 | 90.41 | 69.64 | 71.11 |
| Mixup | 54.33 | 36.75 | 86.36 | 41.43 | 54.72 | 70.00 | 55.28 | 89.49 | 70.28 | 71.26 |
| CutMix | 51.74 | 34.20 | 85.41 | 41.89 | 53.31 | 68.91 | 51.05 | 89.71 | 67.71 | 69.35 |
| Real-Filter | 55.03 | 40.40 | 87.66 | 57.60 | 60.17 | 67.36 | 47.21 | 90.14 | 69.64 | 68.59 |
| Real-Guidance | 54.67 | 36.27 | 87.22 | 41.60 | 54.90 | 69.81 | 54.77 | 90.00 | 70.97 | 71.40 |
| Real-Mix | 51.00 | 32.21 | 86.42 | 53.56 | 55.80 | 64.65 | 44.16 | 89.00 | 75.72 | 68.38 |
| Da-Fusion | 59.40 | 34.98 | 87.41 | 58.73 | 60.13 | 72.05 | 51.14 | 90.47 | 77.61 | 72.82 |
| Diff-AUG | 61.14 | 39.42 | 89.23 | 54.08 | 60.97 | 71.94 | 53.04 | 91.00 | 75.66 | 72.91 |
| Diff-Mix | 56.18 | 32.61 | 88.77 | 56.39 | 58.49 | 70.16 | 52.33 | 89.78 | 72.39 | 71.17 |
| Diff-II | 62.22 | 42.15 | 89.84 | 64.24 | 64.61 | 72.66 | 57.43 | 91.01 | 82.02 | 75.78 |
| Ours | 66.98 | 41.04 | 89.67 | 67.49 | 66.30 | 74.11 | 57.67 | 91.25 | 83.58 | 76.65 |
verse backgrounds. On Flower-LT, (a) and (b) drift from the reference color patterns and fail to follow the given prompt (e.g., “against a brick wall”); (d) MGR+RNO successfully generates prompt-conditioned samples while preserving the distinctive color and petal structure of the reference flower.
5.3. Downstream Classification
Long-tailed. Table 1 reports results on CUB- and Flower-LT across three imbalance factors and two classifier architectures, where our method achieves the best accuracy in all reported settings. The improvement is largest in the most data-scarce CUB-LT IF100 setting: relative to Diff-II† under the same class-normalized synthetic-data protocol, our method improves ResNet-50 accuracy from 53.59% to 56.09% (+2.50 points) and ViT-B/16 accuracy from 66.93% to 69.87% (+2.94 points). On Flower-LT, gains are smaller where strongest baselines already exceed 94–99% accuracy, but our method remains competitive.
Few-shot. Table 2 summarizes 5-shot and 10-shot results on CUB, Aircraft, Pet, and Cars, where our method achieves the highest average accuracy in both regimes, outperforming Diff-II by 1.69 and 0.87 points respectively. The gains are driven by CUB (+4.76 points) and Car (+3.25 points)
Table 3. Background-shift evaluation on Waterbirds.
| Method | (L,L) | (W,W) | (L,W) | (W,L) | Avg |
|---|---|---|---|---|---|
| CE | 38.55 | 32.15 | 37.90 | 30.20 | 34.70 |
| Real-Filter [13] | 38.87 | 34.72 | 38.25 | 31.64 | 35.87 |
| Real-Guidance [13] | 39.49 | 33.64 | 39.80 | 29.78 | 35.68 |
| Real-Mix [41] | 30.29 | 29.44 | 30.02 | 26.95 | 29.18 |
| Da-Fusion [38] | 44.50 | 39.04 | 44.46 | 33.49 | 40.37 |
| Diff-AUG [41] | 49.02 | 40.59 | 48.71 | 38.58 | 44.23 |
| Diff-Mix [41] | 33.84 | 30.53 | 34.72 | 28.19 | 31.82 |
| Diff-II [40] | 49.84 | 41.46 | 51.01 | 42.03 | 46.09 |
| Ours | 52.73 | 41.90 | 52.20 | 42.37 | 47.30 |
in the 5-shot setting; on Aircraft, where large intra-class appearance variation makes reference anchoring less effective, Diff-II remains slightly better (-1.11 points), while the 10-shot setting shows improvements on all four datasets.
Background-shift robustness. Table 3 shows improvements in mean group accuracy from 46.09% to 47.30% (+1.21) and worst-group from 41.46% to 41.90% (+0.44). This is consistent with our design: MGR Attention strengthens foreground cues, while RNO diversifies contexts in the training data, suggesting reduced spurious correlations between bird labels and background appearance.
5.4. Ablation Studies
Qualitative design analysis. Figure 4 provides visual evidence for the design choices analyzed below. For MGR Attention (left), global key-value replacement (K/V swap; VSP-style [17]) transfers reference style across the entire image; applying an attention-derived mask (MasaCtrl [3]-style) reduces global leakage but remains imprecise in adapted diffusion models. Using a K/V swap with SAM3 mask improves localization but can still over-transfer reference appearance. MGR Attention with foreground-selective value update best preserves target layout while enhancing

Figure 4. Qualitative module comparisons. (left) On CUB-LT IF100 and Pet 5-shot, (a) global K/V replacement (VSP-style [17]), (b) attention-masked K/V replacement (MasaCtrl [3]-style), and (c) SAM3-masked K/V replacement introduce unwanted reference style or disrupt target layout, whereas (d) Ours better preserves target layout while enhancing localized foreground details. (right) On a single-image Flower-LT class with varying prompts, (a) CL collapses to similar outputs, (b) CADS increases variation at the cost of quality degradation, and (c) CNO generates diverse samples but struggles to follow prompt-conditioned variation, whereas (d) RNO produces diverse prompt-conditioned layouts while retaining recognizable foreground structure.
Table 4. Module ablation on CUB-LT and Flower-LT IF100. Single: 1 image per class (CUB: 83 classes, Flower: 37 classes). Few: <5/<10 images per class, including Single.
| Method | CUB-LT IF100 | Flower-LT IF100 | ||||
|---|---|---|---|---|---|---|
| Few | Single | Avg | Few | Single | Avg | |
| CL | 42.95 | 37.79 | 54.16 | 77.37 | 64.39 | 87.74 |
| MGR | 44.70 | 39.46 | 55.61 | 80.67 | 69.14 | 89.34 |
| RNO | 43.23 | 37.18 | 54.49 | 76.35 | 61.37 | 87.16 |
| MGR+RNO | 46.08 | 41.05 | 56.09 | 82.18 | 72.04 | 90.34 |
localized object details. For RNO (right), CL and CNO remain close to repetitive class-prior modes, whereas CADS degrades sample quality; RNO produces broader prompt-conditioned layouts with recognizable foreground structure. Module Contributions. Table 4 reports module ablations (CUB- and Flower-LT IF100). MGR Attention improves Few and Single accuracy over CL on both datasets (CUB-LT: +1.75/+1.67; Flower-LT: +3.30/+4.75), confirming that foreground-selective value update strengthens discriminative details in data-scarce classes. RNO alone shows mixed results: it improves CUB-LT (+0.33 overall) but slightly reduces Flower-LT (-0.58), indicating that sampling variation alone is insufficient without foreground guidance. MGR+RNO achieves the best accuracy on both datasets, with gains in Few and Single groups (+3.13/+3.26 on CUB-LT; +4.81/+7.65 on Flower-LT), confirming complementary roles: RNO broadens sampled configurations while MGR reinforces foreground evidence.
Design Choices. Table 5 ablates design choices on CUB-
Table 5. Design choice ablation on CUB-LT and Flower-LT IF100. (i) Attention mechanism. (ii) Noise optimization.
| Method | CUB-LT IF100 | Flower-LT IF100 | ||||
|---|---|---|---|---|---|---|
| Few | Single | Avg | Few | Single | Avg | |
| CL | 42.95 | 37.79 | 54.16 | 77.37 | 64.39 | 87.74 |
| K/V swap | 43.26 | 37.46 | 54.71 | 79.41 | 66.36 | 88.57 |
| K/V swap (Attn. mask) | 35.47 | 27.97 | 49.28 | 79.12 | 66.13 | 88.66 |
| K/V swap (SAM3) | 51.26 | 31.67 | 51.36 | 79.21 | 66.01 | 88.64 |
| MGR (Attn. mask) | 43.70 | 37.71 | 54.71 | 77.95 | 64.97 | 87.98 |
| MGR (SAM3, Ours) | 44.70 | 39.46 | 55.61 | 80.67 | 69.14 | 89.34 |
| MGR+CNO [18] | 45.84 | 40.18 | 55.83 | 72.09 | 66.82 | 89.05 |
| MGR+RNO (Ours) | 46.08 | 41.05 | 56.09 | 82.18 | 72.04 | 90.34 |
and Flower-LT IF100. (i) Attention mechanism. On CUB-LT, global K/V swap slightly improves Few accuracy but degrades Single-group performance (37.46% vs. 37.79%); applying an attention-derived mask (MasaCtrl-style) further hurts both groups (Single: 27.97%), confirming that attention-derived masks are unreliable in adapted diffusion models. K/V swap with SAM3 mask improves Few (51.26%) but substantially reduces Single accuracy (31.67%), showing that key modification disrupts the adapted class structure even with accurate masks. MGR's value-only update resolves this: replacing the attention-derived mask with SAM3 improves Single from 37.71% to 39.46%. (ii) Noise optimization. Comparing CNO and RNO on top of MGR, MGR+RNO consistently outperforms MGR+CNO on Single-group accuracy (41.05% vs. 40.18% on CUB-LT; 72.04% vs. 66.82% on Flower-LT), demonstrating that repulsion-only optimization better suits adapted diffusion models.
Table 6. Diversity and foreground detail metrics on single-sample classes of CUB-LT and Flower-LT IF100. MSS [34] and Vendi [7] measure diversity; Ref-FG Sim measures foreground similarity via DINov2 [30] features on SAM3 [4]-segmented regions. Bold indicates best among MGR-based methods; CADS is excluded as it produces severe quality degradation (see Fig. 4).
| Method | CUB-LT IF100 | Flower-LT IF100 | ||||
|---|---|---|---|---|---|---|
| MSS↓ | Vendi↑ | Ref-FG↑ | MSS↓ | Vendi↑ | Ref-FG↑ | |
| CL | 0.62 | 7.46 | 0.45 | 0.81 | 3.25 | 0.59 |
| CADS | 0.35 | 17.51 | 0.22 | 0.56 | 8.89 | 0.28 |
| CNO | 0.58 | 8.39 | 0.44 | 0.76 | 4.12 | 0.56 |
| MGR | 0.60 | 7.89 | 0.46 | 0.79 | 3.60 | 0.61 |
| MGR+CNO | 0.63 | 7.18 | 0.48 | 0.77 | 3.86 | 0.59 |
| MGR+RNO | 0.58 | 8.28 | 0.49 | 0.72 | 4.91 | 0.56 |
Table 7. Mask extraction timestep analysis on CUB-LT and Flower-LT IF100.
| CUB-LT IF100 | Flower-LT IF100 | |||||
|---|---|---|---|---|---|---|
| Few | Single | Avg | Few | Single | Avg | |
| 40 | 45.17 | 39.91 | 55.92 | 80.09 | 68.10 | 89.10 |
| 30 ✓ | 46.08 | 41.05 | 56.09 | 82.18 | 72.04 | 90.34 |
| 20 | 44.72 | 39.50 | 55.58 | 80.52 | 67.75 | 89.27 |
| 10 | 43.15 | 37.99 | 54.30 | 79.65 | 67.40 | 88.86 |
Diversity–Detail Analysis. Table 6 analyzes diversity and foreground detail of synthetic samples by each method on single-sample classes of CUB-LT and Flower-LT IF100 (83 and 37 classes, respectively; 50 images per class). We report MSS [34] and Vendi [7] as diversity metrics, and Ref-FG Sim as a measure of foreground similarity to the reference image. CADS achieves the highest diversity but substantially reduces foreground details (see also Fig. 4). CNO improves diversity over CL without improving Ref-FG Sim, while MGR consistently increases Ref-FG Sim, confirming that foreground-selective value update transfers discriminative reference details. Although the absolute gain is modest, it translates to meaningful downstream accuracy improvements in Few and Single groups (Tab. 4). MGR+RNO (Ours) outperforms MGR+CNO in diversity on both datasets while achieving the highest Ref-FG Sim on CUB-LT; on Flower-LT, Ref-FG Sim is slightly lower than CL as RNO introduces greater layout variation, yet MGR+RNO attains the best downstream accuracy across all settings. These results support that improving both diversity and foreground details contributes to downstream gains.
Mask extraction timestep. Table 7 ablates the mask extraction timestep on CUB-LT and Flower-LT IF100. Both datasets peak at . Flower-LT shows higher sensitivity, with a larger performance drop at (Single: 67.40 vs. 72.04). At , masks may be extracted before sufficient object structure has emerged, likely limiting the effectiveness of reference-guided refinement, particularly on Flower-LT where larger foreground objects re-
Table 8. Compatibility with BOB [44] on Flower-LT IF100. Reproduced following the official repository.
| Method | SD v1.5 | SD v2.1 | ||||
|---|---|---|---|---|---|---|
| Few | Single | Avg | Few | Single | Avg | |
| BOB | 79.70 | 69.58 | 85.49 | 80.52 | 70.27 | 86.03 |
| BOB+Ours | 81.80 | 72.53 | 86.80 | 83.14 | 75.64 | 87.83 |
quire more denoising steps to form reliable boundaries. At , the remaining denoising steps may be insufficient for MGR Attention to effectively incorporate reference features. MGR Attention also shows robust performance across different zero-shot segmenters (see supplementary).
Compatibility with alternative adaptation. Table 8 applies our modules to BOB [44] on Flower-LT IF100, reproduced following its diffusion-adaptation and classifier-training protocols. BOB+Ours consistently improves over BOB across both SD v1.5 and SD v2.1 backbones, with the gains in Single-group accuracy of 2.95 and 5.37 points. These results show that, on Flower-LT, our sampling-time modules remain effective on top of an alternative concept-learning method.
6. Conclusion
We introduced a sampling-time diffusion augmentation framework combining MGR Attention and RNO for data-scarce image classification. MGR Attention updates only foreground value tokens with reference features via zero-shot segmentation, strengthening fine-grained object details while limiting unwanted reference propagation. RNO optimizes initial latent trajectories via a repulsion-only objective against adaptation-prompt anchors, promoting prompt-conditioned diversity. Across long-tailed, few-shot, and background-shift evaluations, the proposed framework improves downstream classifier accuracy with the largest gains in Few and Single groups, confirming the complementary roles of the two modules.
Limitations and future work. Applying a strong repulsion objective in RNO may push latent trajectories away from class-consistent regions. A theoretical understanding of how repulsion strength affects the trade-off between diversity and class consistency remains an interesting direction for future work. Beyond sampling-time interventions, incorporating reference-guided objectives into the concept-learning process itself could yield stronger adapted priors under extreme data scarcity, offering a complementary direction to our approach. In addition, our experiments are limited to UNet-based Stable Diffusion backbones (v1.5 and v2.1); extending MGR Attention to transformer-based architectures such as MM-DiT, where image and text tokens share joint attention, is left for future work.
Acknowledgments
This work was supported in part by the National Research Foundation of Korea under Grant RS-2024-00349697 and Grant RS-2021-NR060143; in part by the Technology Development Program (RS-2024-00437796) funded by the Ministry of SMEs and Startups (MSS, Korea); in part by the Institute for Information and Communications Technology Planning and Evaluation under Grant IITP-2027-RS-2020-II201819; and in part by Korea University Grant.
References
[1] Shekoofeh Azizi, Simon Kornblith, Chitwan Saharia, Mohammad Norouzi, and David J. Fleet. Synthetic data from diffusion models improves imagenet classification. Transactions on Machine Learning Research, 2023. 2
[2] Kaidi Cao, Colin Wei, Adrien Gaidon, Nikos Arechiga, and Tengyu Ma. Learning imbalanced datasets with label-distribution-aware margin loss. Advances in neural information processing systems, 32, 2019. 5, 6
[3] Mingdeng Cao, Xintao Wang, Zhongang Qi, Ying Shan, Xiaohu Qie, and Yinqiang Zheng. Masactrl: Tuning-free mutual self-attention control for consistent image synthesis and editing. In Proceedings of the IEEE/CVF international conference on computer vision, pages 22560–22570, 2023. 2, 6, 7, 13, 14
[4] Nicolas Carion, Laura Gustafson, Yuan-Ting Hu, Shoubhik Debnath, Ronghang Hu, Didac Suris, Chaitanya Ryali, Kalyan Vasudev Alwala, Haitham Khedr, Andrew Huang, et al. Sam 3: Segment anything with concepts. arXiv preprint arXiv:2511.16719, 2025. 2, 3, 5, 8, 12
[5] Xi Chen et al. Anydoor: Zero-shot object-level image customization. In Proc. CVPR, 2024. 3
[6] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. ICLR, 2021. 5
[7] Dan Friedman and Adji Bousso Dieng. The vendi score: A diversity evaluation metric for machine learning. Transactions on Machine Learning Research, 2023. 8
[8] Rinon Gal, Yuval Alaluf, Yuval Atzmon, Or Patashnik, Amit H. Bermano, Gal Chechik, and Daniel Cohen-Or. An image is worth one word: Personalizing text-to-image generation using textual inversion. In The Eleventh International Conference on Learning Representations, 2023. 2
[9] Jing Gu et al. Photoswap: Personalized subject swapping in images. In Proc. NeurIPS, 2023. 13
[10] Xiefan Guo, Jinlin Liu, Miaomiao Cui, Jiankai Li, Hongyu Yang, and Di Huang. Initno: Boosting text-to-image diffusion models via initial noise optimization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9380–9389, 2024. 3
[11] Anne Harrington, A Koepke, Shyamgopal Karthik, Trevor Darrell, and Alexei A Efros. It's never too late: Noise optimization for collapse recovery in trained diffusion models.
In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 43124–43134, 2026. 3
[12] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016. 5
[13] Ruifei He, Shuyang Sun, Xin Yu, Chuhui Xue, Wenqing Zhang, Philip Torr, Song Bai, and Xiaojuan Qi. Is synthetic data from generative models ready for image recognition? arXiv preprint arXiv:2210.07574, 2022. 2, 5, 6
[14] Amir Hertz, Ron Mokady, Jay Tenenbaum, Kfir Aberman, Yael Pritch, and Daniel Cohen-Or. Prompt-to-prompt image editing with cross attention control. In The 11th International Conference on Learning Representations (ICLR), 2023. 2, 13
[15] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840–6851, 2020. 3
[16] Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. In ICLR, 2022. 2
[17] Jaeseok Jeong, Junho Kim, Yunjey Choi, Gayoung Lee, and Youngjung Uh. Visual style prompting with swapping self-attention. arXiv preprint arXiv:2402.12974, 2024. 2, 6, 7, 13, 14
[18] Byungjun Kim, Soobin Um, and Jong Chul Ye. Diverse text-to-image generation via contrastive noise optimization. arXiv preprint arXiv:2510.03813, 2025. 2, 3, 4, 7
[19] Alexander Kirillov et al. Segment anything. In Proc. ICCV, 2023. 2, 3
[20] GaYeon Koh, Hyun-Jic Oh, Jeonghyun Noh, and Won-Ki Jeong. Synthetic data augmentation using pre-trained diffusion models for long-tailed food image classification. In Proceedings of the Computer Vision and Pattern Recognition Conference, pages 391–400, 2025. 2
[21] Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In Proceedings of the IEEE international conference on computer vision workshops, pages 554–561, 2013. 5
[22] Yuhang Li et al. A simple background augmentation method for object detection with diffusion model. In Proc. ECCV, 2024. 13
[23] Yu Li et al. Domain-rag: Retrieval-guided compositional image generation for cross-domain few-shot object detection. arXiv:2506.05872, 2025. 3, 13
[24] Zhiguang Lu, Qianqian Xu, Peisong Wen, Siran Dai, and Qingming Huang. Higfa: Hierarchical guidance for fine-grained data augmentation with diffusion models. arXiv preprint arXiv:2511.12547, 2025. 2
[25] Timo Lüddecke and Alexander Ecker. Image segmentation using text and image prompts. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 7086–7096, 2022. 12
[26] Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Fine-grained visual classi-fication of aircraft. arXiv preprint arXiv:1306.5151, 2013.5
[27] Atsuyuki Miyai, Jingkang Yang, Jingyang Zhang, Yifei Ming, Yueqian Lin, Qing Yu, Go Irie, Shafiq Joty, Yixuan Li, Hai Li, et al. Generalized out-of-distribution detection and beyond in vision language model era: A survey. arXiv preprint arXiv:2407.21794, 2024. 1
[28] Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021. 1, 2
[29] Hyun-Jic Oh and Won-Ki Jeong. Controllable and efficient multi-class pathology nuclei data augmentation using text-conditioned diffusion models. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 36–46. Springer, 2024. 2
[30] Maxime Oquab, Timothée Darcet, Théo Moutakanni, Huy Vo, Marc Szafraniec, Vasil Khalidov, Pierre Fernandez, Daniel Haziza, Francisco Massa, Alaaldin El-Nouby, et al. Dinov2: Learning robust visual features without supervision. arXiv preprint arXiv:2304.07193, 2023. 8
[31] Seulki Park, Youngkyu Hong, Byeongho Heo, Sangdoo Yun, and Jin Young Choi. The majority can help the minority: Context-rich minority oversampling for long-tailed classification. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 6887–6896, 2022. 5, 6
[32] Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition, pages 3498–3505. IEEE, 2012. 5
[33] Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In CVPR, pages 10684–10695, 2022. 1, 2, 3, 5
[34] Seyedmorteza Sadat, Jakob Buhmann, Derek Bradley, Otmar Hilliges, and Romann Weber. Cads: Unleashing the diversity of diffusion models through condition-annealed sampling. In International Conference on Learning Representations, pages 23723–23755, 2024. 3, 8
[35] Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprint arXiv:1911.08731, 2019. 5
[36] Dvir Samuel, Yuval Atzmon, and Gal Chechik. From generalized zero-shot learning to long-tail with class descriptors. In Proceedings of the IEEE/CVF winter conference on applications of computer vision, pages 286–295, 2021. 5
[37] Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502, 2020. 5
[38] Brandon Trabucco, Kyle Doherty, Max Gurinas, and Ruslan Salakhutdinov. Effective data augmentation with diffusion models. In The Twelfth International Conference on Learning Representations, 2024. 2, 5, 6
[39] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. 5
[40] Yanghao Wang and Long Chen. Inversion circle interpolation: Diffusion-based image augmentation for data-scarse classification. In Proceedings of the Computer Vision and Pattern Recognition Conference, pages 25560–25569, 2025. 2, 5, 6, 13
[41] Zhicai Wang, Longhui Wei, Tan Wang, Heyu Chen, Yanbin Hao, Xiang Wang, Xiangnan He, and Qi Tian. Enhance image classification via inter-class image mixup with diffusion model. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 17223–17233, 2024. 2, 5, 6
[42] Jinheng Xie et al. Boxdiff: Text-to-image synthesis with training-free box-constrained diffusion. In Proc. ICCV, 2023. 3
[43] Huali Xu, Shuaifeng Zhi, Shuzhou Sun, Vishal Patel, and Li Liu. Deep learning for cross-domain few-shot visual recognition: A survey. ACM Computing Surveys, 57(8):1–37, 2025. 1
[44] William Yang, Xindi Wu, Zhiwei Deng, Esin Tureci, and Olga Russakovsky. Beyond objects: Contextual synthetic data generation for fine-grained classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 22498–22508, 2026. 2, 5, 8
[45] Moon Ye-Bin, Nam Hyeon-Woo, Wonseok Choi, Nayeong Kim, Suha Kwak, and Tae-Hyun Oh. SYNAuG: Exploiting synthetic data for data imbalance problems. arXiv preprint arXiv:2308.00994, 2023. 5, 6
[46] Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In ICCV, pages 6023–6032, 2019. 5, 6
[47] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. 5, 6
[48] Yifan Zhang, Bingyi Kang, Bryan Hooi, Shuicheng Yan, and Jiashi Feng. Deep long-tailed learning: A survey. IEEE transactions on pattern analysis and machine intelligence, 45(9):10795–10816, 2023. 1
[49] Tianchen Zhao, Xuanbai Chen, Zhihua Li, Jun Fang, Dongsheng An, Xiang Xu, Zhuowen Tu, and Yifan Xing. Salient concept-aware generative data augmentation. arXiv preprint arXiv:2510.15194, 2025. 2
[50] Haowei Zhu, Tianxiang Pan, Rui Qin, Jun-Hai Yong, and Bin Wang. Recon: Region-controllable data augmentation with rectification and alignment for object detection. arXiv preprint arXiv:2510.15783, 2025. 3
Improving Diffusion-Based Augmentation for Data-Scarce Image Classification via Mask-Guided Reference Attention and Repulsive Noise Optimization
Supplementary Materials
In this supplementary material, we provide additional implementation details and analyses complementing the main paper, organized as follows:
-
Implementation details (Sec. S1)
-
Sampling algorithm (Sec. S2)
-
MGR Attention analysis (Sec. S3)
-
Segmentation backbone sensitivity (Sec. S4)
-
RNO hyperparameter sensitivity (Sec. S5)
-
Comparison to Reference-Guided Methods (Sec. S6)
-
Additional qualitative results (Sec. S7)
S1. Implementation Details
Reference mask extraction. Reference masks are pre-computed offline using SAM3. To ensure mask validity, each image-mask overlay is automatically checked using Qwen2.5-VL-3B-Instruct¹. Among 16,890 reference images across all datasets, 36 (0.21%) produced invalid masks and were replaced with revised masks.
RNO hyperparameters. RNO uses 3 optimization steps with learning rate (LR) 0.01 for CUB-LT, 10 steps with LR 0.04 for Aircraft, Cars, and Pet, and 30 steps with LR 0.08 for Flower-LT. We use initial noises per optimization batch; each noise is optimized as a target, with the remaining noises conditioned on serving as its frozen (stop-gradient) adaptation-prompt anchors (Eq. 4).
S2. Sampling Algorithm
Algorithm 1 summarizes the proposed sampling process. RNO optimizes target initial noises against frozen adaptation-prompt anchors before denoising begins (lines 4–11). The denoising then proceeds from to (lines 19–20) to establish spatial structure for mask extraction (lines 14–16), after which MGR Attention is activated for the remaining steps (, lines 17–18).
S3. Analysis on MGR Attention
Value feature visualization. Figure 5 visualizes target value features during denoising across timesteps, depicting the effect of the value update in Eq. (7). CL activations (a) remain dominated by the adapted class prior throughout denoising. Foreground-only update (b) produces more structured foreground responses, but background regions appear smoothed in the output image. MGR Attention
Algorithm 1 Sampling with MGR Attention and RNO
1: Input: adapted denoiser , adaptation prompt , target prompts , reference image , mask timestep , , RNO steps , LR
2: // : pre-computed from via SAM3 (offline)
3: Initialize
4: // RNO: optimize target noises
5: Compute for all
6: for to do
7: Compute for all
8: (Equation (4))
9: for all
10: end for
11: // optimized noises
12: // Denoising:
13: for down to 1 do
14: if then
15: \{\mathbf{M}_t^i\} \leftarrow \text{SAM3}(\text{decode}(\hat{\mathbf{z}}_0^{i*}_{t_m})) for all
16: end if
17: if then
18:
19: else
20:
21: end if
22: end for
23: return

Figure 5. Target value features () over denoising timesteps and final outputs: (a) CL, (b) foreground-only update (), and (c) MGR Attention. MGR aligns foreground activations with the reference while keeping target responses outside the foreground.
(c, Ours) strengthens foreground responses aligned with the reference while retaining target background activations, producing more structured non-foreground responses than (b). These results support retaining target background values in the value update, as formulated in Eq. (7).
¹https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct

Reference (a) Up (Ours) (b) Mid blocks, (c) Down blocks, (d) CL
Figure 6. Layer selection for MGR Attention on CUB-LT IF100. (a) Up-blocks (Ours), (b) Mid-blocks, (c) Down-blocks, (d) CL baseline. Up-blocks best preserve foreground details.
Table 9. Layer selection analysis for MGR Attention on CUB-LT IF100 (ResNet-50). Decoder up-blocks yield the best performance.
| Method | Many | Medium | Few | Single | Avg |
|---|---|---|---|---|---|
| Down-blocks | 82.89 | 70.48 | 42.01 | 36.28 | 53.62 |
| Mid-blocks | 84.82 | 71.10 | 42.95 | 37.55 | 54.54 |
| Up-blocks (Ours) | 85.54 | 70.87 | 44.70 | 39.46 | 55.61 |
Layer selection. Figure 6 and Tab. 9 ablate the self-attention layer selection for MGR Attention on CUB-LT IF100. In Tab. 9, decoder up-blocks consistently yield the best accuracy; we apply MGR Attention to up-block layers from layer 2.1, selected empirically. Mid-blocks show slightly higher Medium accuracy but underperform on tail classes, while down-blocks perform worst overall, producing outputs closer to the CL baseline as shown in Fig. 6.
Feature modification strategy. Figure 7 provides visual evidence for the foreground value update design in MGR Attention. Our foreground-selective value update (e, ) empirically yields a better balance between reference guidance and layout preservation across both datasets.
Attention bank composition. Figure 8 provides visual evidence for the KV bank design in MGR Attention. Using foreground-only reference tokens (c, , ) or using full reference tokens (d, , ) can produce incomplete structures (row 2). Our bank design (e, ) empirically yields a better balance between foreground guidance and spatial grounding.

(a) Reference
(b) CL
(c)
(d)
(e) Ours
Figure 7. Feature modification strategy on CUB-LT IF100 and Flower-LT IF100. (a) Reference, (b) CL baseline, (c) key-only ( ), (d) key-value ( , ), (e) Ours: foreground value update ( ).

(a) Reference
(b) CL
(c)
(d)
(e) Ours
Figure 8. KV bank composition on CUB-LT and Flower-LT IF100. (a) Reference, (b) CL baseline, (c) foreground-only ( ), (d) reference-full ( ), (e) Ours ( ).
Table 10. Segmentation backbone analysis on CUB-LT IF100 (MGR+RNO, ResNet-50).
| Segmenter | Many | Medium | Few | Single | Avg |
|---|---|---|---|---|---|
| CLIPSeg [25] | 84.34 | 70.19 | 45.80 | 40.44 | 56.01 |
| SAM3 [4]✓ | 85.78 | 69.57 | 46.08 | 41.05 | 56.09 |
S4. Segmentation Backbone
Table 10 compares CLIPSeg [25] and SAM3 [4] as zero-shot segmenters on CUB-LT IF100. Both backbones show comparable overall performance (Avg within 0.08 points), indicating that MGR Attention is robust to the choice of segmentation backbone. SAM3 achieves slightly better Few and overall accuracy, and is used as the default segmenter in all main paper experiments.

(a) CL
(b) Increases RNO repulsion strength (→)
Figure 9. Effect of increasing RNO repulsion strength on CUB-LT and Flower-LT IF100. (a) CL. (b) Ours with increasing RNO repulsion strength from left to right, starting from the default setting (CUB: 3 steps, LR 0.01; Flower: 30 steps, LR 0.08). Prompts: “sitting on a branch of a tree” (CUB) and “with water droplets on it” (Flower). Greater repulsion introduces layout diversity but risks drifting from class-consistent foreground appearance (yellow boxes).
Table 11. RNO hyperparameter sensitivity on CUB-LT IF100 (MGR+RNO, ResNet-50).
| Steps | LR | Many | Medium | Few | Single | Avg |
|---|---|---|---|---|---|---|
| 30 | 0.08 | 84.34 | 70.48 | 44.86 | 39.22 | 55.51 |
| 10 | 0.04 | 85.39 | 70.66 | 44.36 | 39.31 | 55.67 |
| 5 | 0.04 | 84.82 | 71.61 | 45.14 | 39.87 | 56.06 |
| 3 | 0.01✓ | 85.78 | 69.57 | 46.08 | 41.05 | 56.09 |
S5. RNO Sensitivity
Figure 9 illustrates the effect of increasing repulsion strength on generated samples. With the default setting (leftmost column of (b)), MGR+RNO preserves foreground details while generating diverse layouts. As repulsion strength increases (remaining columns of (b)), generated samples show greater layout variation but can drift from class-consistent foreground appearance, suggesting that applying too strong a repulsion objective may push latent trajectories away from class-consistent regions.
Table 11 ablates RNO hyperparameter sensitivity on CUB-LT IF100. The empirically selected setting (3 steps, LR 0.01) achieves the best Few, Single, and overall accuracy, while stronger repulsion settings do not consistently improve performance across all groups.
S6. Comparison to Reference-Guided Methods
Table 12 compares MGR Attention against attention-based editing and detection-oriented augmentation methods on CUB-LT IF100. Attention editing methods (P2P [14], PHOTOSWAP [9], MasaCtrl [3], VSP [17]) show limited gains on Few and Single groups as global feature manipulation degrades foreground details, while detection-oriented methods (Li et al. [22], Domain-RAG [23]) re-
Table 12. Comparison with attention-based editing and detection-oriented augmentation on CUB-LT IF100 (ResNet-50). All rows are our runs under the same protocol (main-paper Tab. 1 reports CE from Diff-II [40]); attention-editing baselines use their original settings, unlike the in-pipeline K/V variants in main-paper Tab. 5. Groups (classes): Many (16), Medium (61), Few incl. Single (123), Single (83).
| Method | Many | Medium | Few | Single | Avg |
|---|---|---|---|---|---|
| CE only | 85.54 | 67.14 | 18.33 | 7.38 | 38.04 |
| Diff-II [40] | 83.86 | 70.14 | 42.01 | 36.69 | 53.59 |
| P2P [14] | 84.82 | 69.91 | 41.40 | 35.55 | 53.21 |
| PHOTOSWAP [9] | 83.37 | 63.57 | 19.83 | 11.62 | 37.73 |
| MasaCtrl [3] | 84.58 | 66.74 | 18.50 | 7.75 | 37.95 |
| VSP [17] | 85.30 | 70.81 | 42.62 | 36.77 | 54.28 |
| Li et al. [22] | 82.17 | 64.03 | 18.64 | 10.40 | 37.04 |
| Domain-RAG [23] | 84.10 | 62.67 | 19.75 | 11.29 | 37.45 |
| MGR (Ours) | 85.54 | 70.87 | 44.70 | 39.46 | 55.61 |
| MGR+RNO (Ours) | 85.78 | 69.57 | 46.08 | 41.05 | 56.09 |
quire bounding box annotations or object-level objectives and underperform on tail classes in our classification setting. MGR consistently improves Few and Single accuracy, and MGR+RNO achieves the best overall performance.
S7. Additional Qualitative Results
Figure 10 visualizes the qualitative comparison to Car 5-shot and Aircraft 5-shot settings. As in Fig. 4 (left), global/attention-masked K/V replacement (a, b) introduce style leakage and blurry object regions on fine-grained vehicle and aircraft textures. SAM3-masked K/V replacement (c) reduces global noise but can still produce blurry foreground regions. Ours (d) consistently better preserves target layout and foreground details.
Car 5-shot
Aircraft 5-shot

(a)
(b)
(c)
(d)
Reference
Figure 10. Qualitative comparison on Car 5-shot and Aircraft 5-shot. (a) Global K/V replacement (VSP-style [17]), (b) attention-masked K/V replacement (MasaCtrl [3]-style), (c) SAM3-masked K/V replacement, and (d) Ours (MGR Attention). (a) and (b) introduce global style propagation and blurry object regions; (c) reduces noise but can still produce blurry foreground. (d) better preserves target layout while enhancing localized foreground details.