TL;DR
Detecting whether a specific image was used to pre-train a commercial text-to-image model is incredibly difficult because black-box APIs hide internal states and pre-training data leaves faint memorization traces. This paper introduces SD-MIA, a black-box membership inference attack that bypasses these limitations by perturbing the textual prompts rather than the images. By exploiting "representation-region collapse" in text embeddings, SD-MIA reliably identifies pre-training data across both open-source and commercial models like DALL-E 3 and Gemini.
What Problem Does This Paper Address?
As diffusion models proliferate, concerns over copyright and unauthorized data usage have skyrocketed. Membership Inference Attacks (MIAs) aim to audit these models by determining if a specific image was part of their training set. However, existing MIAs suffer from two major flaws:
- The Pre-training Gap: Most methods are evaluated on heavily overfitted fine-tuned models. In reality, the vast majority of data is consumed during massive pre-training phases, where memorization is much weaker, causing traditional image-perturbation attacks to fail.
- The Black-Box Barrier: Advanced pre-training MIAs often rely on "gray-box" access—requiring intermediate noise predictions or gradients. Commercial platforms (e.g., OpenAI, Google) only provide a strict black-box API (text prompt in, image out), rendering these methods useless in practice.
Methods
The authors observe that image-space perturbations are quickly smoothed away by the VAE encoder and stochastic diffusion process. Text embeddings, however, remain un-noised throughout generation. For training images, models internalize locally overfitted text-to-image mappings, causing a phenomenon the authors call representation-region collapse (where a neighborhood of semantically close text variants still maps to the same image mode).
SD-MIA leverages this via two main steps:
- Multi-view Textual Perturbation: Using an LLM (GPT-5), the framework generates three types of prompt variations: token-view (lexical rephrasing), style-view (altering artistic style), and semantic-view (minor subject adjustments).
- Maximum Cross-Modal Relevance Estimation: Since exact generation probabilities are hidden, SD-MIA uses a surrogate metric: the joint cross-modal relevance (via CLIP embeddings of images and captions) between the target image and the newly generated images. To counter the inherent randomness of diffusion, a maximum-relevance pooling mechanism selects the top $K\%$ of scores across multiple generations.
Datasets
- LAION-mi: An established public benchmark containing pre-training samples from Stable Diffusion v1.2–v1.5, paired with non-member samples aligned to the same data distribution to prevent benchmark bias.
- FlickrMIA-25: A new benchmark constructed by the authors to emulate real-world settings. Members are sourced from LAION-2B, while non-members are selected from Flickr images uploaded after January 1st, 2025, ensuring strict temporal disjointness from the training data of current models.
Key Insights and Ideas
- Text is more stable than pixels: Image perturbations vanish due to VAE contraction and diffusion noise, making members and non-members look identical under pixel-level attacks. Text perturbations bypass this bottleneck entirely.
- Representation-Region Collapse: For member data, a neighborhood of semantically proximate text variants funnels into a single visual mode. For non-members, no such collapsed structure exists, so text changes cause wildly divergent image outputs.
- Stochasticity can be tamed with Max-Pooling: Instead of averaging results (which dilutes the signal), taking the maximum relevance across multiple resampled generations cleanly separates member and non-member behaviors.
Key Results
- Outperforming Gray-Box Methods: On Stable Diffusion v1.5, SD-MIA achieved an Area Under the ROC Curve (AUC) of ~66%, outperforming the strongest gray-box baseline (DRC) by up to 10% AUC, despite having zero access to internal model features.
- Commercial Black-Box Success: Tested on closed-source APIs (DALL-E 3, Gemini 2.0, and GPT-4o), SD-MIA consistently maintained strong performance, proving its viability for real-world auditing.
- Robustness to Distortions: SD-MIA proved highly resilient to target image distortions like Gaussian blur, noise, and shear transformations, where traditional reconstruction baselines dropped to near-random performance.
- Cross-Architecture Generalization: Because it avoids diffusion-specific features, SD-MIA successfully transferred to Image Autoregressive Models (IARs) like Infinity, outperforming black-box baselines there as well.
Limitations and Future Work
- LLM Dependency: The method relies on an external large language model to generate high-quality, controlled textual perturbations, introducing an extra dependency and computational overhead.
- Query Costs: Querying commercial text-to-image APIs multiple times (e.g., 10 times per perturbed prompt) can be financially and computationally expensive for large-scale dataset auditing.
- Future Directions: The authors suggest exploring more optimized prompt-generation strategies to reduce the number of required API queries while maintaining high detection accuracy.
Summary updated