TL;DR
This paper investigates why models trained on synthetic data generated by foundation models like Stable Diffusion perform worse than those trained on real data. They discover that the accuracy drop primarily occurs in the later layers of the model. This insight leads to a more data-efficient fine-tuning strategy: pre-training most layers on synthetic data and then fine-tuning only the final few layers with a smaller amount of real data, significantly reducing the need for labeled real data.
What Problem Does This Paper Address?
The rise of powerful generative foundation models, such as Stable Diffusion, has opened exciting avenues for creating synthetic data to train downstream computer vision models. This is particularly appealing given the high cost and scarcity of labeled real-world data. However, a persistent challenge is the significant drop in accuracy observed when models are trained solely on this synthetic data compared to those trained on real data. This "synthetic-to-real gap" limits the practical utility of synthetic data. This paper aims to understand the root causes of this gap, specifically by examining the role of different layers within a neural network during transfer learning.
Methods
The core of this research involves a series of transfer learning experiments. The authors systematically investigate the impact of freezing different numbers of initial layers of a model pre-trained on either synthetic or real data, and then retraining the remaining layers on the "other" type of data.
- Synthetic Data Transfer Learning (SDTL): They pre-train a model on synthetic data, freeze the first $N$ layers, and then train the remaining layers on real data. This helps understand how much of the synthetic data's learned representations are useful and where the limitations lie.
- Real Data Transfer Learning: Conversely, they pre-train a model on real data, freeze the first $N$ layers, and train the rest on synthetic data. This helps understand how well synthetic data can compensate for real data in later stages of learning.
- Layer Importance Analysis: By varying $N$ (the number of frozen layers), they can pinpoint which layers are most affected by the shift from synthetic to real data.
- Data Reduction Experiments: Building on the layer importance findings, they explore the data efficiency of fine-tuning. They pre-train most layers on synthetic data and then fine-tune only the last few layers with progressively smaller subsets of real data to see how much real data is truly necessary.
Datasets
The experiments were conducted on two primary datasets:
- ImageNet-100: A subset of ImageNet, used for its manageable size and comparability with prior work.
- Oxford-IIIT Pet: Another dataset used to validate findings across different domains.
Synthetic data for these datasets was generated using Stable Diffusion XL, with prompts derived from WordNet definitions to ensure consistency with previous research.
Key Insights and Ideas
- The "Final Layer Bottleneck": The most striking finding is that the accuracy gap between synthetic and real data primarily originates from the final layers of the student model. This suggests that earlier layers learn generalizable features from synthetic data, but the later layers struggle to adapt to the nuances of real-world data.
- Synthetic Data is Surprisingly Effective Early On: The experiments show that a significant portion of a model's layers can be effectively pre-trained on synthetic data without a drastic drop in performance when fine-tuned on real data. This highlights the power of foundation models in generating semantically rich, albeit imperfect, representations.
- Data-Efficient Fine-Tuning is Possible: By identifying that only the last few layers are critical for bridging the synthetic-to-real gap, the research proposes a more efficient fine-tuning strategy. This approach significantly reduces the reliance on large amounts of labeled real data, which is a major bottleneck in many applications.
Key Results
- When transferring the first 16 layers pre-trained on synthetic data and fine-tuning the last layers on real ImageNet-100 data, the top-1 accuracy only dropped by about 3.5 percentage points compared to a model trained entirely on real data. However, replacing the 17th layer (out of 18) with synthetic pre-training caused a much larger drop.
- In data reduction experiments, fine-tuning only the last two layers with synthetic pre-training for the earlier layers allowed for a significant reduction in real data usage. For instance, using just 1/8th of the real data resulted in only a 4.2 percentage point drop in top-1 accuracy, compared to a much steeper decline when training a model from scratch on reduced real data.
- The paper also shows that fine-tuning a model pre-trained on real data with synthetic data in the later layers did not yield significant improvements, reinforcing the idea that the early layers are more robust to synthetic data.
Limitations and Future Work
- Dataset Specificity: While the findings are consistent across ImageNet-100 and Pets, the exact layer sensitivity might vary for different datasets and model architectures.
- Augmentation Impact: The paper notes that while data augmentation is crucial for synthetic data training, their experiments with sophisticated augmentation pipelines did not fully bridge the gap, suggesting that augmentation alone is not a complete solution.
- Future Work: The authors suggest further exploring the specific characteristics of the final layers that cause the performance drop and investigating more targeted fine-tuning strategies. They also highlight the potential for this research to inform more efficient training pipelines, especially in data-scarce scenarios.
Summary updated