Beyond Objects: Contextual Synthetic Data Generation for Fine-Grained Classification

William Yang, Xindi Wu, Zhiwei Deng, Esin Tureci, Olga Russakovsky

TL;DR

The paper introduces BOB (Beyond OBjects), a novel framework that leverages text-to-image (T2I) diffusion models to generate high-quality synthetic training data for fine-grained image classification. By explicitly isolating and shuffling class-agnostic attributes like background and pose during fine-tuning and generation, BOB prevents generative models from overfitting to limited training samples. This simple twist yields synthetic datasets with unprecedented diversity, allowing classifiers trained on just 5 real images (augmented with BOB data) to outperform models trained on 10 real images.

What Problem Does This Paper Address?

Generative AI models are increasingly used to create synthetic training data, but they struggle with fine-grained classification—tasks requiring a model to distinguish between highly similar categories, such as different models of aircraft or specific bird species.

To make a text-to-image (T2I) model generate accurate fine-grained images, researchers typically fine-tune it on a few real examples (low-shot learning). However, this introduces a major pitfall: overfitting and spurious correlations. If the five reference images of a specific airplane all happen to be on a snowy tarmac, the fine-tuned T2I model will only generate that airplane on snow. The downstream classifier then mistakenly learns that "snow" is a defining feature of that airplane. Prior methods fail to maintain a balance between class fidelity and contextual diversity.

Figure 1. BOB vs. prior methods. (Left) Prior methods do not include rich contexts during fine-tuning and sampling, leading to reduced diversity in the synthetic dataset and lower classification performance when used for downstream training. (Right) BOB mitigates this issue by incorporating rich contexts in both stages.

Methods

BOB tackles this problem through a two-stage approach: Context Preservation during fine-tuning and Context Marginalization during image generation.

  1. Context Preservation (Fine-tuning): Instead of using generic prompts like "a photo of a [classname]", the authors use a vision-language model (Qwen 2.5VL-7B) to extract the specific background and pose of each real training image. They fine-tune the T2I model (using LoRA) with highly descriptive prompts following a strict template: $$\text{"a [descriptor] photo of a [classname] in the [background] background with the [pose] pose."}$$ This forces the diffusion model to explicitly decouple the object's identity from its environment.

  2. Context Marginalization (Generation): To break any accidental associations between a class and its context, BOB creates a dataset-wide "caption bank" of all extracted backgrounds and poses. During image generation, BOB randomly pairs a class label with a background and pose sampled from any image in the dataset. Mathematically, this acts as a causal backdoor adjustment, effectively averaging out (marginalizing) the impact of the background and pose.

Overview of BOB framework

Datasets

The authors evaluated BOB across four standard fine-grained classification benchmarks:

  • FGVC-Aircraft: Aircraft models (notoriously difficult for T2I models).
  • CUB-200-2011 (CUB): Bird species.
  • Stanford Cars (Car): Car makes and models.
  • Oxford-IIIT Pets (Pets): Cat and dog breeds.

To test robustness in long-tail scenarios, they also evaluated on CUB-LT and Flower-LT (long-tail flower classification).

Key Insights and Ideas

  • Context Shuffling is Causal Intervention: Shuffling backgrounds and poses across classes forces the downstream classifier to ignore environmental cues and focus entirely on the fine-grained details of the object itself.
  • The "More Real Data" Illusion: Traditionally, engineers assume more real data is always superior to synthetic data. BOB challenges this by showing that strategically varied synthetic data can provide a stronger regularization effect than a handful of additional real images.
  • Lower FID Scores: By computing the per-class Frechet Inception Distance (FID), the authors proved that BOB's synthetic distribution aligns much closer to the true data distribution than previous state-of-the-art methods like DataDream or Diff-II.

Key Results

BOB was tested across three different classifier backbones (CLIP ViT, ImageNet-pretrained ResNet-50, and MAE ViT) and consistently outperformed existing baselines in 18 out of 24 experimental settings.

  • Massive Gains on Aircraft: On the Aircraft dataset—where standard T2I models perform poorly—BOB boosted a CLIP classifier's 5-shot accuracy to 57.4%, outperforming DataDream by 7.4%.
  • Synthetic Beats Real: In 3 out of 4 datasets (Aircraft, Car, CUB), a model trained on 5 real images + BOB synthetic images achieved higher accuracy than a model trained on 10 real images alone. For example, on CUB, the 5-shot + BOB setup reached 75.8% accuracy, beating the 10-shot real-only baseline (74.6%).
  • Long-Tail Success: On the highly imbalanced CUB-LT dataset, BOB improved classification accuracy on rare ("few-shot") classes by over 8% compared to prior diffusion-based augmentation techniques.

Limitations and Future Work

While BOB excels at fine-grained classification, the authors note a couple of key limitations:

  • Attribute Dependency: BOB relies on the assumption that class-agnostic attributes like "background" and "pose" can be cleanly separated from the object. Automating the discovery of these attributes for more abstract categories remains an open problem.
  • Coarse-Grained Scaling: Scaling this method to massive, diverse datasets like ImageNet is challenging because contexts become highly class-dependent (e.g., a fish belongs in water, and forcing it onto a runway context creates nonsensical data that might harm general classification).

Summary updated

BibTeX
@inproceedings{yang2026beyond,
  author = {William Yang and Xindi Wu and Zhiwei Deng and Esin Tureci and Olga Russakovsky},
  title = {{Beyond Objects: Contextual Synthetic Data Generation for Fine-Grained Classification}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=guU164lGn2},
}
Figure