Harnessing Synthetic Datasets: The Role of Shape Bias in Deep Neural Network Generalization

Elior Benarous, Sotiris Anagnostidis, Luca Biggio, Thomas Hofmann

TL;DR

While "shape bias"—the preference of a model to classify images based on global shape rather than local texture—is often celebrated as a hallmark of human-like visual understanding, it is not a reliable predictor of downstream generalization when pre-training on synthetic data. Instead, shape bias is heavily entangled with dataset diversity and visual smoothness; tracking how shape bias scales with dataset size offers a novel, reference-free proxy for evaluating synthetic dataset diversity without relying on pre-trained metrics like FID.

What Problem Does This Paper Address?

As modern vision models hit data-scaling bottlenecks and face privacy or copyright concerns associated with web-scraped data, procedurally generated and GAN-based synthetic datasets have emerged as viable pre-training alternatives. Prior research suggests that synthetic data does not need to look strictly realistic, provided it captures essential structural properties and diversity.

In visual perception, human vision relies overwhelmingly on shape cues (~96%), whereas convolutional networks (CNNs) historically rely on texture (~25% shape bias). While scaling massive Vision Transformers (ViTs) can push shape bias to ~87%, whether shape bias directly drives—or indicates—a model's ability to generalize to out-of-distribution (o.o.d.) real-world data remains unclear. The authors examine the role of shape bias during synthetic pre-training to determine whether it can serve as a dependable metric for synthetic dataset quality and generalization.

Methods

  • Architectures Evaluated: ResNet-18, ResNet-50, and customized Vision Transformers (ViT-p8 and ViT-p16 with 7 encoder layers, 8 attention heads, and a hidden dimension of 512, split into $8\times8$ and $16\times16$ patch grids).
  • Self-Supervised Pre-Training: For unlabeled synthetic datasets, models are trained via contrastive learning using the normalized temperature-scaled cross-entropy loss (NT-Xent / SimCLR framework; temperature $\tau = 0.5$) with cosine similarity between random image crops. Supervised learning was applied when labels were present.
  • $K$-NN Shape Bias Metric: Rather than training a linear classification head, the authors pass the Cue Conflict benchmark through the frozen encoder and perform a $K$-nearest-neighbors ($K=5$) classification on the embeddings using cosine distance. Shape bias is measured as: $$\text{Shape Bias} = \frac{\text{Correct Shape Classifications}}{\text{Correct Shape Classifications} + \text{Correct Texture Classifications}}$$
  • Downstream Transfer: Generalization is evaluated by freezing the pre-trained encoder, randomly reinitializing the classification head, and fine-tuning for 2 epochs on Tiny ImageNet.
  • Diversity Estimation via Scaling: Pre-training models on subsets (5%, 25%, 50%, 75%, 100%) of each dataset to track how shape bias evolves as the number of available samples increases.

Datasets

  • Synthetic Datasets (each containing 95k images, standardized to $64\times64$):
  • Fractals: Procedurally generated fractal patterns exhibiting scale-invariance.
  • StyleGAN - Random: Untrained, randomly initialized StyleGANv2 generator.
  • StyleGAN - High-freq: Untrained StyleGANv2 with supplementary noise maps and wavelet filters.
  • StyleGAN - Sparse: Adds random convolutional bias and Laplacian noise to mimic natural image sparsity.
  • StyleGAN - Oriented: Integrates oriented edge structures using tied wavelets.
  • Shaders-21k StyleGAN: StyleGANv2 trained on procedurally rendered shaders from the Shaders-21k dataset.
  • Evaluation Benchmarks:
  • Cue Conflict: 1,200 style-transferred images possessing contradictory shape and texture labels.
  • Tiny ImageNet: Used as a natural real-world dataset for baseline comparisons and downstream out-of-distribution evaluation.

Key Insights and Ideas

  • Shape bias is architecture- and token-dependent: ViTs with smaller patches ($8\times8$, ViT-p8) produce a noticeably lower shape bias than $16\times16$ patches (ViT-p16). More patches emphasize local textural cues over global context, demonstrating that shape bias is strongly dictated by tokenization granularity, not just dataset semantics.
  • High shape bias can be an artifact of texture paucity: Counterintuitively, StyleGAN - Random produced the highest shape bias among synthetic datasets, despite performing poorly on downstream real-world tasks. Because its outputs are visually smooth and lack high-frequency noise, models simply have no texture cues to learn from—artificially inflating shape bias without imparting useful features.
  • Generalization tracks diversity and naturalism, not shape bias: Downstream performance on Tiny ImageNet was highest for Shaders-21k StyleGAN, the most procedurally diverse dataset, even though its shape bias was lower than that of StyleGAN - Random.
  • Shape bias as a metric for dataset diversity: Because deep networks prioritize low-frequency patterns first (spectral bias), increasing the sample count of a diverse dataset (like Tiny ImageNet) steadily increases shape bias by mitigating high-frequency texture overfitting. On synthetic datasets, shape bias quickly saturates (peaking at 5% to 25% of the data), revealing a fundamental deficiency in shape diversity.

Key Results

  • Downstream Transfer: Models pre-trained on Shaders-21k StyleGAN reached the highest downstream accuracy on Tiny ImageNet (~35%), whereas StyleGAN - Random achieved lower accuracy (~30%) despite leading synthetic shape bias scores.
  • Shape Bias Across Pre-Training: On synthetic data, shape bias systematically decays over training epochs (converging to between 0.35 and 0.7 depending on the dataset), whereas on Tiny ImageNet, shape bias increases during training for all supervised models and self-supervised ViTs.
  • Sample Scaling Plateau: On Tiny ImageNet, shape bias steadily climbs from ~0.45 to ~0.60 as the dataset scales from 5% to 100%. In contrast, synthetic datasets show negligible change: Fractals peaks at 25% of data, StyleGAN - Sparse peaks at only 5%, and both Shaders-21k StyleGAN and StyleGAN - Random vary by merely 0.5%–1.1% between 25% and 100% data fractions.

Limitations and Future Work

  • Compute and Scale Constraints: Experiments were conducted using scaled-down models (7-layer ViT, ResNet-18/50) and low-resolution images ($64\times64$). Trends may alter at large generative resolutions and billion-parameter foundation scales.
  • Single Transfer Benchmark: Downstream out-of-distribution transfer was evaluated strictly on Tiny ImageNet; evaluating across diverse classification and segmentation benchmarks remains open.
  • Open Synthetic Design Space: While the authors demonstrate that shape bias can signal a lack of structural diversity, creating generative recipes that reliably marry high structural variation with naturalistic high-frequency details remains an unresolved challenge.

Summary updated

BibTeX
@inproceedings{benarous2023harnessing,
  author = {Elior Benarous and Sotiris Anagnostidis and Luca Biggio and Thomas Hofmann},
  title = {{Harnessing Synthetic Datasets: The Role of Shape Bias in Deep Neural Network Generalization}},
  booktitle = {SyntheticData4ML @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=LS3aKnm7fw},
}
Figure