Abstract
Diffusion Models (DMs) have evolved into advanced image generation tools, especially for few-shot fine-tuning where a pretrained DM is fine-tuned on a small set of images to capture specific styles or objects. Many people upload these personalized checkpoints online, fostering communities such as Civitai and HuggingFace. However, model owners may overlook the potential risks of data leakage by releasing their fine-tuned checkpoints. Moreover, concerns regarding copyright violations arise when unauthorized data is used during fine-tuning. In this paper, we ask: "Can training data be extracted from these fine-tuned DMs shared online?" A successful extraction would present not only data leakage threats but also offer tangible evidence of copyright infringement. To answer this, we propose FineXtract, a framework for extracting fine-tuning data. Our method approximates fine-tuning as a gradual shift in the model's learned distribution -- from the original pretrained DM toward the fine-tuning data. By extrapolating the models before and after fine-tuning, we guide the generation toward high-probability regions within the fine-tuned data distribution. We then apply a clustering algorithm to extract the most probable images from those generated using this extrapolated guidance. Experiments on DMs fine-tuned with datasets such as WikiArt, DreamBooth, and real-world checkpoints posted online validate the effectiveness of our method, extracting approximately 20% of fine-tuning data in most cases, significantly surpassing baseline performance.
Introduction
The explosion of personalized AI has led to thousands of "checkpoints"—fine-tuned versions of models like Stable Diffusion—being shared online. Techniques like DreamBooth and LoRA allow users to teach a model a specific person’s face, a unique art style, or a private object using just a few images. However, these models often "memorize" their training data. This research investigates a critical security and ethical question: Can an attacker extract the original training images from these publicly shared checkpoints? If so, it reveals a massive data leakage risk for sensitive information and provides a "smoking gun" for artists seeking evidence of copyright infringement.
Methodology: The FineXtract Framework
The authors introduce FineXtract, a framework designed to reverse-engineer training data through three main components:
- Model Guidance: Instead of standard generation, FineXtract analyzes the shift in the model's learned distribution. By comparing the score functions (gradients) of the original pretrained model and the fine-tuned checkpoint, the method extrapolates the difference to create a "pseudo-denoiser." This steers the generation process specifically toward the high-probability regions of the fine-tuning dataset.
- Hard Prompt Extraction: Often, the exact text prompt used during fine-tuning is unknown. The authors discovered that the first trainable linear projection layers in the cross-attention module act as a "leak." They developed an optimization algorithm using PCA to recover the text embeddings of the training captions directly from the model weights.
- Clustering for Refinement: Because diffusion is stochastic, the model generates many variations. FineXtract generates a large set of images and then uses a clustering algorithm (based on SSCD similarity) to find "cliques" of nearly identical images. The "center" of these clusters is usually a near-perfect match for a training image.
Experimental Evaluation
The researchers evaluated FineXtract across several scenarios, including WikiArt for style-driven generation and the DreamBooth dataset for object-driven generation. They also tested 10 real-world checkpoints downloaded from HuggingFace (e.g., "mau-cat", "mr-potato-head") across various base models like Stable Diffusion (v1.4), SDXL (v1.0), AltDiffusion, and FLUX.1 [dev].
Key Results
- High Extraction Rates: In many cases, FineXtract successfully extracted about 20% of the original fine-tuning data.
- Superior Performance: On the WikiArt dataset using DreamBooth, FineXtract achieved an Average Extraction Success Rate (A-ESR) of 0.22, compared to just 0.01 for standard text-to-image baselines.
- Visual Fidelity: The method proved effective not just on Stable Diffusion, but also on high-resolution models like SDXL. As shown in the comparison below, the extracted images are nearly indistinguishable from the original training samples.
Discussion and Limitations
The paper highlights a "Utility-Privacy Paradox." While defenses like RandAugment and Cutout can hinder data extraction, they also severely degrade the quality of the images the model produces, suggesting that protecting privacy currently comes at a high cost to the model's artistic value.
Furthermore, FineXtract requires loading both the base model and the fine-tuned checkpoint simultaneously, which increases GPU memory requirements. The graph-based clustering algorithm can also become computationally expensive as the number of generated images grows. The authors conclude that future work is needed to develop fine-tuning methods that are inherently privacy-preserving without sacrificing image quality.
Summary updated