TL;DR
Compressing massive datasets into tiny synthetic equivalents—known as dataset distillation—works wonders for image classification, yet falls flat on pixel-level tasks like semantic segmentation due to crippling GPU memory costs or over-reliance on rigid, real-world image layouts. Enter S$^2$-RL, a framework that treats a text-to-image diffusion model as a reinforcement learning agent, teaching it to dream up entirely new, information-dense scenes from scratch without ever computing expensive pixel-wise gradients. By balancing the quality of individual images with the semantic diversity of the entire set, S$^2$-RL shrinks massive segmentation datasets by over 99% while outperforming existing baselines.
What Problem Does This Paper Address?
Deep learning models are notoriously data-hungry. Dataset distillation tries to put them on a diet by synthesizing a tiny set of hyper-informative "surrogate" images that train a student model nearly as well as the full dataset.
While this works well for simple image classification, extending it to semantic segmentation (labeling every single pixel in an image) hits two walls:
- The Memory Wall (Optimization-based methods): Classic distillation is a bi-level optimization game—train a student on synthetic data in an inner loop, check its loss on real data, and backpropagate all the way back to update the synthetic pixels. Doing this across high-resolution, pixel-wise computation graphs requires $\mathcal{O}(H \cdot W \cdot C)$ memory, quickly melting GPUs.
- The Creativity Wall (Proxy-based generative methods): To dodge those gradients, newer methods use generative models conditioned on segmentation masks taken directly from real data. However, this reduces the generator to a glorified coloring book—filling textures into static boundaries rather than composing novel spatial layouts that efficiently cover the dataset's long-tail distribution.
Methods
Instead of backpropagating through a student network or tracing existing masks, the authors reframe segmentation dataset distillation as a gradient-free Reinforcement Learning (RL) problem.
They take a pretrained text-to-image model (Stable Diffusion 3.5 Medium with LoRA) as the RL policy. Given a concise comma-separated list of target categories (e.g., "sky, tree, stone, bridge, lake"), the agent generates an image. It is optimized via Group Relative Policy Optimization (GRPO)—a standard critic-free RL algorithm that compares groups of generated images against each other to compute advantages.
What is genuinely novel here is the Sample-Set Dual Reward mechanism, designed to prevent the RL agent from suffering "mode collapse" (repeatedly generating the easiest, most generic version of a car or tree):
- Sample-Level Reward: Evaluates single images using frozen evaluator networks. It rewards Semantic Alignment (did all prompted objects show up, and do they occupy a meaningful pixel area?) and Intra-class Diversity (penalizing repetitive local textures within the same object class so a student learns rich features).
- Set-Level Reward: Tackles global dataset coverage as a Contextual Multi-Armed Bandit problem. Offline, the authors use DINOv3 to cluster real dataset regions into $K=50$ "semantic prototypes" (arms) per class. Online, when the generator creates an object, it pulls the closest prototype arm. Using soft visitation counts across batches, the reward grants scarcity and exploration bonuses for hitting rare, underrepresented prototypes.
Once trained, the policy generates candidate images, filters them using these same rewards, and pairs the winners with pixel-wise pseudo-labels from a pretrained teacher model.
Datasets
The authors evaluate S$^2$-RL on two major dense-prediction benchmarks:
- ADE20K
- COCO (converting panoptic annotations into semantic segmentation masks)
Because segmentation images naturally contain multiple classes, standard classification metrics like "Images Per Class" (IPC) don't translate cleanly. The authors establish a standardized evaluation protocol based on global compression ratios: 0.25%, 0.5%, and 1.0% of the dataset for ADE20K, and 0.625‰, 1.25‰, and 2.5‰ for the much larger COCO dataset.
Key Insights and Ideas
- Standard RL is greedy; distillation requires teamwork: Off-the-shelf diffusion RL (like DDPO) optimizes each image in isolation, pushing the generator toward easy, stereotypical patterns. Framing dataset coverage as a multi-armed bandit forces the generator to think collectively, actively hunting down rare visual modes in the real data manifold.
- Prompt compliance builds better boundaries: Vanilla Stable Diffusion often drops categories when given dense, 15-object prompts. Because S$^2$-RL explicitly rewards concept recall and area occupancy, it packs complex scenes tightly—naturally creating rich object-to-object boundaries and spatial relationships critical for segmentation students.
- Distilled sets are architecture-agnostic: Because the output is just clean image–mask pairs rather than model-specific gradient artifacts, a dataset distilled once transfers smoothly across CNNs and Vision Transformers alike.
Key Results
Using SegFormer-B5 as the default downstream student, S$^2$-RL achieves state-of-the-art performance across every tested compression ratio:
- ADE20K: At the extreme 0.25% budget, S$^2$-RL hits 15.60% mIoU (and 23.07% mAcc), beating the vanilla SD3.5 baseline (13.54% mIoU), Uniform coreset selection (12.05% mIoU), and proxy-guided UniDD (12.05% mIoU). At 0.5%, it reaches 21.52% mIoU (+2.93 over the strongest baseline), and 25.47% mIoU at 1.0%* (full dataset mIoU is 49.13%).
- COCO: At 0.625‰ (less than a tenth of a percent of the data!), S$^2$-RL achieves 28.46% mIoU, a +2.48 jump over the best baseline.
- Cross-Architecture Generalization: Gains hold steadily when training ResNet-18/50/101, Swin-S, ConvNeXt-S (with UPerNet), and DeepLabV3—reaching up to a +3.56 mIoU boost on ConvNeXt-S at the 0.5% ratio.
- Layout & Feature Coverage: Class-wise t-SNE plots and external OneFormer diagnostics confirm that S$^2$-RL spans much broader regions of the real feature manifold and boosts relative spatial geometry coverage from .549 (SD3.5) to .693.
Limitations and Future Work
The authors candidly note a few trade-offs:
- Upfront Cost & Priors: Fine-tuning a diffusion policy via RL isn't free, and the pipeline relies heavily on the strength of pretrained diffusion and segmentation models.
- Imperfect Teachers: Because final pixel masks are pseudo-labeled by a frozen teacher, teacher blind spots on rare or ambiguous classes get baked into the distilled set.
- Proxy Rewards: The rewards approximate—rather than directly measure—downstream student utility.
Future directions include slashing RL adaptation and sampling overhead, introducing uncertainty-aware pseudo-labeling to clean up noisy masks, and weaving in lightweight student feedback without bringing back full pixel-wise gradient unrolling.
Summary updated