Fake & Square: Training Self-Supervised Vision Transformers with Synthetic Data and Synthetic Hard Negatives

Nikolaos Giakoumoglou, Andreas Floros, Kleanthis Marios Papadopoulos, Tania Stathaki

TL;DR

Contrastive self-supervised learning typically depends on vast collections of real images and carefully curated hard negatives. This paper introduces $\text{Syn}^2\text{Co}$, a framework that explores "faking" both components for Vision Transformers by combining diffusion-generated synthetic images with synthetic hard negatives synthesized directly in latent representation space. The findings reveal that while synthetic data provides a viable complement to real data, different transformer architectures (DeiT vs. Swin) respond drastically differently to synthetic enhancements.

What Problem Does This Paper Address?

Self-supervised contrastive learning has emerged as a powerful paradigm for training computer vision models without human annotations. However, it suffers from two fundamental bottlenecks:

  1. Data Hunger: Vision Transformers (ViTs) lack inductive biases (such as translation equivariance found in CNNs) and typically require massive volumes of real-world imagery to learn generalizable visual features.
  2. Scarcity of Hard Negatives: Contrastive loss functions (like InfoNCE) depend on informative negative samples to map out fine-grained semantic boundaries. In standard memory queues or batch sampling, truly informative hard negatives are rare.

The authors ask: Can we "fake it till we make it" by replacing or augmenting both raw training images and negative contrastive samples with synthetic alternatives?

Methods

Building on the MoBY self-supervised framework, the authors introduce $\text{Syn}^2\text{Co}$, targeting two distinct levels of synthesis:

[Synthetic Images (Xs)] ──> [Online / Target ViTs] ──> [Query Representation (q)]
         +                                                       │
  [Real Images (X)]                                              ▼
                                                   [Synthetic Hard Negatives (Qs)]
                                                   (Generated on-the-fly in latent space)
  • Image-Space Synthesis ($\mathcal{X}_s$): The authors generate a synthetic clone of the training set using Relay Diffusion, a class-conditional diffusion model, allowing training on purely real data, purely synthetic data, or mixed ratios.
  • Representation-Space Synthesis ($Q_s$): Instead of generating images to serve as negatives, synthetic hard negatives are constructed on the fly inside the feature space. Given a query representation $q$ and a queue of memory negatives $Q$, the top-$N$ hardest negatives ($Q^N$) are retrieved using cosine similarity. A synthesis function $\mathcal{F}$ (evaluating strategies such as interpolation, mixing, perturbation, and noise jittering) produces normalized synthetic negatives $s$, which are merged into the negative queue.
  • Backbone Architectures: Evaluated on two standard Vision Transformers: DeiT-S (standard columnar ViT) and Swin-T (hierarchical shifted-window ViT).

Datasets

  • ImageNet-100: A 100-class subset of ImageNet-1k commonly used for self-supervised benchmarking.
  • Synthetic ImageNet-100 Clone: Approximately 130,000 synthetic images generated using Relay Diffusion, matching the class balance of the real ImageNet-100 dataset.
  • Evaluation: Linear probing top-1 and top-5 classification accuracy on ImageNet-100.

Key Insights and Ideas

  • Architectural Discrepancies: Different transformer designs do not leverage synthetic signals in the same way:
  • DeiT-S thrives when synthetic data and synthetic hard negatives are combined during extended training, achieving significant performance gains.
  • Swin-T benefits almost exclusively from representation-level synthetic negatives and experiences degraded performance when synthetic images are introduced into the dataset.
  • Synthetic Data Has Diminishing Returns: While a model can learn reasonable representations purely from synthetic diffusion images (reaching ~55–57% top-1 linear probing on DeiT-S without a single real image), performance scales with the fraction of real data. Synthetic images act as valuable supplements, not complete replacements, due to diffusion-induced distribution shifts.
  • Latent-Space Hard Negatives Are Computationally Cheap: Synthesizing negatives directly in representation space provides informative semantic contrast boundaries without the computational overhead of rendering additional synthetic images.

Key Results

Linear probing accuracy on ImageNet-100 shows that synthetic enhancements can rival or outperform standard pre-training:

Method Synthetic Images Synthetic Negatives Epochs DeiT-S Top-1 (%) Swin-T Top-1 (%)
Supervised Baseline — — 300 80.50 86.78
MoCo-v3 ✗ ✗ 400 79.41 —
MoBY Baseline ✗ ✗ 300 79.36 83.90
$\text{Syn}^1\text{Co}$ ✗ ✓ 300 78.96 84.04
$\text{Syn}^1\text{Co}$ ✓ ✗ 300 81.86 83.68
$\text{Syn}^2\text{Co}$ ✓ ✓ 300 82.12 83.70
  • For DeiT-S, $\text{Syn}^2\text{Co}$ sets the high mark at 82.12%, outperforming both the MoBY baseline (79.36%) and the fully supervised DeiT-S model (80.50%).
  • For Swin-T, using synthetic negatives alone ($\text{Syn}^1\text{Co}$) achieved the best self-supervised mark at 84.04%, outperforming baseline MoBY (83.90%).

Limitations and Future Work

  • Hyperparameter Sensitivity: Hard negative synthesis requires careful tuning of candidate pool size ($N$) and injection ratios ($L/(K+L)$); DeiT-S is particularly sensitive to these hyperparameters.
  • Domain and Distribution Shifts: Diffusion-generated images do not perfectly match real-world distributions, limiting their utility when used as total replacements.
  • Scale: Experiments were constrained to ImageNet-100 and small transformer models (DeiT-S, Swin-T). Validating whether these dynamics hold on ImageNet-1k, web-scale datasets, or larger architectures (ViT-Base/Large) remains open for future research.

Summary updated

BibTeX
@inproceedings{giakoumoglou2025fake,
  author = {Nikolaos Giakoumoglou and Andreas Floros and Kleanthis Marios Papadopoulos and Tania Stathaki},
  title = {{Fake \& Square: Training Self-Supervised Vision Transformers with Synthetic Data and Synthetic Hard Negatives}},
  booktitle = {LIMIT @ ICCV},
  year = {2025},
  url = {https://openreview.net/forum?id=TJUfbYKo2c},
}
Figure