Editor’s introduction
The research evaluates diffusion models’ behavior when exposed to synthetic anatomical fingerprints—rare, manually injected image features. Across multiple conditioning methods, models consistently either memorize entire training images or fail to generalize these rare features to new images, showing no intermediate behavior. This suggests a fundamental limitation in the models’ ability to represent unique anatomical signals without risking privacy violations or introducing fairness biases. The study identifies that highly surprising conditioning signals increase memorization risk, while low-surprisal signals suppress rare features, even when they appear repeatedly in training data. The results are limited to the specific framework and probes used, and do not generalize to all generative models or imaging modalities.
Introduction
Since the development of statistical models capable of representing and synthesizing new samples from existing dataset distributions, the idea of training generative models on private data and sharing only the model or synthetic datasets has gained traction. Such methods could address issues such as data scarcity for rare diseases, gender bias, and challenges including robust domain adaptation and generalisation, though these benefits have not yet been demonstrated with synthetic data. However, maintaining privacy and anonymity is essential when working with personally identifiable information. Incorporating privacy-preserving techniques into the training process, so that only the statistical properties of private data are replicated without revealing any individual samples, therefore holds substantial promise for secure data sharing in healthcare. However, these methods usually lead to degraded downstream performance and have not yet demonstrated to work at scale on high-resolution images.
Recent advances in generative modeling, including diffusion models, have expanded the feasibility of sharing models directly. Despite efforts of evaluating the memorization capabilities of generative models, it remains unclear to what extent shared models reproduce training samples, which would raise potential data privacy concerns. Guarantees against privacy breaches would allow models to be trained on proprietary data and shared in place of the underlying datasets, enabling fully anonymous data sharing. Healthcare providers could potentially distribute complex yet anonymous patient information, such as medical images, by modeling population-level data distributions. While federated learning offers an alternative by keeping data local, it requires complex orchestration, secure aggregation, and strict coordination between institutions. Privacy-preserving synthetic data sharing could complement federated approaches by enabling knowledge aggregation without such infrastructural overhead, though it remains an open question whether sufficient privacy guarantees can be achieved in practice.
Memorization Detection and Mitigation
Another direction is to adopt differential privacy. These methods modify the training procedure to provide explicit privacy guarantees and a quantifiable privacy budget, but at the cost of substantially increased training complexity. As a result, their practical applicability has so far been demonstrated mainly on small datasets. Similarly, differentially private fine-tuning can mitigate memorization but typically leads to a severe degradation in image quality. In general, the impact of applying these methods is too disruptive to be feasible and is often highly specific to the model architecture. Moreover, they require specialized training procedures that are incompatible with existing pretrained models, which we do not have access to. For these reasons, we argue that improving the understanding and detection of memorization is currently a more practical and effective route toward mitigation.
Current work also actively explores the interplay between training hyperparameters and image memorization of diffusion models. Cited researchers explore training the interplay between model size, training length, and dataset size and derive scaling rules for it. They specifically focus on the region when the generative model starts to generalize. A cited study observed in a theoretical framework, that the learning rate of diffusion models is also a key factor for model memorization.
Fairness
Fairness in AI is a well-explored yet unsolved problem. Current directions in the literature for discriminative tasks suggest frameworks for benchmarking or reveal important design choices for training fair models. Most of them provide guidance for designing and testing downstream models for fairness. Generative models are mainly used to improve fairness, but their own biases and unfairness remain underexplored. Throughout this work, we use “fairness” to refer specifically to representational and distributional fairness, i.e. whether rare or long-tail features in the training data are preserved in generated outputs. This is distinct from clinical downstream fairness notions such as demographic parity or equalized subgroup performance, which depend on task-specific evaluation. It is often assumed that generative models learn the entire data distribution without further evaluation. Current approaches mainly investigate fairness of generative models by looking at demographic statistics. Relatedly, a growing body of work studies long-tail generation in diffusion models, aiming to improve the fidelity and diversity of rare classes. Cited researchers propose calibrated diffusion mechanisms that leverage images from the head classes to better generate tail-class images. address rare concept generation by selecting optimal noise seeds at inference time, enabling faithful synthesis of infrequent visual concepts without retraining. further connect long-tail generation to robustness by guiding diffusion models toward epistemically uncertain regions, improving downstream generalization through targeted data synthesis. While these methods substantially advance tail coverage and utility, they primarily evaluate success through class-conditional fidelity, diversity, or downstream performance gains. Both approaches do not properly account for the fact that within certain subgroups there may be demographic differences as well. for example explore how a retrieval-based metric can be used to quantize gender unfairness in text-to-image models. This highlights an important gap between long-tail generative modeling and fairness analysis: improving coverage of rare features does not necessarily ensure fair representation, and may interact with privacy and demographic imbalance in subtle ways.
Interventional Probing
Interventional analysis focuses on identifying causal effects by actively modifying the data a model learns from or is evaluated on. Rather than relying on correlations in model behavior, it tests whether controlled changes to the data distribution lead to predictable changes in model outputs. This type of analysis is most commonly applied in downstream settings, where generative models are used to synthesize targeted interventions. A central concept in this area is counterfactual image generation, which explicitly studies the causal and non-causal relationships between interventions and model predictions and is widely used to investigate spurious correlations. A cited study introduced a framework for benchmarking counterfactual image generation, focusing on diversity and fidelity of the generated interventions. Cited researchers use GANs to generate image-level interventions by specifying semantic attributes and leveraging attention maps to localize the intervention to specific regions. perform model-level interventions in the feature space of a generative model to steer generations along semantically meaningful directions, improving robustness of downstream models. study interventions at the classifier level, using diffusion-based counterfactuals to detect and mitigate shortcut learning. Unlike these approaches, our method focuses on data-interventions for training the diffusion model itself, not the downstream models.
Evaluation of Image Generation Models
The evaluation of diffusion models is predominantly centered on fidelity by comparing distributional similarity, most commonly measured using the Fréchet Inception Distance (FID). Sample diversity is typically assessed via precision and recall metrics. While widely adopted, these metrics offer limited interpretability and provide little insight into how individual training samples or rare features are represented. Cited researchers propose the Fréchet Radiomic Distance (FRD), a perceptual metric based on clinically meaningful radiomic features that better captures anatomical differences than FID. Retrieval-based evaluation using image retrieval score (IRS) has been proposed as an alternative, enabling more fine-grained analysis of representational similarity.
Memorization in generative models is most commonly studied using loss-based criteria, which analyze discrepancies in likelihood or reconstruction error between training and non-training samples. Other approaches frame memorization as a copy-detection problem and rely on trained Siamese networks to identify near-duplicates between generated and training images. While effective, these methods operate externally to the generative process and treat the model largely as a black box.
Experimental details
We evaluate three types of synthetic anatomical fingerprints (SAFs) to assess whether our findings depend on the specific form of the injected feature. Circular fingerprints are purely synthetic and consist of a gray disk with a fixed radius of 72 pixels, placed at a predefined location within the region typically occupied by image content. These fingerprints are visually simple and trivial to detect, which makes automated detection reliable and serves as a controlled baseline. To study visually more realistic fingerprints, we construct PII-based fingerprints using PII, which is known to introduce highly realistic local features and is commonly used in anomaly detection settings. For ChestX-ray14, we select source images containing a medical support device and inpaint the corresponding region into target images at locations where such devices are not present. This ensures that no real training sample contains a visually similar feature at the target location. We experiment with feature fingerprints derived from image-level labels. Specifically, we use sex for ChestX-ray14, staining type for BCI, and the physical side of the eye for ODIR-2019. Since these attributes are real but globally defined, we synthetically localize them by applying PII to all images with the opposite label. This allows us to reuse the same classifier used for PII-based fingerprints to detect these features. Effectively, this procedure turns a real attribute into a synthetic, localized fingerprint while preserving a robust decision boundary for detection. To quantify memorization behavior across fingerprint types, we additionally compute the peak signal-to-noise ratio (PSNR). Specifically, we compute the PSNR between 1,000 generated samples and all images in the training set, and report the maximum value. High PSNR values indicate strong pixel-level similarity to a training image and are therefore indicative of potential memorization.
Evaluation Summary
Across all experiments, we evaluated how dataset size, training duration, model capacity, fingerprint type, and the number of fingerprinted samples influence memorization and generalization in diffusion models. Small datasets consistently caused the models to reproduce training images, constituting clear privacy violations. Larger datasets shifted behavior toward broader synthesis but still showed fairness issues when long tail features were underrepresented. Varying the training length revealed that extended optimization often led to mode collapse rather than increased memorization, except for very small datasets where memorization persisted. Reducing model size lowered the likelihood of reproducing training samples but degraded generative quality and caused the model to forget rare features. The type of fingerprint used for the analysis has minimal influence. We found that a minimum number of fingerprinted examples is required for a model to generalize a unique feature instead of memorizing or omitting it. Consequently, diffusion models face a consistent trade-off: limited data or capacity leads to memorization, while attempts to reduce memorization risk often suppress rare but important clinical information.
Setup
For class conditioning, we employ EDM-2 autoguidance, building on the EDM-2 framework. For text conditioning, our setup follows, with the fine-tuning procedure adapted from. As text conditioning, we use the impression sections of the reports. Due to internal limitations of the language encoder, prompts are truncated after 77 tokens. Selecting high surprisal images without manual supervision resulted in outliers being chosen. These included side views, completely white images, or images with excessively large margins. We therefore manually removed such samples during preprocessing. For mask conditioning, we use ControlNet. The model is trained according to the recommendations of the original publication for a total of 10,000 optimization steps. We use the finetuned text-conditional model as the initial checkpoint and empty strings as text conditioning. Feature conditioning uses image features extracted with an Inception network following. While these features are not medically meaningful, their visual alignment facilitates the generation of realistic images. We compute the features on images without SAFs but train the model on images containing SAFs.
Dataset
All models are trained and evaluated on the same dataset and data split, using a single conditioning signal per image. Specifically, we use a curated subset of MIMIC-CXR restricted to samples with a single positive label to enable class conditional generation. All images are associated with an available impression and are limited to posterior anterior (PA) views only. Lung segmentation masks are available for all images. For feature based generation, we extract feature vectors using an InceptionV3 model pretrained on ImageNet. The resulting dataset contains 64,198 images, split into 38,493 training samples, 6,278 validation samples, and 19,427 test samples, with four different conditioning signals per image.
Limitations
Our analysis relies on SAFs as controlled proxies for rare or sensitive features. While SAFs enable systematic and observable memorization experiments, they do not capture the full semantic complexity of real protected attributes. Consequently, memorization behavior observed for SAFs may differ from memorization of naturally occurring patient identifiers or clinically meaningful rare patterns. Additionally, memorization assessment is sensitive to numerous design choices, including model architecture, training duration, optimization objectives, dataset composition, and preprocessing strategies, which can lead to inconsistencies across evaluations. We remain consistent within our desing choices, but results may vary for other approaches. In the conditional setting, the compared architectures differ not only in conditioning type but also in backbone design (e.g., class-conditional DDPM vs. text-conditional Stable Diffusion vs. ControlNet), making it difficult to attribute observed differences to conditioning alone. Nevertheless, the consistent relationship between conditioning surprisal and memorization behavior across all tested architectures suggests that the information-theoretic perspective captures a fundamental property of the conditioning mechanism. Furthermore, the proposed memorization indicator provides evidence about a model’s capacity to memorize training samples, but it cannot establish the absence of memorization. In particular, failure to detect memorization should not be interpreted as a hard privacy guarantee, especially for large or highly redundant datasets. Additionally, some cases classified as forgetting may instead represent poor-quality generalization that falls below the classifier detection threshold. Whether such low-fidelity reproductions are useful for downstream clinical tasks, or whether they degrade performance similarly to complete omission, remains an open question that requires task-specific evaluation. Finally, our notion of fairness is limited to representational and distributional fairness, whether rare features are preserved in generated outputs, and does not address clinical downstream fairness such as demographic parity or equalized subgroup performance.
Conclusion
HPC resources were provided by the Erlangen National High Performance Computing Center (NHR@FAU), under the NHR projects b143dc and b180dc. NHR is funded by federal and Bavarian state authorities, and NHR@FAU hardware is partially funded by the DFG - 440719683. We acknowledge the use of Isambard-AI National AI Research Resource (AIRR). Isambard-AI is operated by the University of Bristol and is funded by the UK Government’s DSIT via UKRI; and the Science and Technology Facilities Council [ST/AIRR/I-A-I/1023]. The authors received funding from the ERC-project MIA-NORMAL 101083647, DFG 513220538, 512819079, and by the state of Bavaria (HTA).
MD declares no conflicts of interest. BK is a consultant for ThinkSono Ltd. and a co founder of Fraiya Ltd. Neither company was involved in the conception, design, execution, analysis, or interpretation of the work presented here.
Limitations
The information measures presented here rely on simplifying assumptions and their absolute magnitudes should be interpreted with caution. The text and mask based formulations assume statistical independence across tokens and pixels, although real prompts exhibit syntactic structure and masks contain rich spatial correlations. The feature based estimates assume that the high dimensional latent space is well described by a single multivariate Gaussian, despite the fact that deep representations are often multi modal or heavy tailed. Continuous feature densities must be converted to bits using a chosen quantization scale, which adds an unavoidable offset determined by the selected bin width. In addition, all estimates are subject to finite sample bias. Rare features, rare tokens, and uncommon mask configurations are difficult to estimate reliably and lead to biased entropy values. The preprocessing steps required for each modality, such as resizing masks, truncating text prompts, or relying on a fixed pretrained feature extractor, introduce additional dependencies that influence the probability models. Although expressing all conditioning signals in bits provides a unified view, comparability across modalities remains imperfect. Bits derived from pixel level Bernoulli variables do not carry the same semantics as bits derived from token presence or quantized latent vectors. Finally, entropy measures the variability of the conditioning source, not its usefulness for generation. For these reasons the reported values should be viewed as relative indicators of conditioning complexity rather than precise absolute information quantities.


